mirror of
https://github.com/zeldaret/tp
synced 2026-08-05 17:44:09 -04:00
@@ -389,16 +389,20 @@ template <typename T>
|
||||
struct TVec2 {
|
||||
TVec2() {}
|
||||
TVec2(T v) { set(v); }
|
||||
TVec2(T x, T y) { set(x, y); }
|
||||
|
||||
template <typename U>
|
||||
TVec2(U x, U y) { set(x, y); }
|
||||
|
||||
void set(T v) { y = x = v; }
|
||||
|
||||
void set(T x, T y) {
|
||||
template <typename U>
|
||||
void set(U x, U y) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
}
|
||||
|
||||
void set(const TVec2& other) {
|
||||
template <typename U>
|
||||
void set(const TVec2<U>& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
}
|
||||
@@ -481,9 +485,12 @@ template<> struct TBox<TVec2<f32> > {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TBox2 : TBox<TVec2<T> > {
|
||||
struct TBox2 : public TBox<TVec2<T> > {
|
||||
TBox2() {}
|
||||
TBox2(const TVec2<f32>& i, const TVec2<f32>& f) { set(i, f); }
|
||||
TBox2(const TVec2<f32>& _i, const TVec2<f32>& _f) {
|
||||
i.set(_i);
|
||||
f.set(_f);
|
||||
}
|
||||
TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); }
|
||||
|
||||
void absolute() {
|
||||
|
||||
Reference in New Issue
Block a user