41 template<
class t_type>
55 , (right + left) / (right - left), (top + bottom) / (top - bottom), -(far + near) / (far - near),
cast<t_type>(-1)
58 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)
66 template<
class t_angle_type>
69 t_type height = near *
tan(y_field_of_view / 2);
70 t_type width = height * aspect_ratio;
83 mat[3][2] = -(f + n) / (f - n);
87 to_vulkan[0][0] = 1.0f;
88 to_vulkan[1][1] = -1.0f;
89 to_vulkan[2][2] = 0.5f;
90 to_vulkan[3][2] = 0.5f;
91 to_vulkan[3][3] = 1.0f;
92 return to_vulkan * mat;
128 fovy / aspect, 0, 0, 0
130 , 0, 0, (far_plane + near_plane) / (near_plane - far_plane), (2 * near_plane * far_plane) / (near_plane - far_plane)
Stores an angle in an optimized format.
Definition StringStream.h:352
Definition Matrix.hpp:173
An element of a vector space. An element of the real coordinate space Rn Basis vector,...
Definition Vector.hpp:62
std::enable_if<!ObjectInfo< t_type >::Float, fltp08 >::type tan(const Angle< t_type > &angle)
Definition AngleFunctions.h:182
t_type dot(const Vector< t_dims, t_type > &v1, const Vector< t_dims, t_type > &v2)
Definition VectorFunctions.hpp:1096
constexpr Vector< 1, t_type > cross(const Vector< 1, t_type > &, const Vector< 1, t_type > &)
Definition VectorFunctions.hpp:954
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:514
constexpr bool isNaN(const t_type &value)
Query if 'value' is valid or invalid.
Definition BaseFunctions.hpp:200
@ Y
Definition BaseValues.hpp:202
@ X
Definition BaseValues.hpp:200
@ Z
Definition BaseValues.hpp:204
Definition MatrixDefinitions.h:43
static constexpr Matrix< t_type > RotationMatrix(const Vector< 3, t_type > &lookat, const Vector< 3, t_type > &up)
Definition MatrixDefinitions.h:109
static constexpr Matrix< t_type > OrthoFrustum(const Vector< 2, t_type > &span, t_type n, t_type f)
Definition MatrixDefinitions.h:74
static constexpr Matrix< t_type > Perspective(t_type fovy, t_type aspect, t_type near_plane, t_type far_plane)
Definition MatrixDefinitions.h:125
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:58
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:94
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:44
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:67