diff --git a/rage/vector.hpp b/rage/vector.hpp index 285e6d7..c83f9e5 100644 --- a/rage/vector.hpp +++ b/rage/vector.hpp @@ -2,44 +2,86 @@ namespace rage { - template - union vector2 - { - T data[2]; - struct { T x, y; }; - }; - - template - union vector3 - { - T data[3]; - struct { T x, y, z; }; - }; + template + union vector2 + { + T data[2]; + struct { T x, y; }; - template - union vector4 - { - T data[4]; - struct { T x, y, z, w; }; - }; + vector2(T x, T y) : + x(x), + y(y) + { + } - template - union matrix34 - { - T data[3][4]; - struct { struct {T x, y, z, w; } rows[3];}; - }; + vector2() : + x(), + y() + { + } + }; - template - union matrix44 - { - T data[4][4]; - struct { struct {T x, y, z, w; } rows[4];}; - }; + template + union vector3 + { + T data[3]; + struct { T x, y, z; }; - typedef vector2 fvector2; - typedef vector3 fvector3; - typedef vector4 fvector4; - typedef matrix34 fmatrix34; - typedef matrix44 fmatrix44; + vector3(T x, T y, T z) : + x(x), + y(y), + z(z) + { + } + + vector3() : + x(), + y(), + z() + { + } + }; + + template + union vector4 + { + T data[4]; + struct { T x, y, z, w; }; + + vector4(T x, T y, T z, T w) : + x(x), + y(y), + z(z), + w(w) + { + } + + vector4() : + x(), + y(), + z(), + w() + { + } + }; + + template + union matrix34 + { + T data[3][4]; + struct { struct { T x, y, z, w; } rows[3]; }; + }; + + template + union matrix44 + { + T data[4][4]; + struct { struct { T x, y, z, w; } rows[4]; }; + }; + + typedef vector2 fvector2; + typedef vector3 fvector3; + typedef vector4 fvector4; + typedef matrix34 fmatrix34; + typedef matrix44 fmatrix44; }