9 template <
class T,
bool Packed>
12 ret.
w = lhs.
s * rhs.
s - lhs.
x * rhs.
x - lhs.
y * rhs.
y - lhs.
z * rhs.
z;
13 ret.
x = lhs.
s * rhs.
x + lhs.
x * rhs.
s + lhs.
y * rhs.
z - lhs.
z * rhs.
y;
14 ret.
y = lhs.
s * rhs.
y - lhs.
x * rhs.
z + lhs.
y * rhs.
s + lhs.
z * rhs.
x;
15 ret.
z = lhs.
s * rhs.
z + lhs.
x * rhs.
y - lhs.
y * rhs.
x + lhs.
z * rhs.
s;
20 template <
class T,
bool Packed>
25 SimdT dabc = lhs.
vec.simd;
35 SimdT t0 = SimdT::template shuffle<0, 0, 0, 0>(dabc);
36 SimdT t1 = SimdT::template shuffle<3, 0, 1, 2>(
wxyz);
38 SimdT t2 = SimdT::template shuffle<1, 1, 1, 1>(dabc);
39 SimdT t3 = SimdT::template shuffle<2, 1, 0, 3>(
wxyz);
41 SimdT t4 = SimdT::template shuffle<2, 2, 2, 2>(dabc);
42 SimdT t5 = SimdT::template shuffle<3, 1, 0, 2>(
wxyz);
44 SimdT m0 = SimdT::mul(t0, t1);
45 SimdT m1 = SimdT::mul(t2, t3);
46 SimdT m2 = SimdT::mul(t4, t5);
48 SimdT t6 = SimdT::template shuffle<3, 3, 3, 3>(dabc);
49 SimdT t7 = SimdT::template shuffle<0, 3, 1, 2>(
wxyz);
51 SimdT m3 = SimdT::mul(t6, t7);
53 SimdT e = SimdT::add(m0, SimdT::mul(alternate, m1));
54 e = SimdT::template shuffle<1, 3, 0, 2>(e);
55 e = SimdT::add(e, SimdT::mul(alternate, m2));
56 e = SimdT::template shuffle<2, 0, 1, 3>(e);
57 e = SimdT::add(e, SimdT::mul(alternate, m3));
58 e = SimdT::template shuffle<3, 1, 0, 2>(e);
67 template <
class T,
bool Packed>
72 template <
class T,
bool Packed>
78 template <
class T,
bool Packed>
84 template <
class T,
bool Packed>
90 template <
class T,
bool Packed>
96 template <
class T,
bool Packed>
103 template <
class T,
bool Packed>
110 template <
class T,
bool Packed>
117 template <
class T,
bool Packed>
124 template <
class T,
bool Packed>
131 template <
class T,
bool Packed>
136 template <
class T,
bool Packed>
143 template <
class T,
bool Packed,
class U,
class =
typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
148 template <
class T,
bool Packed,
class U,
class =
typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
154 template <class T, bool Packed, class U, class = typename std::enable_if<!traits::IsQuaternion<U>::value>::type>
Matrix< U, Rows, Columns, Order1, Layout1, Packed > & operator+=(Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
Performs matrix addition and stores result in this.
Definition: MatrixArithmetic.hpp:287
Swizzle< ST, 3, 0, 1, 2 > wxyz
Definition: Swizzle_4.inc.hpp:279
Allows you to do quaternion math and represent rotation in a compact way.
Definition: Definitions.hpp:69
T x
Definition: QuaternionImpl.hpp:39
auto operator*(const Matrix< T, Rows1, Match, Order1, eMatrixLayout::ROW_MAJOR, Packed > &lhs, const Matrix< U, Match, Columns2, Order2, eMatrixLayout::ROW_MAJOR, Packed > &rhs) -> Matrix< V, Rows1, Columns2, Order1, eMatrixLayout::ROW_MAJOR, Packed >
Definition: MatrixArithmetic.hpp:78
Definition: Approx.hpp:11
Matrix< T, Rows, Columns, Order, Layout, Packed > operator/(T s, const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
Definition: MatrixArithmetic.hpp:333
std::enable_if<!Quaternion< T, Packed >::SimdAccelerated, Quaternion< T, Packed > >::type Product(const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
Definition: QuaternionArithmetic.hpp:10
Matrix< U, Rows, Columns, Order1, Layout1, Packed > & operator-=(Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
Performs matrix subtraction and stores result in this.
Definition: MatrixArithmetic.hpp:296
T z
Definition: QuaternionImpl.hpp:39
2,4 or 8 dimension float or double parameters accepted. Uses SSE2 or AVX acceleration if enabled in t...
Definition: Simd.hpp:22
Matrix< U, Rows, Columns, Order1, SameLayout, Packed > operator-(const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &rhs)
Definition: MatrixArithmetic.hpp:239
Matrix< T1, Dim, Dim, Order1, Layout1, Packed > & operator*=(Matrix< T1, Dim, Dim, Order1, Layout1, Packed > &lhs, const Matrix< T2, Dim, Dim, Order2, Layout2, Packed > &rhs)
Definition: MatrixArithmetic.hpp:198
Vector< T, 4, Packed > vec
Definition: QuaternionImpl.hpp:41
T y
Definition: QuaternionImpl.hpp:39
Matrix< T, Rows, Columns, Order, Layout, Packed > & operator/=(Matrix< T, Rows, Columns, Order, Layout, Packed > &mat, T s)
Divides all elements of the matrix by scalar.
Definition: MatrixArithmetic.hpp:321
Matrix< U, Rows, Columns, Order1, SameLayout, Packed > operator+(const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &rhs)
Definition: MatrixArithmetic.hpp:222
T w
Definition: QuaternionImpl.hpp:39
T s
Definition: QuaternionImpl.hpp:36