diff --git a/src/core/include/pw/core/vector.hpp b/src/core/include/pw/core/vector.hpp index 39192cc..73b494c 100644 --- a/src/core/include/pw/core/vector.hpp +++ b/src/core/include/pw/core/vector.hpp @@ -63,6 +63,7 @@ struct vector3_ : matrix_<3,1,T> { vector3_() : base_type() {} vector3_(const base_type& m) : base_type(m) {} vector3_(T x_,T y_,T z_) : base_type({x_,y_,z_}) {} + vector3_(const vector2_ &m, T w) : base_type({m(0),m(1),w}) {} inline const T& x() const { return (*this)[0]; } inline T& x() { return (*this)[0]; } @@ -99,8 +100,6 @@ struct vector3_ : matrix_<3,1,T> { inline static vector3_ x_axis() { return vector3_ ( { T(1), T(0), T(0) } ); } inline static vector3_ y_axis() { return vector3_ ( { T(0), T(1), T(0) } ); } inline static vector3_ z_axis() { return vector3_ ( { T(0), T(0), T(1) } ); } - - }; template @@ -113,6 +112,7 @@ struct vector4_ : matrix_<4,1,T> { vector4_(T x_,T y_,T z_,T w_) : base_type({x_,y_,z_,w_}) {} vector4_(const base_type& m) : base_type(m) {} + vector4_(const vector3_ &m, T w) : base_type({m(0),m(1),m(2),w}) {} inline const T& x() const { return (*this)[0]; } inline T& x() { return (*this)[0]; }