11 template <u
int8_t Rows,
typename T =
float>
16 constexpr
Vector() =
default;
18 explicit constexpr
Vector(T value);
19 Vector(std::initializer_list<T> list);
41 #define DEFINE_ACCESS(name, minimum_rows) \ 42 template <bool EnableBool = true, typename = typename std::enable_if<(Rows >= minimum_rows) && EnableBool>::type> \ 43 const T& name() const { \ 44 return (*this)(minimum_rows - 1); \ 47 template <bool EnableBool = true, typename = typename std::enable_if<(Rows >= minimum_rows) && EnableBool>::type> \ 49 return (*this)(minimum_rows - 1); \ 68 constexpr T
length()
const;
74 constexpr Vector<3, T>
cross(
const Vector<3, T>& lhs,
const Vector<3, T>& rhs);
76 template <u
int8_t Rows,
typename T>
77 constexpr T
dot(
const Vector<Rows, T>& lhs,
const Vector<Rows, T>& rhs);
79 template <u
int8_t Rows, u
int8_t Columns,
typename T>
80 constexpr Matrix<Rows, Columns, T>
outer(
const Vector<Rows, T>& lhs,
const Vector<Columns, T>& rhs);
82 template <u
int8_t Rows,
typename T>
83 constexpr Vector<Rows, T>
normalize(
const Vector<Rows, T>& lhs);
85 #define DEFINE_LENGTH_VECTOR(length) \ 86 template <typename T = float> \ 87 using Vec##length = Vector<length, T>; \ 89 template class LUG_MATH_API Vector<length, float>; \ 90 using Vec##length##f = Vec##length<float>; \ 92 template class LUG_MATH_API Vector<length, double>; \ 93 using Vec##length##d = Vec##length<double>; \ 95 template class LUG_MATH_API Vector<length, int32_t>; \ 96 using Vec##length##i = Vec##length<int32_t>; \ 98 template class LUG_MATH_API Vector<length, uint32_t>; \ 99 using Vec##length##u = Vec##length<uint32_t>; 105 #undef DEFINE_LENGTH_VECTOR 107 template <u
int8_t Rows,
typename T>
108 Vector<Rows, T>
operator*(
const Vector<Rows, T>& lhs,
const Vector<Rows, T>& rhs);
110 template <u
int8_t Rows,
typename T>
111 Vector<Rows, T>
operator/(
const Vector<Rows, T>& lhs,
const Vector<Rows, T>& rhs);
113 template <u
int8_t Rows,
typename T>
114 Vector<Rows, T>
operator*(
const Vector<Rows, T>& lhs,
const Matrix<Rows, Rows, T>& rhs);
116 template <u
int8_t Rows,
typename T>
117 Vector<Rows, T>
operator*(
const Matrix<Rows, Rows, T>& lhs,
const Vector<Rows, T>& rhs);
120 template <
typename T>
121 Vector<3, T>
operator*(
const Vector<3, T>& lhs,
const Matrix<4, 4, T>& rhs);
123 template <
typename T>
124 Vector<3, T>
operator*(
const Matrix<4, 4, T>& lhs,
const Vector<3, T>& rhs);
Vector< Rows, T > operator*=(const Matrix< Rows, Rows, T > &rhs)
#define DEFINE_ACCESS(name, minimum_rows)
constexpr Vector< 3, T > cross(const Vector< 3, T > &lhs, const Vector< 3, T > &rhs)
Vector< Rows, T > & operator=(const Vector< Rows, T > &vector)=default
constexpr T squaredLength() const
constexpr Matrix< Rows, Columns, T > outer(const Vector< Rows, T > &lhs, const Vector< Columns, T > &rhs)
constexpr T length() const
Vector< Rows, T > operator/=(const Vector< Rows, T > &rhs)
#define DEFINE_LENGTH_VECTOR(length)
Matrix< Rows, Columns, T > operator/(const Matrix< Rows, Columns, T > &lhs, T rhs)
constexpr Vector()=default
Matrix< Rows, Columns, T > operator*(const Matrix< Rows, Columns, T > &lhs, T rhs)
T dot(const Quaternion< T > &lhs, const Quaternion< T > &rhs)