24 #include "../mat4x4.hpp"
25 #include "../vec2.hpp"
26 #include "../vec3.hpp"
27 #include "../vec4.hpp"
28 #include "../gtc/constants.hpp"
30 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
31 # pragma message("GLM: GLM_GTC_matrix_transform extension included")
58 template<
typename T, qualifier Q>
60 mat<4, 4, T, Q>
const& m, vec<3, T, Q>
const& v);
72 template<
typename T, qualifier Q>
73 GLM_FUNC_DECL mat<4, 4, T, Q>
rotate(
74 mat<4, 4, T, Q>
const& m, T
angle, vec<3, T, Q>
const&
axis);
85 template<
typename T, qualifier Q>
86 GLM_FUNC_DECL mat<4, 4, T, Q>
scale(
87 mat<4, 4, T, Q>
const& m, vec<3, T, Q>
const& v);
96 GLM_FUNC_DECL mat<4, 4, T, defaultp>
ortho(
97 T left, T right, T bottom, T top);
106 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoLH_ZO(
107 T left, T right, T bottom, T top, T zNear, T zFar);
116 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoLH_NO(
117 T left, T right, T bottom, T top, T zNear, T zFar);
126 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoRH_ZO(
127 T left, T right, T bottom, T top, T zNear, T zFar);
136 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoRH_NO(
137 T left, T right, T bottom, T top, T zNear, T zFar);
146 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoZO(
147 T left, T right, T bottom, T top, T zNear, T zFar);
156 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoNO(
157 T left, T right, T bottom, T top, T zNear, T zFar);
167 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoLH(
168 T left, T right, T bottom, T top, T zNear, T zFar);
178 GLM_FUNC_DECL mat<4, 4, T, defaultp>
orthoRH(
179 T left, T right, T bottom, T top, T zNear, T zFar);
189 GLM_FUNC_DECL mat<4, 4, T, defaultp>
ortho(
190 T left, T right, T bottom, T top, T zNear, T zFar);
199 T left, T right, T bottom, T top, T near, T far);
208 T left, T right, T bottom, T top, T near, T far);
217 T left, T right, T bottom, T top, T near, T far);
226 T left, T right, T bottom, T top, T near, T far);
234 GLM_FUNC_DECL mat<4, 4, T, defaultp>
frustumZO(
235 T left, T right, T bottom, T top, T near, T far);
243 GLM_FUNC_DECL mat<4, 4, T, defaultp>
frustumNO(
244 T left, T right, T bottom, T top, T near, T far);
253 GLM_FUNC_DECL mat<4, 4, T, defaultp>
frustumLH(
254 T left, T right, T bottom, T top, T near, T far);
263 GLM_FUNC_DECL mat<4, 4, T, defaultp>
frustumRH(
264 T left, T right, T bottom, T top, T near, T far);
273 GLM_FUNC_DECL mat<4, 4, T, defaultp>
frustum(
274 T left, T right, T bottom, T top, T near, T far);
288 T fovy, T aspect, T near, T far);
301 T fovy, T aspect, T near, T far);
314 T fovy, T aspect, T near, T far);
327 T fovy, T aspect, T near, T far);
340 T fovy, T aspect, T near, T far);
353 T fovy, T aspect, T near, T far);
367 T fovy, T aspect, T near, T far);
381 T fovy, T aspect, T near, T far);
395 T fovy, T aspect, T near, T far);
409 T fov, T width, T height, T near, T far);
423 T fov, T width, T height, T near, T far);
437 T fov, T width, T height, T near, T far);
451 T fov, T width, T height, T near, T far);
465 T fov, T width, T height, T near, T far);
479 T fov, T width, T height, T near, T far);
494 T fov, T width, T height, T near, T far);
509 T fov, T width, T height, T near, T far);
523 T fov, T width, T height, T near, T far);
534 T fovy, T aspect, T near);
545 T fovy, T aspect, T near);
556 T fovy, T aspect, T near);
567 T fovy, T aspect, T near);
579 T fovy, T aspect, T near, T ep);
593 template<
typename T,
typename U, qualifier Q>
595 vec<3, T, Q>
const& obj, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
609 template<
typename T,
typename U, qualifier Q>
611 vec<3, T, Q>
const& obj, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
625 template<
typename T,
typename U, qualifier Q>
626 GLM_FUNC_DECL vec<3, T, Q>
project(
627 vec<3, T, Q>
const& obj, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
641 template<
typename T,
typename U, qualifier Q>
643 vec<3, T, Q>
const& win, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
657 template<
typename T,
typename U, qualifier Q>
659 vec<3, T, Q>
const& win, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
673 template<
typename T,
typename U, qualifier Q>
675 vec<3, T, Q>
const& win, mat<4, 4, T, Q>
const& model, mat<4, 4, T, Q>
const&
proj, vec<4, U, Q>
const& viewport);
686 template<
typename T, qualifier Q,
typename U>
688 vec<2, T, Q>
const& center, vec<2, T, Q>
const& delta, vec<4, U, Q>
const& viewport);
697 template<
typename T, qualifier Q>
698 GLM_FUNC_DECL mat<4, 4, T, Q>
lookAtRH(
699 vec<3, T, Q>
const& eye, vec<3, T, Q>
const& center, vec<3, T, Q>
const& up);
708 template<
typename T, qualifier Q>
709 GLM_FUNC_DECL mat<4, 4, T, Q>
lookAtLH(
710 vec<3, T, Q>
const& eye, vec<3, T, Q>
const& center, vec<3, T, Q>
const& up);
720 template<
typename T, qualifier Q>
721 GLM_FUNC_DECL mat<4, 4, T, Q>
lookAt(
722 vec<3, T, Q>
const& eye, vec<3, T, Q>
const& center, vec<3, T, Q>
const& up);
727 #include "matrix_transform.inl"
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH_ZO(T fovy, T aspect, T near, T far)
Creates a matrix for a right handed, symetric perspective-view frustum.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFov(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view and the default handedness and defaul...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustum(T left, T right, T bottom, T top, T near, T far)
Creates a frustum matrix with default handedness, using the default handedness and default near and f...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH_NO(T left, T right, T bottom, T top, T near, T far)
Creates a right handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates.
GLM_FUNC_DECL T angle(tquat< T, Q > const &x)
Returns the quaternion rotation angle.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH_ZO(T fovy, T aspect, T near, T far)
Creates a matrix for a left handed, symetric perspective-view frustum.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH(T fov, T width, T height, T near, T far)
Builds a left handed perspective projection matrix based on a field of view.
GLM_FUNC_DECL vec< 3, T, Q > axis(tquat< T, Q > const &x)
Returns the q rotation axis.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH(T left, T right, T bottom, T top, T near, T far)
Creates a left handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > ortho(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using the default handedness and defaul...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH(T fovy, T aspect, T near, T far)
Creates a matrix for a left handed, symetric perspective-view frustum.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume using right-handed coordinates.
GLM_FUNC_DECL vec< 3, T, Q > unProjectNO(vec< 3, T, Q > const &win, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
GLM_FUNC_DECL vec< 3, T, Q > projectNO(vec< 3, T, Q > const &obj, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
GLM_FUNC_DECL vec< 3, T, Q > unProjectZO(vec< 3, T, Q > const &win, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumZO(T left, T right, T bottom, T top, T near, T far)
Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-h...
GLM_FUNC_DECL vec< 3, T, Q > projectZO(vec< 3, T, Q > const &obj, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumNO(T left, T right, T bottom, T top, T near, T far)
Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-h...
GLM_FUNC_DECL mat< 4, 4, T, Q > lookAt(vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a look at view matrix based on the default handedness.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates.
GLM_FUNC_DECL mat< 4, 4, T, Q > pickMatrix(vec< 2, T, Q > const ¢er, vec< 2, T, Q > const &delta, vec< 4, U, Q > const &viewport)
Define a picking region.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH_NO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using left-handed coordinates...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspectiveRH(T fovy, T aspect, T near)
Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH_ZO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using right-handed coordinates...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoNO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FO...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH_NO(T fovy, T aspect, T near, T far)
Creates a matrix for a left handed, symetric perspective-view frustum.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoZO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH_NO(T fovy, T aspect, T near, T far)
Creates a matrix for a right handed, symetric perspective-view frustum.
GLM_FUNC_DECL genType proj(genType const &x, genType const &Normal)
Projects x on Normal.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH_NO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using right-handed coordinates...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspectiveLH(T fovy, T aspect, T near)
Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates.
GLM_FUNC_DECL vec< 3, T, Q > project(vec< 3, T, Q > const &obj, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near...
GLM_FUNC_DECL mat< 4, 4, T, Q > translate(mat< 4, 4, T, Q > const &m, vec< 3, T, Q > const &v)
Builds a translation 4 * 4 matrix created from a vector of 3 components.
GLM_FUNC_DECL mat< 4, 4, T, Q > rotate(mat< 4, 4, T, Q > const &m, T angle, vec< 3, T, Q > const &axis)
Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovZO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveNO(T fovy, T aspect, T near, T far)
Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_L...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH_ZO(T left, T right, T bottom, T top, T near, T far)
Creates a left handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH(T left, T right, T bottom, T top, T near, T far)
Creates a right handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, Q > scale(mat< 4, 4, T, Q > const &m, vec< 3, T, Q > const &v)
Builds a scale 4 * 4 matrix created from 3 scalars.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH(T left, T right, T bottom, T top, T zNear, T zFar)
Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH(T fovy, T aspect, T near, T far)
Creates a matrix for a right handed, symetric perspective-view frustum.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > tweakedInfinitePerspective(T fovy, T aspect, T near, T ep)
Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics har...
GLM_FUNC_DECL vec< 3, T, Q > unProject(vec< 3, T, Q > const &win, mat< 4, 4, T, Q > const &model, mat< 4, 4, T, Q > const &proj, vec< 4, U, Q > const &viewport)
Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveZO(T fovy, T aspect, T near, T far)
Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_L...
GLM_FUNC_DECL mat< 4, 4, T, Q > lookAtRH(vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a right handed look at view matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH_ZO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using left-handed coordinates...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH_ZO(T left, T right, T bottom, T top, T near, T far)
Creates a right handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, Q > lookAtLH(vec< 3, T, Q > const &eye, vec< 3, T, Q > const ¢er, vec< 3, T, Q > const &up)
Build a left handed look at view matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH_NO(T left, T right, T bottom, T top, T near, T far)
Creates a left handed frustum matrix.
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspective(T fovy, T aspect, T near)
Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default han...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspective(T fovy, T aspect, T near, T far)
Creates a matrix for a symetric perspective-view frustum based on the default handedness and default ...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovNO(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_...
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH(T fov, T width, T height, T near, T far)
Builds a right handed perspective projection matrix based on a field of view.