Add homgenization constructors
This commit is contained in:
parent
0f5058bd18
commit
d1e5b558b7
1 changed files with 2 additions and 2 deletions
|
@ -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_<T> &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_<T> x_axis() { return vector3_<T> ( { T(1), T(0), T(0) } ); }
|
||||
inline static vector3_<T> y_axis() { return vector3_<T> ( { T(0), T(1), T(0) } ); }
|
||||
inline static vector3_<T> z_axis() { return vector3_<T> ( { T(0), T(0), T(1) } ); }
|
||||
|
||||
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
@ -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_<T> &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]; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue