|
@ -109,6 +109,16 @@ namespace gp { |
|
|
T y; |
|
|
T y; |
|
|
T z; |
|
|
T z; |
|
|
|
|
|
|
|
|
|
|
|
T& r(){ |
|
|
|
|
|
return x; |
|
|
|
|
|
} |
|
|
|
|
|
T& g(){ |
|
|
|
|
|
return y; |
|
|
|
|
|
} |
|
|
|
|
|
T& b(){ |
|
|
|
|
|
return z; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
vec3_g() |
|
|
vec3_g() |
|
|
: x{} |
|
|
: x{} |
|
|
, y{} |
|
|
, y{} |
|
@ -174,6 +184,19 @@ namespace gp { |
|
|
T z; |
|
|
T z; |
|
|
T w; |
|
|
T w; |
|
|
|
|
|
|
|
|
|
|
|
T& r(){ |
|
|
|
|
|
return x; |
|
|
|
|
|
} |
|
|
|
|
|
T& g(){ |
|
|
|
|
|
return y; |
|
|
|
|
|
} |
|
|
|
|
|
T& b(){ |
|
|
|
|
|
return z; |
|
|
|
|
|
} |
|
|
|
|
|
T& a(){ |
|
|
|
|
|
return w; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
vec4_g() |
|
|
vec4_g() |
|
|
: x{} |
|
|
: x{} |
|
|
, y{} |
|
|
, y{} |
|
@ -268,4 +291,7 @@ namespace gp { |
|
|
vec4_g<T> operator*(T v, vec4_g<T> p) { |
|
|
vec4_g<T> operator*(T v, vec4_g<T> p) { |
|
|
return p*v; |
|
|
return p*v; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static_assert(sizeof(gp::vec3_g<int>) == sizeof(int)*3, "vec3_g has strange alignment"); |
|
|
|
|
|
static_assert(sizeof(gp::vec4_g<int>) == sizeof(int)*4, "vec4_g has strange alignment"); |