26template<
typename T,
int Size>
27[[nodiscard]] MatBase<T, Size, Size>
invert(
const MatBase<T, Size, Size> &mat,
bool &r_success);
32template<
typename T,
int NumCol,
int NumRow>
33[[nodiscard]] MatBase<T, NumCol, NumRow>
transpose(
const MatBase<T, NumRow, NumCol> &mat);
38template<
typename T,
int NumCol,
int NumRow>
39[[nodiscard]] MatBase<T, NumCol, NumRow>
normalize(
const MatBase<T, NumCol, NumRow> &a);
45template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
47 const MatBase<T, NumCol, NumRow> &a, VectorT &r_size);
53template<
typename T,
int Size> [[nodiscard]] T
determinant(
const MatBase<T, Size, Size> &mat);
58template<
typename T,
int Size>
59[[nodiscard]] MatBase<T, Size, Size>
adjoint(
const MatBase<T, Size, Size> &mat);
64template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
65[[nodiscard]] MatBase<T, NumCol, NumRow>
translate(
const MatBase<T, NumCol, NumRow> &mat,
66 const VectorT &translation);
72template<
typename T,
int NumCol,
int NumRow,
typename RotationT>
74 const RotationT &rotation);
79template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
81 const VectorT &scale);
86template<
typename T,
int NumCol,
int NumRow>
167template<
typename T,
int Size>
180template<
typename MatT> [[nodiscard]] MatT
from_location(
const typename MatT::loc_type &location);
186template<
typename MatT,
int ScaleDim>
192template<
typename MatT,
typename RotationT>
198template<
typename MatT,
typename RotationT,
typename VectorT>
199[[nodiscard]] MatT
from_rot_scale(
const RotationT &rotation,
const VectorT &scale);
204template<
typename MatT,
typename RotationT>
205[[nodiscard]] MatT
from_loc_rot(
const typename MatT::loc_type &location,
206 const RotationT &rotation);
211template<
typename MatT,
int ScaleDim>
212[[nodiscard]] MatT
from_loc_scale(
const typename MatT::loc_type &location,
218template<
typename MatT,
typename RotationT,
int ScaleDim>
220 const RotationT &rotation,
228template<
typename MatT,
typename VectorT>
235template<
typename MatT,
typename VectorT>
237 const VectorT forward,
248template<
typename MatT,
typename VectorT> [[nodiscard]] MatT
from_up_axis(
const VectorT up);
259template<
typename MatT> [[nodiscard]] MatT
orthogonalize(
const MatT &mat,
const Axis axis);
266template<
typename MatT,
typename VectorT>
328template<
bool AllowNegativeScale = false,
typename T,
int NumCol,
int NumRow>
330template<
bool AllowNegativeScale = false,
typename T>
339template<
bool AllowNegativeScale = false,
typename T>
343template<
bool AllowNegativeScale = false,
typename T>
348template<
bool AllowNegativeScale = false,
typename T,
typename RotationT>
350 RotationT &r_rotation,
352template<
bool AllowNegativeScale = false,
typename T,
typename RotationT>
355 RotationT &r_rotation,
395template<
typename MatT,
typename VectorT>
404namespace projection {
413 T left, T right, T bottom, T top, T near_clip, T far_clip);
432 T left, T right, T bottom, T top, T near_clip, T far_clip);
442 T angle_left, T angle_right, T angle_bottom, T angle_top, T near_clip, T far_clip);
485template<
typename T,
int NumCol,
int NumRow>
488 const T epsilon =
T(0))
490 for (
int i = 0; i < NumCol; i++) {
491 for (
int j = 0; j < NumRow; j++) {
503template<
typename MatT> [[nodiscard]]
inline bool is_orthogonal(
const MatT &mat)
545 using T =
typename MatT::base_type;
553template<
typename T,
int NumCol,
int NumRow>
556 for (
int i = 0; i < NumCol; i++) {
573template<
typename T,
int NumCol,
int NumRow>
576template<
typename T,
int NumCol,
int NumRow>
579template<
typename T,
int NumCol,
int NumRow>
582template<
typename T,
int NumCol,
int NumRow>
585template<
typename T,
int NumCol,
int NumRow>
588template<
typename T,
int NumCol,
int NumRow>
591template<
typename T,
int NumCol,
int NumRow,
typename AngleT>
597template<
typename T,
int NumCol,
int NumRow>
600 for (
int i = 0; i < NumCol; i++) {
608template<
typename T,
int Size>
616template<
typename T,
int NumCol,
int NumRow>
624template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
626 const VectorT &translation)
630 "Translation should be at least 1 column less than the matrix.");
631 constexpr int location_col = MatT::col_len - 1;
634 using IntermediateVecT =
635 VecBase<
typename MatT::base_type,
636 (MatT::row_len > MatT::col_len - 1) ? (MatT::col_len - 1) : MatT::row_len>;
640 *
reinterpret_cast<IntermediateVecT *
>(
641 &result[location_col]) += translation[c] *
642 *
reinterpret_cast<const IntermediateVecT *
>(&mat[c]);
647template<
typename T,
int NumCol,
int NumRow,
typename AngleT>
652 using Vec3T =
typename MatT::vec3_type;
653 const T angle_sin =
sin(rotation.angle());
654 const T angle_cos =
cos(rotation.angle());
655 const Vec3T &axis_vec = rotation.axis();
659 if (axis_vec.x == T(1)) {
661 result[2][c] = -angle_sin * mat[1][c] + angle_cos * mat[2][c];
662 result[1][c] = angle_cos * mat[1][c] + angle_sin * mat[2][c];
665 else if (axis_vec.y == T(1)) {
667 result[0][c] = angle_cos * mat[0][c] - angle_sin * mat[2][c];
668 result[2][c] = angle_sin * mat[0][c] + angle_cos * mat[2][c];
671 else if (axis_vec.z == T(1)) {
673 result[0][c] = angle_cos * mat[0][c] + angle_sin * mat[1][c];
674 result[1][c] = -angle_sin * mat[0][c] + angle_cos * mat[1][c];
684template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
686 const VectorT &scale)
689 "Scale should be less or equal to the matrix in column count.");
695template<
typename T,
int NumCol,
int NumRow>
737 "r_size dimension should be equal to matrix column count.");
743template<
typename T,
int NumCol,
int NumRow>
751template<
typename T,
int NumCol,
int NumRow,
typename VectorT>
756 "r_size dimension should be equal to matrix column count.");
776 if (cy >
T(16) * std::numeric_limits<T>::epsilon()) {
797 const int i_index = eul1.
i_index();
798 const int j_index = eul1.
j_index();
799 const int k_index = eul1.
k_index();
801 const T cy =
math::hypot(mat[i_index][i_index], mat[i_index][j_index]);
802 if (cy >
T(16) * std::numeric_limits<T>::epsilon()) {
803 eul1.
i() =
math::atan2(mat[j_index][k_index], mat[k_index][k_index]);
805 eul1.
k() =
math::atan2(mat[i_index][j_index], mat[i_index][i_index]);
807 eul2.
i() =
math::atan2(-mat[j_index][k_index], -mat[k_index][k_index]);
809 eul2.
k() =
math::atan2(-mat[i_index][j_index], -mat[i_index][i_index]);
812 eul1.
i() =
math::atan2(-mat[k_index][j_index], mat[j_index][j_index]);
848 if (mat[2][2] < 0.0f) {
849 if (mat[0][0] > mat[1][1]) {
850 const T trace = 1.0f + mat[0][0] - mat[1][1] - mat[2][2];
852 if (mat[1][2] < mat[2][1]) {
858 q.
w = (mat[1][2] - mat[2][1]) * s;
859 q.
y = (mat[0][1] + mat[1][0]) * s;
860 q.
z = (mat[2][0] + mat[0][2]) * s;
861 if (
UNLIKELY((trace == 1.0f) && (q.
w == 0.0f && q.
y == 0.0f && q.
z == 0.0f))) {
867 const T trace = 1.0f - mat[0][0] + mat[1][1] - mat[2][2];
869 if (mat[2][0] < mat[0][2]) {
875 q.
w = (mat[2][0] - mat[0][2]) * s;
876 q.
x = (mat[0][1] + mat[1][0]) * s;
877 q.
z = (mat[1][2] + mat[2][1]) * s;
878 if (
UNLIKELY((trace == 1.0f) && (q.
w == 0.0f && q.
x == 0.0f && q.
z == 0.0f))) {
885 if (mat[0][0] < -mat[1][1]) {
886 const T trace = 1.0f - mat[0][0] - mat[1][1] + mat[2][2];
888 if (mat[0][1] < mat[1][0]) {
894 q.
w = (mat[0][1] - mat[1][0]) * s;
895 q.
x = (mat[2][0] + mat[0][2]) * s;
896 q.
y = (mat[1][2] + mat[2][1]) * s;
897 if (
UNLIKELY((trace == 1.0f) && (q.
w == 0.0f && q.
x == 0.0f && q.
y == 0.0f))) {
906 const T trace = 1.0f + mat[0][0] + mat[1][1] + mat[2][2];
910 q.
x = (mat[1][2] - mat[2][1]) * s;
911 q.
y = (mat[2][0] - mat[0][2]) * s;
912 q.
z = (mat[0][1] - mat[1][0]) * s;
913 if (
UNLIKELY((trace == 1.0f) && (q.
x == 0.0f && q.
y == 0.0f && q.
z == 0.0f))) {
928 if (
UNLIKELY(!std::isfinite(det))) {
941template<
typename T,
int NumCol,
int NumRow>
946 const DoublePrecision cos_i =
math::cos(DoublePrecision(rotation.x().radian()));
947 const DoublePrecision cos_j =
math::cos(DoublePrecision(rotation.y().radian()));
948 const DoublePrecision cos_k =
math::cos(DoublePrecision(rotation.z().radian()));
949 const DoublePrecision sin_i =
math::sin(DoublePrecision(rotation.x().radian()));
950 const DoublePrecision sin_j =
math::sin(DoublePrecision(rotation.y().radian()));
951 const DoublePrecision sin_k =
math::sin(DoublePrecision(rotation.z().radian()));
952 const DoublePrecision cos_i_cos_k = cos_i * cos_k;
953 const DoublePrecision cos_i_sin_k = cos_i * sin_k;
954 const DoublePrecision sin_i_cos_k = sin_i * cos_k;
955 const DoublePrecision sin_i_sin_k = sin_i * sin_k;
957 MatT mat = MatT::identity();
958 mat[0][0] =
T(cos_j * cos_k);
959 mat[1][0] =
T(sin_j * sin_i_cos_k - cos_i_sin_k);
960 mat[2][0] =
T(sin_j * cos_i_cos_k + sin_i_sin_k);
962 mat[0][1] =
T(cos_j * sin_k);
963 mat[1][1] =
T(sin_j * sin_i_sin_k + cos_i_cos_k);
964 mat[2][1] =
T(sin_j * cos_i_sin_k - sin_i_cos_k);
966 mat[0][2] =
T(-sin_j);
967 mat[1][2] =
T(cos_j * sin_i);
968 mat[2][2] =
T(cos_j * cos_i);
972template<
typename T,
int NumCol,
int NumRow>
976 const int i_index = rotation.i_index();
977 const int j_index = rotation.j_index();
978 const int k_index = rotation.k_index();
982 MatT result = MatT::identity();
983 result[i_index][i_index] = mat[0][0];
984 result[j_index][i_index] = mat[1][0];
985 result[k_index][i_index] = mat[2][0];
986 result[i_index][j_index] = mat[0][1];
987 result[j_index][j_index] = mat[1][1];
988 result[k_index][j_index] = mat[2][1];
989 result[i_index][k_index] = mat[0][2];
990 result[j_index][k_index] = mat[1][2];
991 result[k_index][k_index] = mat[2][2];
998template<
typename T,
int NumCol,
int NumRow>
1003 const DoublePrecision q0 =
numbers::sqrt2 * DoublePrecision(rotation.w);
1005 const DoublePrecision q2 =
numbers::sqrt2 * DoublePrecision(rotation.y);
1006 const DoublePrecision q3 =
numbers::sqrt2 * DoublePrecision(rotation.z);
1008 const DoublePrecision qda = q0 *
q1;
1009 const DoublePrecision qdb = q0 * q2;
1010 const DoublePrecision qdc = q0 * q3;
1011 const DoublePrecision qaa =
q1 *
q1;
1012 const DoublePrecision qab =
q1 * q2;
1013 const DoublePrecision qac =
q1 * q3;
1014 const DoublePrecision qbb = q2 * q2;
1015 const DoublePrecision qbc = q2 * q3;
1016 const DoublePrecision qcc = q3 * q3;
1018 MatT mat = MatT::identity();
1019 mat[0][0] =
T(1.0 - qbb - qcc);
1020 mat[0][1] =
T(qdc + qab);
1021 mat[0][2] =
T(-qdb + qac);
1023 mat[1][0] =
T(-qdc + qab);
1024 mat[1][1] =
T(1.0 - qaa - qcc);
1025 mat[1][2] =
T(qda + qbc);
1027 mat[2][0] =
T(qdb + qac);
1028 mat[2][1] =
T(-qda + qbc);
1029 mat[2][2] =
T(1.0 - qaa - qbb);
1034template<
typename T,
int NumCol,
int NumRow>
1048 const T &w0 = c0.
w, &x0 = c0.
x, &y0 = c0.
y, &z0 = c0.
z;
1049 const T &we = ce.
w, &xe = ce.
x, &ye = ce.
y, &ze = ce.
z;
1053 mat[3][0] =
T(2) * (-we * x0 + xe * w0 - ye * z0 + ze * y0);
1054 mat[3][1] =
T(2) * (-we * y0 + xe * z0 + ye * w0 - ze * x0);
1055 mat[3][2] =
T(2) * (-we * z0 - xe * y0 + ye * x0 + ze * w0);
1057 if (rotation.scale_weight != T(0)) {
1058 mat.template
view<4, 4>() = mat * rotation.scale;
1063template<
typename T,
int NumCol,
int NumRow>
1067 MatT mat = MatT::identity();
1074template<
typename T,
int NumCol,
int NumRow,
typename AngleT>
1078 using Vec3T =
typename MatT::vec3_type;
1079 const T angle_sin =
sin(rotation.angle());
1080 const T angle_cos =
cos(rotation.angle());
1081 const Vec3T &axis = rotation.axis();
1085 T ico = (
T(1) - angle_cos);
1086 Vec3T nsi = axis * angle_sin;
1088 Vec3T n012 = (axis * axis) * ico;
1089 T n_01 = (axis[0] * axis[1]) * ico;
1090 T n_02 = (axis[0] * axis[2]) * ico;
1091 T n_12 = (axis[1] * axis[2]) * ico;
1094 mat[0][1] = n_01 + nsi[2];
1095 mat[0][2] = n_02 - nsi[1];
1096 mat[1][0] = n_01 - nsi[2];
1097 mat[1][2] = n_12 + nsi[0];
1098 mat[2][0] = n_02 + nsi[1];
1099 mat[2][1] = n_12 - nsi[0];
1103template<
typename T,
int NumCol,
int NumRow>
1107 const T cos_i =
cos(rotation);
1108 const T sin_i =
sin(rotation);
1110 MatT mat = MatT::identity();
1176 Euler3Base<T> eul1(reference.order()), eul2(reference.order());
1178 eul1 = eul1.wrapped_around(reference);
1244template<
bool AllowNegativeScale,
typename T,
int NumCol,
int NumRow>
1248 if constexpr (AllowNegativeScale) {
1256template<
bool AllowNegativeScale,
typename T>
1260 if constexpr (AllowNegativeScale) {
1297template<
bool AllowNegativeScale,
typename T>
1303 if constexpr (AllowNegativeScale) {
1305 normalized_mat = -normalized_mat;
1312template<
bool AllowNegativeScale,
typename T>
1322template<
bool AllowNegativeScale,
typename T,
typename RotationT>
1324 RotationT &r_rotation,
1328 if constexpr (AllowNegativeScale) {
1330 normalized_mat = -normalized_mat;
1337template<
bool AllowNegativeScale,
typename T,
typename RotationT>
1340 RotationT &r_rotation,
1351template<
bool AllowNegativeScale,
typename T,
typename RotationT>
1354 RotationT &r_rotation,
1363 r_rotation = RotationT(euler_rotation);
1367template<
typename MatT> [[nodiscard]] MatT
from_location(
const typename MatT::loc_type &location)
1369 MatT mat = MatT::identity();
1370 mat.location() = location;
1374template<
typename MatT,
int ScaleDim>
1378 "Scale dimension should fit the matrix diagonal length.");
1381 [&](
auto i) { result[i][i] = (i < ScaleDim) ? scale[i] :
typename MatT::base_type(1); });
1385template<
typename MatT,
typename RotationT>
1391template<
typename MatT,
typename RotationT,
typename VectorT>
1397template<
typename MatT,
typename RotationT,
int ScaleDim>
1399 const RotationT &rotation,
1405 mat.location() = location;
1409template<
typename MatT,
typename RotationT>
1410[[nodiscard]] MatT
from_loc_rot(
const typename MatT::loc_type &location,
const RotationT &rotation)
1415 mat.location() = location;
1419template<
typename MatT,
int ScaleDim>
1424 mat.location() = location;
1428template<
typename MatT,
typename VectorT>
1436 matrix.x_axis() = forward;
1440 matrix.z_axis() = up;
1444template<
typename MatT,
typename VectorT>
1446 const VectorT forward,
1451 matrix.location() = location;
1455template<
typename MatT,
typename VectorT> [[nodiscard]] MatT
from_up_axis(
const VectorT up)
1458 using T =
typename MatT::base_type;
1461 T
sign = up.z >=
T(0) ?
T(1) :
T(-1);
1462 T a =
T(-1) / (
sign + up.z);
1463 T
b = up.x * up.y * a;
1474 using T =
typename MatT::base_type;
1510 if (
dot(
R.x,
R.y) < T(1)) {
1514 else if (
dot(
R.x,
R.z) < T(1)) {
1524 if (
dot(
R.y,
R.x) < T(1)) {
1529 else if (
dot(
R.x,
R.z) < T(1)) {
1539 if (
dot(
R.z,
R.x) < T(1)) {
1543 else if (
dot(
R.z,
R.y) < T(1)) {
1562 result.location() = mat.location();
1566template<
typename MatT,
typename VectorT>
1587 return mat * direction;
1593 return mat.template
view<3, 3>() * direction;
1596template<
typename T,
int N,
int NumRow>
1612namespace projection {
1617 const T x_delta = right -
left;
1618 const T y_delta = top - bottom;
1619 const T z_delta = far_clip - near_clip;
1622 if (x_delta != 0 && y_delta != 0 && z_delta != 0) {
1623 mat[0][0] =
T(2.0) / x_delta;
1624 mat[3][0] = -(right +
left) / x_delta;
1625 mat[1][1] =
T(2.0) / y_delta;
1626 mat[3][1] = -(top + bottom) / y_delta;
1627 mat[2][2] = -
T(2.0) / z_delta;
1628 mat[3][2] = -(far_clip + near_clip) / z_delta;
1636 const T x_delta = right -
left;
1637 const T y_delta = top - bottom;
1640 if (x_delta != 0 && y_delta != 0) {
1641 mat[0][0] =
T(2.0) / x_delta;
1642 mat[3][0] = -(right +
left) / x_delta;
1643 mat[1][1] =
T(2.0) / y_delta;
1644 mat[3][1] = -(top + bottom) / y_delta;
1646 constexpr float eps = 2.4e-7f;
1651 mat[3][2] = -1.0f -
eps * near_clip;
1659 const T x_delta = right -
left;
1660 const T y_delta = top - bottom;
1661 const T z_delta = far_clip - near_clip;
1664 if (x_delta != 0 && y_delta != 0 && z_delta != 0) {
1665 mat[0][0] = near_clip *
T(2.0) / x_delta;
1666 mat[1][1] = near_clip *
T(2.0) / y_delta;
1667 mat[2][0] = (right +
left) / x_delta;
1668 mat[2][1] = (top + bottom) / y_delta;
1669 mat[2][2] = -(far_clip + near_clip) / z_delta;
1671 mat[3][2] = (-2.0f * near_clip * far_clip) / z_delta;
1680 const T x_delta = right -
left;
1681 const T y_delta = top - bottom;
1685 if (x_delta != 0 && y_delta != 0) {
1686 mat[0][0] = near_clip *
T(2.0) / x_delta;
1687 mat[1][1] = near_clip *
T(2.0) / y_delta;
1688 mat[2][0] = (right +
left) / x_delta;
1689 mat[2][1] = (top + bottom) / y_delta;
1691 constexpr float eps = 2.4e-7f;
1693 mat[2][3] = (
eps - 1.0f);
1694 mat[3][2] = (
eps - 2.0f) * near_clip;
1702 T angle_left, T angle_right, T angle_bottom, T angle_top, T near_clip, T far_clip)
1710 mat[0][0] /= near_clip;
1711 mat[1][1] /= near_clip;
1719 const bool is_perspective = mat[2][3] == -1.0f;
1720 const bool is_perspective_infinite = mat[2][2] == -1.0f;
1721 if (is_perspective || is_perspective_infinite) {
1722 result[2][0] -= mat[0][0] * offset.x /
math::length(
float3(mat[0][0], mat[1][0], mat[2][0]));
1723 result[2][1] -= mat[1][1] * offset.y /
math::length(
float3(mat[0][1], mat[1][1], mat[2][1]));
1726 result[3][0] += offset.x;
1727 result[3][1] += offset.y;
1733 float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip);
1735 float left,
float right,
float bottom,
float top,
float near_clip,
float far_clip);
#define BLI_assert_unreachable()
#define BLI_STATIC_ASSERT(a, msg)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
btMatrix3x3 adjoint() const
Return the adjoint of the matrix.
btMatrix3x3 transpose() const
Return the transpose of the matrix.
btScalar determinant() const
Return the determinant of the matrix.
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
SIMD_FORCE_INLINE btScalar length() const
Return the length of the vector.
local_group_size(16, 16) .push_constant(Type b
QuaternionBase< T > normalized_to_quat_with_checks(const MatBase< T, 3, 3 > &mat)
void normalized_to_eul2(const MatBase< T, 3, 3 > &mat, EulerXYZBase< T > &eul1, EulerXYZBase< T > &eul2)
void to_rotation(const MatBase< T, 2, 2 > &mat, AngleRadianBase< T > &r_rotation)
QuaternionBase< T > normalized_to_quat_fast(const MatBase< T, 3, 3 > &mat)
AngleRadianBase< T > normalized_to_angle(const MatBase< T, 2, 2 > &mat)
MatBase< T, NumCol, NumRow > from_rotation(const AngleRadianBase< T > &rotation)
MatBase< T, 4, 4 > orthographic(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > orthographic_infinite(T left, T right, T bottom, T top)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, 4, 4 > perspective_fov(T angle_left, T angle_right, T angle_bottom, T angle_top, T near_clip, T far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
MatBase< T, 4, 4 > translate(const MatBase< T, 4, 4 > &mat, const VecBase< T, 2 > &offset)
Translate a projection matrix after creation in the screen plane. Usually used for anti-aliasing jitt...
MatBase< T, 4, 4 > perspective_infinite(T left, T right, T bottom, T top, T near_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
MatBase< T, 4, 4 > perspective(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create a perspective projection matrix using OpenGL coordinate convention: Maps each axis range to [-...
AngleRadianBase< T > to_angle(const MatBase< T, 2, 2 > &mat)
T length_squared(const VecBase< T, Size > &a)
T cos(const AngleRadianBase< T > &a)
bool is_normalized(const DualQuaternionBase< T > &dq)
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
bool is_orthonormal(const MatT &mat)
Quaternion to_quaternion_legacy(const float3x3 &mat)
MatT from_up_axis(const VectorT up)
T to_vector(const Axis axis)
T length(const VecBase< T, Size > &a)
MatT from_loc_rot(const typename MatT::loc_type &location, const RotationT &rotation)
MatT from_loc_scale(const typename MatT::loc_type &location, const VecBase< typename MatT::base_type, ScaleDim > &scale)
bool is_uniformly_scaled(const MatT &mat)
QuaternionBase< T > normalize_and_get_length(const QuaternionBase< T > &q, T &out_length)
bool is_unit_scale(const MatBase< T, NumCol, NumRow > &m)
bool is_negative(const MatBase< T, Size, Size > &mat)
MatBase< T, Size, Size > pseudo_invert(const MatBase< T, Size, Size > &mat, T epsilon=1e-8)
T length_manhattan(const VecBase< T, Size > &a)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
CartesianBasis invert(const CartesianBasis &basis)
AxisSigned cross(const AxisSigned a, const AxisSigned b)
VectorT project_point(const MatT &mat, const VectorT &point)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
T interpolate(const T &a, const T &b, const FactorT &t)
EulerXYZBase< T > to_nearest_euler(const MatBase< T, 3, 3 > &mat, const EulerXYZBase< T > &reference)
T atan2(const T &y, const T &x)
MatBase< T, 3, 3 > interpolate_fast(const MatBase< T, 3, 3 > &a, const MatBase< T, 3, 3 > &b, T t)
MatBase< T, NumCol, NumRow > translate(const MatBase< T, NumCol, NumRow > &mat, const VectorT &translation)
QuaternionBase< T > normalized_to_quaternion_safe(const MatBase< T, 3, 3 > &mat)
MatBase< T, NumCol, NumRow > normalize_and_get_size(const MatBase< T, NumCol, NumRow > &a, VectorT &r_size)
MatT from_origin_transform(const MatT &transform, const VectorT origin)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > to_scale(const MatBase< T, NumCol, NumRow > &mat)
bool is_equal(const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0))
T sin(const AngleRadianBase< T > &a)
void to_rot_scale(const MatBase< T, 2, 2 > &mat, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale)
MatT orthogonalize(const MatT &mat, const Axis axis)
MatBase< T, NumCol, NumRow > interpolate_linear(const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, T t)
T tan(const AngleRadianBase< T > &a)
void to_loc_rot_scale_safe(const MatBase< T, 4, 4 > &mat, VecBase< T, 3 > &r_location, RotationT &r_rotation, VecBase< T, 3 > &r_scale)
MatT from_location(const typename MatT::loc_type &location)
void to_loc_rot_scale(const MatBase< T, 3, 3 > &mat, VecBase< T, 2 > &r_location, AngleRadianBase< T > &r_rotation, VecBase< T, 2 > &r_scale)
VecBase< T, 3 > transform_direction(const MatBase< T, 3, 3 > &mat, const VecBase< T, 3 > &direction)
MatT from_rot_scale(const RotationT &rotation, const VectorT &scale)
MatBase< T, NumCol, NumRow > rotate(const MatBase< T, NumCol, NumRow > &mat, const RotationT &rotation)
CartesianBasis from_orthonormal_axes(const AxisSigned forward, const AxisSigned up)
MatT from_rotation(const RotationT &rotation)
T hypot(const T &y, const T &x)
T determinant(const MatBase< T, Size, Size > &mat)
Euler3Base< T > to_euler(const AxisAngleBase< T, AngleT > &axis_angle, EulerOrder order)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
bool is_orthogonal(const MatT &mat)
VecBase< float, 3 > float3
static MatBase identity()
Euler3Base wrapped_around(const Euler3Base &reference) const
const EulerOrder & order() const
EulerXYZBase wrapped_around(const EulerXYZBase &reference) const
static QuaternionBase identity()