47#include <boost/math/constants/constants.hpp>
61 using namespace boost::math::constants;
69 constexpr T
zero =
static_cast<T
>(0.0);
71 constexpr T
one =
static_cast<T
>(1.0);
73 constexpr T
two =
static_cast<T
>(2.0);
75 constexpr T
three =
static_cast<T
>(3.0);
77 constexpr T
four =
static_cast<T
>(4.0);
80 template <
typename T,
typename SFINAE = std::enable_if_t<std::is_scalar_v<T>, sfinae>>
81 inline T
lerp(T aX1, T aX2,
double aAmount)
85 return static_cast<T
>((x2 - x1) * aAmount + x1);
90 return aDegrees / 180.0 * pi<angle>();
95 return aRadians * 180.0 / pi<angle>();
101 template <
typename T, u
int32_t _Size,
typename Type = column_vector>
105 template <
typename T, u
int32_t _Size,
typename Type>
106 bool constexpr vecarray_trivial_v<math::basic_vector<T, _Size, Type>> =
true;
110 template <
typename T, u
int32_t _Size,
typename Type>
128 static constexpr uint32_t
Size = _Size;
131 template <
typename SFINAE =
int>
133 template <
typename SFINAE =
int>
135 template <
typename SFINAE =
int>
137 template <
typename SFINAE =
int>
139 template <
typename... Arguments>
140 explicit basic_vector(
const value_type& value, Arguments&&... aArguments) : v{ {value, std::forward<Arguments>(aArguments)...} } {}
141 template <
typename... Arguments>
142 explicit basic_vector(
value_type&& value, Arguments&&... aArguments) : v{ {std::move(value), std::forward<Arguments>(aArguments)...} } {}
144 basic_vector(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::uninitialized_copy(values.begin(), values.end(), v.begin()); std::uninitialized_fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{}); }
145 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes>
149 template <
typename T2>
151 template <
typename T2, u
int32_t Size2,
typename SFINAE =
int>
155 self_type&
operator=(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::copy(values.begin(), values.end(), v.begin()); std::fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{});
return *
this; }
157 static uint32_t
size() {
return Size; }
166 template <
typename T2>
183 self_type scale(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = v[index] * right[index];
return result; }
184 value_type magnitude()
const {
value_type ss = constants::zero<value_type>;
for (uint32_t index = 0; index < Size; ++index) ss += (v[index] * v[index]);
return std::sqrt(ss); }
186 self_type min(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::min(v[index], right.
v[index]);
return result; }
187 self_type max(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::max(v[index], right.
v[index]);
return result; }
188 value_type min()
const {
value_type result = v[0];
for (uint32_t index = 1; index < Size; ++index) result = std::min(v[index], result);
return result; }
189 self_type ceil()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::ceil(v[index]);
return result; }
190 self_type floor()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::floor(v[index]);
return result; }
191 self_type round()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::round(v[index]);
return result; }
192 value_type distance(
const self_type& right)
const {
value_type total = 0;
for (uint32_t index = 0; index < Size; ++index) total += ((v[index] - right.
v[index]) * (v[index] - right.
v[index]));
return std::sqrt(total); }
195 value_type result = constants::zero<value_type>;
196 for (uint32_t index = 0; index < Size; ++index)
197 result += (v[index] * right[index]);
200 template <
typename SFINAE = self_type>
204 y * right.
z - z * right.
y,
205 z * right.
x - x * right.
z,
206 x * right.
y - y * right.
x };
266 template <
typename T,
typename Type>
284 static constexpr uint32_t Size = 2;
288 template <
typename... Arguments>
289 explicit basic_vector(
const value_type& value, Arguments&&... aArguments) : v{ {value, std::forward<Arguments>(aArguments)...} } {}
290 template <
typename... Arguments>
291 explicit basic_vector(
value_type&& value, Arguments&&... aArguments) : v{ {std::move(value), std::forward<Arguments>(aArguments)...} } {}
293 basic_vector(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::uninitialized_copy(values.begin(), values.end(), v.begin()); std::uninitialized_fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{}); }
294 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes>
298 template <
typename T2>
300 template <
typename T2, u
int32_t Size2,
typename SFINAE =
int>
304 self_type&
operator=(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::copy(values.begin(), values.end(), v.begin()); std::fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{});
return *
this; }
306 static uint32_t
size() {
return Size; }
315 template <
typename T2>
332 self_type scale(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = v[index] * right[index];
return result; }
333 value_type magnitude()
const {
value_type ss = constants::zero<value_type>;
for (uint32_t index = 0; index < Size; ++index) ss += (v[index] * v[index]);
return std::sqrt(ss); }
335 self_type min(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::min(v[index], right.
v[index]);
return result; }
336 self_type max(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::max(v[index], right.
v[index]);
return result; }
337 value_type min()
const {
value_type result = v[0];
for (uint32_t index = 1; index < Size; ++index) result = std::min(v[index], result);
return result; }
338 self_type ceil()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::ceil(v[index]);
return result; }
339 self_type floor()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::floor(v[index]);
return result; }
340 self_type round()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::round(v[index]);
return result; }
341 value_type distance(
const self_type& right)
const {
value_type total = 0;
for (uint32_t index = 0; index < Size; ++index) total += ((v[index] - right.
v[index]) * (v[index] - right.
v[index]));
return std::sqrt(total); }
344 value_type result = constants::zero<value_type>;
345 for (uint32_t index = 0; index < Size; ++index)
346 result += (v[index] * right[index]);
385 template <
typename T,
typename Type>
403 static constexpr uint32_t Size = 1;
407 template <
typename... Arguments>
408 explicit basic_vector(
const value_type& value, Arguments&&... aArguments) : v{ {value, std::forward<Arguments>(aArguments)...} } {}
409 template <
typename... Arguments>
410 explicit basic_vector(
value_type&& value, Arguments&&... aArguments) : v{ {std::move(value), std::forward<Arguments>(aArguments)...} } {}
412 basic_vector(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::uninitialized_copy(values.begin(), values.end(), v.begin()); std::uninitialized_fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{}); }
413 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes>
417 template <
typename T2>
419 template <
typename T2, u
int32_t Size2,
typename SFINAE =
int>
423 self_type&
operator=(std::initializer_list<value_type> values) {
if (values.size() > Size)
throw std::out_of_range(
"neolib::basic_vector: initializer list too big"); std::copy(values.begin(), values.end(), v.begin()); std::fill(v.begin() + (values.end() - values.begin()), v.end(),
value_type{});
return *
this; }
425 static uint32_t
size() {
return Size; }
434 template <
typename T2>
451 self_type scale(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = v[index] * right[index];
return result; }
452 value_type magnitude()
const {
value_type ss = constants::zero<value_type>;
for (uint32_t index = 0; index < Size; ++index) ss += (v[index] * v[index]);
return std::sqrt(ss); }
454 self_type min(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::min(v[index], right.
v[index]);
return result; }
455 self_type max(
const self_type& right)
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::max(v[index], right.
v[index]);
return result; }
456 value_type min()
const {
value_type result = v[0];
for (uint32_t index = 1; index < Size; ++index) result = std::min(v[index], result);
return result; }
457 self_type ceil()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::ceil(v[index]);
return result; }
458 self_type floor()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::floor(v[index]);
return result; }
459 self_type round()
const {
self_type result;
for (uint32_t index = 0; index < Size; ++index) result[index] = std::round(v[index]);
return result; }
460 value_type distance(
const self_type& right)
const {
value_type total = 0;
for (uint32_t index = 0; index < Size; ++index) total += ((v[index] - right.
v[index]) * (v[index] - right.
v[index]));
return std::sqrt(total); }
463 value_type result = constants::zero<value_type>;
464 for (uint32_t index = 0; index < Size; ++index)
465 result += (v[index] * right[index]);
493 template <
typename T, u
int32_t Size,
typename Type>
496 return aLhs.
v == aRhs.
v;
499 template <
typename T, u
int32_t Size,
typename Type>
502 return aLhs.
v < aRhs.
v;
505 template <
typename T, u
int32_t Size,
typename Type>
508 return aLhs.
v <=> aRhs.
v;
599 template <std::
size_t VertexCount>
602 template <std::
size_t VertexCount>
640 typedef std::array<double, 1>
avec1;
641 typedef std::array<double, 2>
avec2;
642 typedef std::array<double, 3>
avec3;
643 typedef std::array<double, 4>
avec4;
646 typedef std::array<vec3, 4>
quad;
657 template <
typename T, u
int32_t D,
typename Type>
665 template <
typename T, u
int32_t D,
typename Type>
673 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
676 std::array<basic_vector<T, D, Type>, VertexCount> result = right;
677 for (
auto& v : result)
682 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
685 std::array<basic_vector<T, D, Type>, VertexCount> result = left;
686 for (
auto& v : result)
691 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
699 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
702 std::array<basic_vector<T, D, Type>, VertexCount> result = right;
703 for (
auto& v : result)
708 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
711 std::array<basic_vector<T, D, Type>, VertexCount> result = left;
712 for (
auto& v : result)
717 template <
typename T, u
int32_t D,
typename Type, std::
size_t VertexCount>
725 template <
typename T, u
int32_t D,
typename Type>
729 for (uint32_t i = 0; i < D; ++i)
734 template <
typename T, u
int32_t D,
typename Type>
738 for (uint32_t i = 0; i < D; ++i)
743 template <
typename T, u
int32_t D,
typename Type>
747 for (uint32_t i = 0; i < D; ++i)
752 template <
typename T, u
int32_t D,
typename Type>
756 for (uint32_t i = 0; i < D; ++i)
757 result[i] = left - right[i];
761 template <
typename T, u
int32_t D,
typename Type>
765 for (uint32_t i = 0; i < D; ++i)
770 template <
typename T, u
int32_t D,
typename Type>
774 for (uint32_t i = 0; i < D; ++i)
779 template <
typename T, u
int32_t D,
typename Type>
783 for (uint32_t i = 0; i < D; ++i)
788 template <
typename T, u
int32_t D,
typename Type>
792 for (uint32_t i = 0; i < D; ++i)
793 result[i] = left / right[i];
797 template <
typename T, u
int32_t D,
typename Type>
801 for (uint32_t i = 0; i < D; ++i)
802 result[i] = std::fmod(left[i], right);
806 template <
typename T, u
int32_t D>
810 for (uint32_t index = 0; index < D; ++index)
811 result += (left[index] * right[index]);
815 template <
typename T,
typename Type>
821 template <
typename T,
typename Type>
827 template <
typename T,
typename Type>
833 template <
typename T,
typename Type>
839 template <
typename T,
typename Type>
845 template <
typename T,
typename Type>
851 template <
typename T,
typename Type>
857 template <
typename T,
typename Type>
863 template <
typename T,
typename Type>
869 template <
typename T,
typename Type>
875 template <
typename T>
878 return left[0] * right[0] + left[1] * right[1] + left[2] * right[2];
881 template <
typename T,
typename Type>
884 return (left + right) / constants::two<T>;
887 template <
typename T, u
int32_t Size,
typename Type>
891 for (uint32_t i = 0; i < Size; ++i)
895 result[i] =
static_cast<T
>((x2 - x1) * aAmount + x1);
901 template <
typename T, u
int32_t Rows, u
int32_t Columns>
913 template <
typename T2>
917 basic_matrix(std::initializer_list<std::initializer_list<value_type>> aColumns) { std::copy(aColumns.begin(), aColumns.end(), m.begin()); }
918 basic_matrix(
const self_type& other) : m{ other.m }, isIdentity{ other.isIdentity } {}
919 basic_matrix(self_type&& other) : m{
std::move(other.m) }, isIdentity{ other.isIdentity } {}
920 template <
typename T2>
923 for (uint32_t column = 0; column < Columns; ++column)
924 for (uint32_t row = 0; row < Rows; ++row)
925 (*
this)[column][row] =
static_cast<value_type>(other[column][row]);
928 self_type&
operator=(
const self_type& other) { m = other.m; isIdentity = other.isIdentity;
return *
this; }
929 self_type&
operator=(self_type&& other) { m = std::move(other.m); isIdentity = other.isIdentity;
return *
this; }
931 template <
typename T2>
937 std::pair<uint32_t, uint32_t>
size()
const {
return std::make_pair(Rows, Columns); }
942 bool operator==(
const self_type& right)
const {
return m == right.m; }
943 bool operator!=(
const self_type& right)
const {
return m != right.m; }
944 self_type&
operator+=(
const self_type& right) {
for (uint32_t column = 0; column < Columns; ++column) (*
this)[column] += right[column];
return *
this; }
945 self_type&
operator-=(
const self_type& right) {
for (uint32_t column = 0; column < Columns; ++column) (*
this)[column] -= right[column];
return *
this; }
949 for (uint32_t column = 0; column < Columns; ++column)
950 for (uint32_t row = 0; row < Rows; ++row)
951 for (uint32_t index = 0; index < Columns; ++index)
952 result[column][row] += ((*
this)[index][row] * right[column][index]);
958 self_type result = *
this;
959 for (uint32_t column = 0; column < Columns; ++column)
960 for (uint32_t row = 0; row < Rows; ++row)
961 result[column][row] = -result[column][row];
967 for (uint32_t column = 0; column < Columns; ++column)
968 for (uint32_t row = 0; row < Rows; ++row)
970 std::modf((*
this)[column][row] / aEpsilon + 0.5, &result[column][row]);
971 result[column][row] *= aEpsilon;
978 for (uint32_t column = 0; column < Columns; ++column)
979 for (uint32_t row = 0; row < Rows; ++row)
980 result[row][column] = (*
this)[column][row];
983 template <
typename SFINAE = self_type>
984 static const std::enable_if_t<Rows == Columns, SFINAE>&
identity()
986 auto make_identity = []()
989 for (uint32_t diag = 0; diag < Rows; ++diag)
990 result[diag][diag] =
static_cast<value_type>(1.0);
991 result.isIdentity =
true;
994 static self_type
const sIdentity = make_identity();
1002 return *(isIdentity = ((*this) == identity()));
1009 friend void swap(self_type& a, self_type& b)
1013 swap(a.isIdentity, b.isIdentity);
1017 mutable std::optional<bool> isIdentity;
1191 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1199 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1207 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1215 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1223 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1231 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1234 return -right + left;
1237 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1245 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1253 template <
typename T, u
int32_t Rows, u
int32_t Columns>
1261 template <
typename T, u
int32_t D1, u
int32_t D2>
1269 for (uint32_t column = 0u; column < D1; ++column)
1270 for (uint32_t row = 0u; row < D1; ++row)
1271 for (uint32_t index = 0; index < D2; ++index)
1272 result[column][row] += (left[index][row] * right[column][index]);
1276 template <
typename T>
1284 for (uint32_t column = 0u; column < 4u; ++column)
1285 for (uint32_t row = 0u; row < 4u; ++row)
1286 result[column][row] =
simd_fma_4d(left[0u][row], right[column][0u], left[1u][row], right[column][1u], left[2u][row], right[column][2u], left[3u][row], right[column][3u]);
1290 template <
typename T, u
int32_t D>
1296 for (uint32_t row = 0; row < D; ++row)
1297 for (uint32_t index = 0; index < D; ++index)
1298 result[row] += (left[index][row] * right[index]);
1302 template <
typename T, u
int32_t D, std::
size_t VertexCount>
1307 std::array<basic_vector<T, D, column_vector>, VertexCount> result;
1313 template <
typename T>
1319 for (uint32_t row = 0u; row < 4u; ++row)
1320 result[row] =
simd_fma_4d(left[0][row], right[0], left[1][row], right[1], left[2][row], right[2], left[3][row], right[3]);
1324 template <
typename T, std::
size_t VertexCount>
1329 std::array<basic_vector<T, 4u, column_vector>, VertexCount> result;
1335 template <
typename T, u
int32_t D>
1341 for (uint32_t column = 0; column < D; ++column)
1342 for (uint32_t index = 0; index < D; ++index)
1343 result[column] += (left[index] * right[column][index]);
1347 template <
typename T, u
int32_t D, std::
size_t VertexCount>
1352 std::array<basic_vector<T, D, row_vector>, VertexCount> result;
1358 template <
typename T>
1364 for (uint32_t column = 0u; column < 4u; ++column)
1365 result[column] =
simd_fma_4d(left[0], right[column][0], left[1], right[column][1], left[2], right[column][2], left[3], right[column][3]);
1369 template <
typename T, std::
size_t VertexCount>
1374 std::array<basic_vector<T, 4u, row_vector>, VertexCount> result;
1380 template <
typename T, u
int32_t D>
1384 for (uint32_t column = 0; column < D; ++column)
1385 for (uint32_t row = 0; row < D; ++row)
1386 result[column][row] = (left[row] * right[column]);
1390 template <
typename T>
1394 for (uint32_t column = 0; column < 4u; ++column)
1395 simd_mul_4d(left[0u], right[column], left[1u], right[column], left[2u], right[column], left[3u], right[column], result[column][0u], result[column][1u], result[column][2u], result[column][3u]);
1399 template <
typename T, u
int32_t D>
1402 auto result = matrix;
1403 for (uint32_t row = 0; row < D - 1; ++row)
1404 result[D - 1][row] = 0.0;
1408 template <
typename Elem,
typename Traits,
typename T, u
int32_t Size,
typename Type>
1409 inline std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& aStream,
const basic_vector<T, Size, Type>& aVector)
1412 for (uint32_t i = 0; i < Size; ++i)
1416 aStream << aVector[i];
1422 template <
typename Elem,
typename Traits,
typename T, u
int32_t Size,
typename Type>
1425 auto previousImbued = aStream.getloc();
1428 for (uint32_t i = 0; i < Size; ++i)
1429 aStream >> aVector[i];
1430 aStream.imbue(previousImbued);
1434 template <
typename Elem,
typename Traits,
typename T, u
int32_t Rows, u
int32_t Columns>
1438 for (uint32_t row = 0; row < Rows; ++row)
1443 for (uint32_t column = 0; column < Columns; ++column)
1447 aStream << aMatrix[column][row];
1455 template <
typename Elem,
typename Traits,
typename T, u
int32_t Rows, u
int32_t Columns>
1456 inline std::basic_ostream<Elem, Traits>&
operator<<(std::basic_ostream<Elem, Traits>& aStream,
const optional<basic_matrix<T, Rows, Columns>>& aMatrix)
1458 if (aMatrix != std::nullopt)
1459 aStream << *aMatrix;
1461 aStream <<
"[null]";
1465 template <
typename Elem,
typename Traits,
typename T, u
int32_t Rows, u
int32_t Columns>
1466 inline std::basic_ostream<Elem, Traits>&
operator<<(std::basic_ostream<Elem, Traits>& aStream,
const std::optional<basic_matrix<T, Rows, Columns>>& aMatrix)
1468 if (aMatrix != std::nullopt)
1469 aStream << *aMatrix;
1471 aStream <<
"[null]";
1477 template <
typename T>
1483 for (uint32_t row = 0u; row < 3u; ++row)
1484 result[row] =
static_cast<T
>(
simd_fma_4d(left[0][row], right[0], left[1][row], right[1], left[2][row], right[2], left[3][row], 1.0));
1488 template <
typename T>
1493 std::vector<basic_vector<T, 3u, column_vector>> result;
1494 result.reserve(right.size());
1495 for (
auto const& v : right)
1496 result.push_back(left * v);
1502 if (std::abs(
angle) <= epsilon)
1503 return mat33::identity();
1504 else if (std::abs(
angle - boost::math::constants::pi<scalar>()) <= epsilon)
1505 return -mat33::identity();
1508 scalar const a = 1.0 - c;
1513 { ax * axis.
x + c, ax * axis.
y + axis.
z * s, ax * axis.
z - axis.
y * s },
1514 { ay * axis.
x - axis.
z * s, ay * axis.
y + c, ay * axis.
z + axis.
x * s },
1515 { az * axis.
x + axis.
y * s, az * axis.
y - axis.
x * s, az * axis.
z + c } }.round_to(epsilon);
1522 return rotation_matrix(nva.cross(nvb).normalized(), std::acos(nva.dot(nvb)), epsilon);
1530 if (ax != 0.0 || ay != 0.0)
1532 mat33 rx = { { 1.0, 0.0, 0.0 },{ 0.0, std::cos(ax), std::sin(ax) },{ 0.0, -std::sin(ax), std::cos(ax) } };
1533 mat33 ry = { { std::cos(ay), 0.0, -std::sin(ay) },{ 0.0, 1.0, 0.0 },{ std::sin(ay), 0.0, std::cos(ay) } };
1534 mat33 rz = { { std::cos(az), std::sin(az), 0.0 },{ -std::sin(az), std::cos(az), 0.0 },{ 0.0, 0.0, 1.0 } };
1535 return rz * ry * rx;
1539 return mat33{ { std::cos(az), std::sin(az), 0.0 },{ -std::sin(az), std::cos(az), 0.0 },{ 0.0, 0.0, 1.0 } };
1548 if (ax != 0.0 || ay != 0.0)
1550 mat44 rx = { { 1.0, 0.0, 0.0, 0.0 },{ 0.0, std::cos(ax), std::sin(ax), 0.0 },{ 0.0, -std::sin(ax), std::cos(ax), 0.0 },{0.0, 0.0, 0.0, 1.0} };
1551 mat44 ry = { { std::cos(ay), 0.0, -std::sin(ay), 0.0 },{ 0.0, 1.0, 0.0, 0.0 },{ std::sin(ay), 0.0, std::cos(ay), 0.0 },{0.0, 0.0, 0.0, 1.0} };
1552 mat44 rz = { { std::cos(az), std::sin(az), 0.0, 0.0 },{ -std::sin(az), std::cos(az), 0.0, 0.0 },{ 0.0, 0.0, 1.0, 0.0 },{0.0, 0.0, 0.0, 1.0} };
1553 return rz * ry * rx;
1557 return mat44{ { std::cos(az), std::sin(az), 0.0, 0.0 },{ -std::sin(az), std::cos(az), 0.0, 0.0 },{ 0.0, 0.0, 1.0, 0.0 },{0.0, 0.0, 0.0, 1.0} };
1564 aMatrix[3][0] += aTranslation.
x;
1565 aMatrix[3][1] += aTranslation.
y;
1566 aMatrix[3][2] += aTranslation.
z;
1573 aMatrix[0][0] *= aScaling.
x;
1574 aMatrix[1][1] *= aScaling.
y;
1575 aMatrix[2][2] *= aScaling.
z;
1581 template <
typename T>
1582 inline bool nearly_equal(T lhs, T rhs,
scalar epsilon = 0.00001, std::enable_if_t<std::is_floating_point_v<T>,
sfinae> = {})
1584 return static_cast<double>(std::abs(lhs - rhs)) < epsilon;
1586 template <
typename T>
1587 inline bool nearly_equal(T lhs, T rhs,
scalar epsilon = 0.00001, std::enable_if_t<std::is_integral_v<T>,
sfinae> = {})
1591 template <
typename T, u
int32_t Size,
typename Type = column_vector>
1594 for (uint32_t index = 0; index < Size; ++index)
1595 if (!nearly_equal(lhs[index], rhs[index], epsilon))
1599 template <
typename T>
1606 return nearly_equal(*lhs, *rhs, epsilon);
1608 template <
typename T>
1609 inline bool nearly_equal(std::optional<T>
const& lhs, std::optional<T>
const& rhs,
scalar epsilon = 0.00001)
1615 return nearly_equal(*lhs, *rhs, epsilon);
1617 template <
typename T1,
typename T2>
1618 inline bool nearly_equal(std::pair<T1, T2>
const& lhs, std::pair<T1, T2>
const& rhs,
scalar epsilon = 0.00001)
1620 return nearly_equal(lhs.first, rhs.first, epsilon) && nearly_equal(lhs.second, rhs.second, epsilon);
1622 template <
typename T>
1623 inline bool nearly_equal(std::vector<T>
const& lhs, std::vector<T>
const& rhs,
scalar epsilon = 0.00001)
1625 return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(),
1626 [epsilon](
auto const& lhs,
auto const& rhs) { return nearly_equal(lhs, rhs, epsilon); });
1629 template <
typename T, std::
size_t D>
1633 (aQuad[1].distance(aQuad[0]) + aQuad[3].distance(aQuad[2])) /
static_cast<T
>(2.0),
1634 (aQuad[0].distance(aQuad[3]) + aQuad[1].distance(aQuad[2])) /
static_cast<T
>(2.0)
1652 return aAabb.
min + (aAabb.
max - aAabb.
min) / 2.0;
1657 return aAabb.
max - aAabb.
min;
1660 template <
typename... Transforms>
1663 std::array<vec3, 8> boxVertices =
1674 aabb result{ boxVertices[0], boxVertices[0] };
1675 for (
auto const& v : boxVertices)
1685 return aabb{ aOrigin - aSize / 2.0, aOrigin + aSize / 2.0 };
1690 return aabb{ aOrigin - aSize / 2.0, aOrigin + aSize / 2.0 };
1693 template <
typename VertexIter>
1694 inline aabb to_aabb(VertexIter aBegin, VertexIter aEnd,
const mat44& aTransformation = mat44::identity())
1698 aabb result{ aBegin->xyz, aBegin->xyz };
1699 for (
auto i =
std::next(aBegin); i != aEnd; ++i)
1709 return to_aabb(aVertices.begin(), aVertices.end(), aTransformation);
1712 inline bool operator==(
const aabb& left,
const aabb& right)
1717 inline bool operator<(
const aabb& left,
const aabb& right)
1723 inline std::partial_ordering operator<=>(
const aabb& left,
const aabb& right)
1738 auto extents = a.
max - a.
min;
1739 return extents.
x * extents.y * (extents.z != 0.0 ? extents.z : 1.0);
1744 return inner.
min >= outer.
min && inner.
max <= outer.
max;
1749 return point >= outer.
min && point <= outer.
max;
1771 if (first == std::nullopt || second == std::nullopt)
1778 if (first == std::nullopt)
1785 if (second == std::nullopt)
1798 aabb_2d(
const aabb& aAabb) : min{ aAabb.min.xy }, max{ aAabb.max.xy } {}
1803 return aAabb.
min + (aAabb.
max - aAabb.
min) / 2.0;
1808 return aAabb.
max - aAabb.
min;
1811 template <
typename... Transforms>
1814 std::array<vec3, 4> boxVertices =
1816 (aTransforms * ... *
vec3{ aAabb.
min.
x, aAabb.
min.
y, 0.0 }),
1817 (aTransforms * ... *
vec3{ aAabb.
max.
x, aAabb.
min.
y, 0.0 }),
1818 (aTransforms * ... *
vec3{ aAabb.
min.
x, aAabb.
max.
y, 0.0 }),
1819 (aTransforms * ... *
vec3{ aAabb.
max.
x, aAabb.
max.
y, 0.0 })
1821 aabb_2d result{ boxVertices[0].xy, boxVertices[0].xy };
1822 for (
auto const& v : boxVertices)
1832 return aabb_2d{ (aOrigin - aSize / 2.0).xy, (aOrigin + aSize / 2.0).
xy };
1837 return aabb_2d{ (aOrigin - aSize / 2.0).xy, (aOrigin + aSize / 2.0).
xy };
1840 template <
typename VertexIter>
1845 aabb_2d result{ aBegin->xy, aBegin->xy };
1846 for (
auto i =
std::next(aBegin); i != aEnd; ++i)
1856 return to_aabb_2d(aVertices.begin(), aVertices.end(), aTransformation);
1866 return std::forward_as_tuple(left.
min.
y, left.
min.
x, left.
max.
y, left.
max.
x) <
1872 return std::forward_as_tuple(left.
min.
y, left.
min.
x, left.
max.
y, left.
max.
x) <=>
1885 auto extents = a.
max - a.
min;
1886 return extents.
x * extents.y;
1891 return inner.
min >= outer.
min && inner.
max <= outer.
max;
1896 return point >= outer.
min && point <= outer.
max;
1914 if (first == std::nullopt || second == std::nullopt)
1921 if (first == std::nullopt)
1928 if (second == std::nullopt)
1935 return std::pow(1.0 - t, 3.0) * p0 + 3.0 * std::pow(1.0 - t, 2.0) * t * p1 + 3 * (1.0 - t) * std::pow(t, 2.0) * p2 + std::pow(t, 3.0) * p3;
1948 template <
typename T>
1951 return bezier_cubic(p0.template as<scalar>(), p1.template as<scalar>(), p2.template as<scalar>(), p3.template as<scalar>(),
static_cast<scalar>(t)).template as<T>();
1954 template <
typename T>
1957 return bezier_cubic_x(p0.template as<scalar>(), p1.template as<scalar>(), p2.template as<scalar>(), p3.template as<scalar>(),
static_cast<scalar>(x)).template as<T>();
1960 template <
typename T>
1963 return bezier_cubic_y(p0.template as<scalar>(), p1.template as<scalar>(), p2.template as<scalar>(), p3.template as<scalar>(),
static_cast<scalar>(y)).template as<T>();
1967 using namespace math;
self_type & operator-=(const self_type &right)
basic_vector< T, Rows, column_vector > column_type
bool operator!=(const self_type &right) const
self_type operator-() const
self_type round_to(value_type aEpsilon) const
const value_type * data() const
std::array< column_type, Columns > array_type
basic_matrix(const self_type &other)
std::pair< uint32_t, uint32_t > size() const
basic_matrix< T2, Rows, Columns > as() const
basic_vector< T, Columns, row_vector > row_type
self_type & operator+=(const self_type &right)
self_type & operator=(const self_type &other)
basic_matrix< T, Columns, Rows > transposed() const
static const std::enable_if_t< Rows==Columns, SFINAE > & identity()
basic_matrix(self_type &&other)
friend void swap(self_type &a, self_type &b)
bool operator==(const self_type &right) const
basic_matrix(const basic_matrix< T2, Rows, Columns > &other)
const std::optional< bool > & maybe_identity() const
column_type & operator[](uint32_t aColumn)
self_type & operator*=(const self_type &right)
basic_matrix(std::initializer_list< std::initializer_list< value_type > > aColumns)
const column_type & operator[](uint32_t aColumn) const
self_type & operator=(self_type &&other)
basic_vector(std::initializer_list< value_type > values)
self_type & operator+=(value_type value)
self_type & operator*=(const self_type &right)
basic_vector(self_type &&other)
self_type normalized() const
value_type operator[](uint32_t aIndex) const
self_type & operator=(self_type &&other)
self_type & operator/=(const self_type &right)
self_type & operator/=(value_type value)
value_type dot(const self_type &right) const
basic_vector(const basic_vector< T2, Size, Type > &other)
basic_vector(const array_type &v)
std::array< value_type, 1 > array_type
basic_vector< value_type, 1, Type > vector_type
value_type magnitude() const
basic_vector< T2, Size, Type > as() const
array_type::const_iterator const_iterator
self_type & operator*=(value_type value)
self_type scale(const self_type &right) const
self_type operator-() const
self_type & operator+=(const self_type &right)
basic_vector(const swizzle< V, A, S, Indexes... > &aSwizzle)
basic_vector(value_type &&value, Arguments &&... aArguments)
basic_vector(const self_type &other)
basic_vector(value_type x)
basic_vector(const basic_vector< T2, Size2, Type > &other, typename std::enable_if_t< Size2< Size, SFINAE >=0)
array_type::iterator iterator
swizzle< vector_type, array_type, 2, 0, 0 > xx
self_type hadamard_product(const self_type &right) const
const_iterator begin() const
self_type & operator=(const self_type &other)
bool operator==(const self_type &right) const
self_type & operator=(std::initializer_list< value_type > values)
friend void swap(self_type &a, self_type &b)
self_type & operator-=(value_type value)
self_type min(const self_type &right) const
basic_vector(const value_type &value, Arguments &&... aArguments)
value_type & operator[](uint32_t aIndex)
swizzle< vector_type, array_type, 3, 0, 0, 0 > xxx
self_type & operator-=(const self_type &right)
const_iterator end() const
value_type distance(const self_type &right) const
self_type max(const self_type &right) const
bool operator!=(const self_type &right) const
const_iterator end() const
swizzle< vector_type, array_type, 3, 0, 1, 0 > xyx
self_type & operator/=(value_type value)
swizzle< vector_type, array_type, 3, 1, 1, 0 > yyx
bool operator!=(const self_type &right) const
basic_vector(const basic_vector< T2, Size2, Type > &other, typename std::enable_if_t< Size2< Size, SFINAE >=0)
swizzle< vector_type, array_type, 2, 0, 1 > xy
basic_vector(const array_type &v)
value_type dot(const self_type &right) const
basic_vector(const self_type &other)
swizzle< vector_type, array_type, 3, 0, 0, 1 > xxy
std::array< value_type, 2 > array_type
self_type & operator*=(const self_type &right)
self_type & operator=(std::initializer_list< value_type > values)
array_type::const_iterator const_iterator
self_type & operator+=(const self_type &right)
value_type operator[](uint32_t aIndex) const
swizzle< vector_type, array_type, 2, 0, 0 > xx
self_type & operator/=(const self_type &right)
array_type::iterator iterator
basic_vector< value_type, 2, Type > vector_type
basic_vector(self_type &&other)
swizzle< vector_type, array_type, 2, 1, 0 > yx
basic_vector(value_type &&value, Arguments &&... aArguments)
self_type & operator*=(value_type value)
self_type scale(const self_type &right) const
self_type hadamard_product(const self_type &right) const
basic_vector(const swizzle< V, A, S, Indexes... > &aSwizzle)
basic_vector(std::initializer_list< value_type > values)
basic_vector< T2, Size, Type > as() const
self_type normalized() const
self_type & operator=(const self_type &other)
basic_vector(const value_type &value, Arguments &&... aArguments)
value_type distance(const self_type &right) const
swizzle< vector_type, array_type, 3, 1, 0, 1 > yxy
self_type & operator=(self_type &&other)
self_type & operator+=(value_type value)
self_type max(const self_type &right) const
value_type & operator[](uint32_t aIndex)
swizzle< vector_type, array_type, 3, 0, 0, 0 > xxx
friend void swap(self_type &a, self_type &b)
swizzle< vector_type, array_type, 3, 1, 0, 0 > yxx
basic_vector(value_type x, value_type y)
swizzle< vector_type, array_type, 3, 1, 1, 1 > yyy
self_type operator-() const
swizzle< vector_type, array_type, 3, 0, 1, 1 > xyy
const_iterator begin() const
swizzle< vector_type, array_type, 2, 1, 1 > yy
self_type & operator-=(const self_type &right)
basic_vector(const basic_vector< T2, Size, Type > &other)
self_type min(const self_type &right) const
self_type & operator-=(value_type value)
value_type magnitude() const
bool operator==(const self_type &right) const
const_iterator begin() const
swizzle< vector_type, array_type, 2, 2, 1 > zy
self_type hadamard_product(const self_type &right) const
basic_vector(const swizzle< V, A, S, Indexes... > &aSwizzle)
self_type max(const self_type &right) const
self_type operator-() const
swizzle< vector_type, array_type, 2, 1, 0 > yx
basic_vector(const basic_vector< T2, Size2, Type > &other, typename std::enable_if_t< Size2< Size, SFINAE >=0)
swizzle< vector_type, array_type, 2, 0, 2 > xz
self_type & operator=(const self_type &other)
swizzle< vector_type, array_type, 2, 0, 0 > xx
swizzle< vector_type, array_type, 3, 1, 1, 2 > yyz
std::enable_if_t< Size==3, SFINAE > cross(const self_type &right) const
swizzle< vector_type, array_type, 3, 1, 0, 1 > yxy
swizzle< vector_type, array_type, 3, 2, 0, 0 > zxx
swizzle< vector_type, array_type, 3, 0, 0, 0 > xxx
const_iterator end() const
self_type scale(const self_type &right) const
basic_vector(const value_type &value, Arguments &&... aArguments)
swizzle< vector_type, array_type, 3, 2, 0, 1 > zxy
value_type & operator[](uint32_t aIndex)
self_type & operator-=(const self_type &right)
swizzle< vector_type, array_type, 3, 0, 1, 1 > xyy
self_type & operator*=(const self_type &right)
swizzle< vector_type, array_type, 2, 2, 0 > zx
swizzle< vector_type, array_type, 3, 1, 2, 2 > yzz
swizzle< vector_type, array_type, 3, 1, 1, 0 > yyx
self_type & operator+=(const self_type &right)
swizzle< vector_type, array_type, 3, 0, 0, 1 > xxy
self_type normalized() const
swizzle< vector_type, array_type, 3, 2, 1, 1 > zyy
basic_vector(const array_type &v)
basic_vector(value_type x, value_type y, value_type z, typename std::enable_if_t< Size==3, SFINAE >=0)
array_type::const_iterator const_iterator
basic_vector(std::initializer_list< value_type > values)
basic_vector(value_type x, typename std::enable_if_t< Size==1, SFINAE >=0)
std::array< value_type, _Size > array_type
self_type & operator*=(value_type value)
static constexpr uint32_t Size
swizzle< vector_type, array_type, 3, 2, 1, 0 > zyx
bool operator==(const self_type &right) const
swizzle< vector_type, array_type, 3, 1, 0, 0 > yxx
value_type magnitude() const
basic_vector< value_type, _Size, Type > vector_type
value_type operator[](uint32_t aIndex) const
swizzle< vector_type, array_type, 2, 0, 1 > xy
value_type distance(const self_type &right) const
swizzle< vector_type, array_type, 2, 1, 1 > yy
swizzle< vector_type, array_type, 2, 1, 2 > yz
self_type min(const self_type &right) const
self_type & operator/=(const self_type &right)
array_type::iterator iterator
swizzle< vector_type, array_type, 3, 0, 1, 0 > xyx
basic_vector(const self_type &other)
value_type dot(const self_type &right) const
swizzle< vector_type, array_type, 3, 1, 2, 1 > yzy
swizzle< vector_type, array_type, 3, 2, 2, 0 > zzx
swizzle< vector_type, array_type, 3, 1, 1, 1 > yyy
self_type & operator=(self_type &&other)
friend void swap(self_type &a, self_type &b)
swizzle< vector_type, array_type, 3, 1, 2, 0 > yzx
self_type & operator+=(value_type value)
swizzle< vector_type, array_type, 3, 2, 2, 1 > zzy
basic_vector< T2, Size, Type > as() const
swizzle< vector_type, array_type, 3, 0, 1, 2 > xyz
self_type & operator/=(value_type value)
basic_vector(value_type x, value_type y, value_type z, value_type w, typename std::enable_if_t< Size==4, SFINAE >=0)
swizzle< vector_type, array_type, 3, 2, 0, 2 > zxz
swizzle< vector_type, array_type, 3, 2, 2, 2 > zzz
swizzle< vector_type, array_type, 3, 0, 0, 2 > xxz
basic_vector(value_type x, value_type y, typename std::enable_if_t< Size==2, SFINAE >=0)
swizzle< vector_type, array_type, 3, 1, 0, 2 > yxz
self_type & operator-=(value_type value)
bool operator!=(const self_type &right) const
basic_vector(value_type &&value, Arguments &&... aArguments)
self_type & operator=(std::initializer_list< value_type > values)
swizzle< vector_type, array_type, 3, 2, 1, 2 > zyz
basic_vector(const basic_vector< T2, Size, Type > &other)
swizzle< vector_type, array_type, 2, 2, 2 > zz
basic_vector(self_type &&other)
std::basic_ostream< Elem, Traits > & operator<<(std::basic_ostream< Elem, Traits > &aStream, const basic_point< T > &aPoint)
std::array< double, 3 > avec3
optional< row_vec4 > optional_row_vec4
basic_matrix< double, 4, 3 > matrix43
optional< vector3 > optional_vector3
optional< matrix32f > optional_matrix32f
basic_matrix< float, 1, 1 > matrix11f
basic_matrix< double, 1, 1 > matrix11
basic_matrix< double, 2, 4 > matrix24
basic_vector< i32, 1 > vector1i32
angle to_deg(angle aRadians)
optional< mat11f > optional_mat11f
optional< matrix44f > optional_matrix44f
optional< mat11f > optional_mat1f
aabb to_aabb(const vec3 &aOrigin, scalar aSize)
basic_matrix< double, 3, 4 > matrix34
optional< mat41f > optional_mat41f
std::array< vec2f, 3 > trianglef_2d
optional< vector1 > optional_vector1
basic_matrix< double, 3, 3 > matrix33
optional< matrix22f > optional_matrix22f
std::array< uint8_t, 3 > avec3u8
std::array< vec3f, 3 > trianglef
optional< mat13 > optional_mat13
optional< mat11 > optional_mat11
basic_vector< T, 3, Type > midpoint(const basic_vector< T, 3, Type > &left, const basic_vector< T, 3, Type > &right)
vec2 bezier_cubic_y(vec2 const &p0, vec2 const &p1, vec2 const &p2, vec2 const &p3, scalar y)
optional< matrix11 > optional_matrix11
optional< vector2 > optional_vector2
basic_vector< double, 1, row_vector > row_vec1
scalar aabb_volume(const aabb &a)
std::array< int8_t, 2 > avec2i8
std::array< vec2, 4 > quad_2d
basic_matrix< float, 2, 3 > matrix23f
std::array< double, 2 > avec2
angle to_rad(angle aDegrees)
optional< mat33f > optional_mat3f
optional< mat43 > optional_mat43
optional< mat33f > optional_mat33f
optional< matrix31f > optional_matrix31f
optional< vec2_list > optional_vec2_list
optional< vector4 > optional_vector4
optional< mat22f > optional_mat2f
std::array< int16_t, 3 > avec3i16
basic_matrix< double, 2, 3 > matrix23
optional< mat33 > optional_mat33
optional< col_vec2 > optional_col_vec2
optional_vec3_list optional_vertices_t
basic_vector< u32, 1 > vector1u32
basic_matrix< double, 3, 2 > matrix32
basic_vector< T, D, Type > operator%(const basic_vector< T, D, Type > &left, const T &right)
std::array< int32_t, 1 > avec1i32
optional< mat14f > optional_mat14f
std::array< uint8_t, 4 > avec4u8
mat33 rotation_matrix(const vec3 &axis, scalar angle, scalar epsilon=0.00001)
std::array< float, 1 > avec1f
optional< matrix42 > optional_matrix42
std::array< int16_t, 1 > avec1i16
optional< mat12f > optional_mat12f
std::array< vec3, 4 > quad
optional< matrix13 > optional_matrix13
vec3 aabb_extents(const aabb &aAabb)
std::array< uint16_t, 1 > avec1u16
basic_vector< u32, 4 > vector4u32
basic_vector< i32, 4 > vector4i32
optional< matrix21 > optional_matrix21
optional< matrix31 > optional_matrix31
basic_matrix< T, D, D > without_translation(const basic_matrix< T, D, D > &matrix)
basic_matrix< float, 1, 3 > matrix13f
optional< mat32 > optional_mat32
optional< vec1 > optional_vec1
optional< mat42f > optional_mat42f
optional< col_vec3 > optional_col_vec3
bool aabb_contains(const aabb &outer, const aabb &inner)
std::array< uint16_t, 2 > avec2u16
basic_matrix< double, 2, 2 > matrix22
basic_matrix< double, 3, 1 > matrix31
optional< matrix41 > optional_matrix41
basic_matrix< double, 1, 4 > matrix14
basic_vector< double, 4, row_vector > row_vec4
std::array< double, 4 > avec4
std::array< int16_t, 2 > avec2i16
std::array< float, 3 > avec3f
std::array< basic_vector< T, D, Type >, VertexCount > & operator-=(std::array< basic_vector< T, D, Type >, VertexCount > &left, const basic_vector< T, D, Type > &right)
optional< mat33 > optional_mat3
aabb aabb_union(const aabb &left, const aabb &right)
optional< matrix43f > optional_matrix43f
std::array< uint8_t, 2 > avec2u8
basic_vector< i32, 2 > vector2i32
optional< matrix34 > optional_matrix34
std::array< uint8_t, 1 > avec1u8
optional_vec2_list optional_vertices_2d_t
std::vector< vec2 > vec2_list
std::array< uint16_t, 3 > avec3u16
optional< mat21 > optional_mat21
optional< vec3_list > optional_vec3_list
optional< matrix24f > optional_matrix24f
basic_vector< double, 2, row_vector > row_vec2
mat44 affine_rotation_matrix(const vec3 &angles)
optional< mat32f > optional_mat32f
optional< mat22f > optional_mat22f
std::array< vec3f, 4 > quadf
T lerp(T aX1, T aX2, double aAmount)
std::array< uint32_t, 1 > avec1u32
basic_vector< float, 1 > vector1f
bool aabb_intersects(const aabb &first, const aabb &second)
basic_matrix< float, 3, 4 > matrix34f
mat44 & apply_translation(mat44 &aMatrix, const vec3 &aTranslation)
optional< mat12 > optional_mat12
optional< matrix33f > optional_matrix33f
optional< matrix14 > optional_matrix14
optional< col_vec1 > optional_col_vec1
vec2 bezier_cubic_x(vec2 const &p0, vec2 const &p1, vec2 const &p2, vec2 const &p3, scalar x)
optional< matrix13f > optional_matrix13f
optional< mat13f > optional_mat13f
optional< matrix11 > optional_matrix1
std::array< float, 2 > avec2f
optional< mat31 > optional_mat31
optional< matrix14f > optional_matrix14f
optional< matrix42f > optional_matrix42f
optional< mat24f > optional_mat24f
std::array< int32_t, 4 > avec4i32
std::array< int8_t, 4 > avec4i8
std::array< int8_t, 1 > avec1i8
optional< matrix33 > optional_matrix3
basic_vector< float, 3 > vector3f
optional< vec3 > optional_vec3
basic_vector< T, D > quad_extents(std::array< basic_vector< T, D >, 4 > const &aQuad)
optional< mat23f > optional_mat23f
optional< mat44f > optional_mat4f
basic_vector< float, 4 > vector4f
optional< matrix23f > optional_matrix23f
std::array< double, 1 > avec1
optional< row_vec2 > optional_row_vec2
optional< mat21f > optional_mat21f
std::array< uint32_t, 2 > avec2u32
std::array< float, 4 > avec4f
basic_matrix< double, 2, 1 > matrix21
basic_matrix< float, 4, 3 > matrix43f
optional< mat14 > optional_mat14
std::array< vec2, 3 > triangle_2d
basic_matrix< float, 4, 1 > matrix41f
optional< matrix44 > optional_matrix44
vec3 aabb_origin(const aabb &aAabb)
basic_matrix< float, 2, 4 > matrix24f
optional< matrix43 > optional_matrix43
std::array< uint32_t, 4 > avec4u32
optional< mat22 > optional_mat2
std::array< int32_t, 3 > avec3i32
optional< matrix44f > optional_matrix4f
optional< mat34f > optional_mat34f
basic_matrix< float, 1, 2 > matrix12f
optional< matrix21f > optional_matrix21f
std::array< vec2f, 4 > quadf_2d
basic_matrix< float, 3, 3 > matrix33f
basic_vector< double, 1 > vector1
optional< mat22 > optional_mat22
optional< mat34 > optional_mat34
optional< matrix33f > optional_matrix3f
optional< matrix22f > optional_matrix2f
basic_vector< i32, 3 > vector3i32
optional< mat31f > optional_mat31f
optional< matrix22 > optional_matrix22
basic_matrix< float, 4, 4 > matrix44f
basic_matrix< double, 4, 2 > matrix42
optional< matrix12f > optional_matrix12f
std::array< int8_t, 3 > avec3i8
optional< mat44f > optional_mat44f
optional< matrix23 > optional_matrix23
optional< matrix33 > optional_matrix33
optional< mat24 > optional_mat24
basic_matrix< float, 2, 2 > matrix22f
optional< col_vec4 > optional_col_vec4
optional< matrix11f > optional_matrix1f
std::array< uint32_t, 3 > avec3u32
optional< matrix12 > optional_matrix12
basic_vector< double, 3, row_vector > row_vec3
basic_matrix< float, 3, 2 > matrix32f
basic_vector< u32, 2 > vector2u32
basic_vector< u32, 3 > vector3u32
aabb aabb_transform(const aabb &aAabb, const Transforms &... aTransforms)
optional< matrix41f > optional_matrix41f
optional< mat23 > optional_mat23
basic_vector< float, 2 > vector2f
basic_matrix< float, 1, 4 > matrix14f
optional< matrix22 > optional_matrix2
aabb_2d to_aabb_2d(const vec3 &aOrigin, scalar aSize)
optional< row_vec1 > optional_row_vec1
std::array< uint16_t, 4 > avec4u16
std::array< int32_t, 2 > avec2i32
optional< mat41 > optional_mat41
optional< mat42 > optional_mat42
basic_matrix< double, 1, 2 > matrix12
basic_matrix< double, 4, 1 > matrix41
basic_matrix< double, 1, 3 > matrix13
optional< aabb > optional_aabb
std::vector< vec3 > vec3_list
optional< mat11 > optional_mat1
optional< matrix11f > optional_matrix11f
mat44 & apply_scaling(mat44 &aMatrix, const vec3 &aScaling)
optional< matrix44 > optional_matrix4
optional< mat43f > optional_mat43f
basic_matrix< float, 3, 1 > matrix31f
vec2 bezier_cubic(vec2 const &p0, vec2 const &p1, vec2 const &p2, vec2 const &p3, scalar t)
optional< row_vec3 > optional_row_vec3
optional< matrix34f > optional_matrix34f
basic_matrix< float, 4, 2 > matrix42f
basic_matrix< float, 2, 1 > matrix21f
std::array< vec3, 3 > triangle
std::array< int16_t, 4 > avec4i16
optional< matrix24 > optional_matrix24
optional< matrix32 > optional_matrix32
i_string & operator+=(i_string &lhs, const i_string &rhs)
void swap(plf::hive< element_type, allocator_type > &a, plf::hive< element_type, allocator_type > &b) noexcept(std::allocator_traits< allocator_type >::propagate_on_container_swap::value||std::allocator_traits< allocator_type >::is_always_equal::value)
it_type next(it_type it, const typename iterator_traits< it_type >::difference_type distance=1)
aabb_2d(const aabb &aAabb)
aabb_2d(const vec2 &aMin, const vec2 &aMax)
aabb(const vec3 &aMin, const vec3 &aMax)
basic_matrix< T2, Rows, Columns > type
basic_vector< T, Size2, Type > type
basic_vector< T, Size2, Type > type
basic_vector< T, Size2, Type > type