44 template<
class t_type>
58 , (right + left) / (right - left), (top + bottom) / (top - bottom), -(far + near) / (far - near),
cast<t_type>(-1)
61 static constexpr Matrix<t_type> createOrtho(t_type left, t_type right, t_type bottom, t_type top, t_type near_plane, t_type far_plane)
61 static constexpr Matrix<t_type> createOrtho(t_type left, t_type right, t_type bottom, t_type top, t_type near_plane, t_type far_plane) {
…}
69 template<
class t_angle_type>
72 t_type height = near *
tan(y_field_of_view / 2);
73 t_type width = height * aspect_ratio;
86 mat[3][2] = -(f + n) / (f - n);
90 to_vulkan[0][0] = 1.0f;
91 to_vulkan[1][1] = -1.0f;
92 to_vulkan[2][2] = 0.5f;
93 to_vulkan[3][2] = 0.5f;
94 to_vulkan[3][3] = 1.0f;
95 return to_vulkan * mat;
131 fovy / aspect, 0, 0, 0
133 , 0, 0, (far_plane + near_plane) / (near_plane - far_plane), (2 * near_plane * far_plane) / (near_plane - far_plane)
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
Definition Matrix.hpp:176
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
std::enable_if<!ObjectInfo< t_type >::Float, fltp08 >::type tan(const Angle< t_type > &angle)
Performs optimized tangent operation on the given angle using pre-computed lookup table for optimal s...
Definition AngleFunctions.h:156
t_type dot(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition VectorFunctions.hpp:1030
constexpr Vector< 1, t_type > cross(const Vector< 1, t_type > &, const Vector< 1, t_type > &)
Definition VectorFunctions.hpp:898
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
@ Y
Definition BaseValues.hpp:169
@ X
Definition BaseValues.hpp:167
@ Z
Definition BaseValues.hpp:171
Provides common definitions for creating 4x4 matrices of certain types.
Definition MatrixDefinitions.h:46
static constexpr Matrix< t_type > RotationMatrix(const Vector< 3, t_type > &lookat, const Vector< 3, t_type > &up)
Definition MatrixDefinitions.h:112
static constexpr Matrix< t_type > OrthoFrustum(const Vector< 2, t_type > &span, t_type n, t_type f)
Definition MatrixDefinitions.h:77
static constexpr Matrix< t_type > Perspective(t_type fovy, t_type aspect, t_type near_plane, t_type far_plane)
Definition MatrixDefinitions.h:128
static constexpr Matrix< t_type > createOrtho(t_type left, t_type right, t_type bottom, t_type top, t_type near_plane, t_type far_plane)
Definition MatrixDefinitions.h:61
static constexpr Matrix< t_type > ViewMatrix(const Vector< 3, t_type > &location, const Vector< 3, t_type > &lookat, const Vector< 3, t_type > &up)
Definition MatrixDefinitions.h:97
static constexpr Matrix< t_type > FrustumTransform(t_type left, t_type right, t_type bottom, t_type top, t_type near, t_type far)
Definition MatrixDefinitions.h:47
static constexpr Matrix< t_type > FrustumTransform(Angle< t_angle_type > y_field_of_view, t_type aspect_ratio, t_type near, t_type far)
Definition MatrixDefinitions.h:70