Changeset 1305 for trunk/src/lol/math/vector.h
 Timestamp:
 Apr 29, 2012, 4:01:00 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/vector.h
r1272 r1305 910 910 { 911 911 inline Quat() {} 912 inline Quat(T X) : x(0), y(0), z(0), w(X) {}913 inline Quat(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) {}912 inline Quat(T W) : x(0), y(0), z(0), w(W) {} 913 inline Quat(T W, T X, T Y, T Z) : x(X), y(Y), z(Z), w(W) {} 914 914 915 915 Quat(Mat3<T> const &m); … … 917 917 918 918 DECLARE_MEMBER_OPS(Quat) 919 920 static Quat<T> rotate(T angle, T x, T y, T z); 921 static Quat<T> rotate(T angle, Vec3<T> const &v); 919 922 920 923 inline Quat<T> operator *(Quat<T> const &val) const … … 924 927 Vec3<T> v2(val.x, val.y, val.z); 925 928 Vec3<T> v3 = cross(v1, v2) + w * v2 + val.w * v1; 926 return Quat<T>( v3.x, v3.y, v3.z, w * val.w  dot(v1, v2));929 return Quat<T>(w * val.w  dot(v1, v2), v3.x, v3.y, v3.z); 927 930 } 928 931 … … 934 937 inline Quat<T> operator ~() const 935 938 { 936 return Quat<T>( x, y, z, w);939 return Quat<T>(w, x, y, z); 937 940 } 938 941 … … 942 945 #endif 943 946 947 /* Storage order is still xyzw because operator[] uses &this>x */ 944 948 T x, y, z, w; 945 949 };
Note: See TracChangeset
for help on using the changeset viewer.