0.9.6
matrix_transform.hpp
Go to the documentation of this file.
1 
46 #pragma once
47 
48 // Dependencies
49 #include "../mat4x4.hpp"
50 #include "../vec2.hpp"
51 #include "../vec3.hpp"
52 #include "../vec4.hpp"
53 #include "../gtc/constants.hpp"
54 
55 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
56 # pragma message("GLM: GLM_GTC_matrix_transform extension included")
57 #endif
58 
59 namespace glm
60 {
63 
82  template <typename T, precision P>
83  GLM_FUNC_DECL tmat4x4<T, P> translate(
84  tmat4x4<T, P> const & m,
85  tvec3<T, P> const & v);
86 
96  template <typename T, precision P>
97  GLM_FUNC_DECL tmat4x4<T, P> rotate(
98  tmat4x4<T, P> const & m,
99  T angle,
100  tvec3<T, P> const & axis);
101 
110  template <typename T, precision P>
111  GLM_FUNC_DECL tmat4x4<T, P> scale(
112  tmat4x4<T, P> const & m,
113  tvec3<T, P> const & v);
114 
126  template <typename T>
127  GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
128  T left,
129  T right,
130  T bottom,
131  T top,
132  T zNear,
133  T zFar);
134 
144  template <typename T>
145  GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
146  T left,
147  T right,
148  T bottom,
149  T top);
150 
161  template <typename T>
162  GLM_FUNC_DECL tmat4x4<T, defaultp> frustum(
163  T left,
164  T right,
165  T bottom,
166  T top,
167  T near,
168  T far);
169 
178  template <typename T>
179  GLM_FUNC_DECL tmat4x4<T, defaultp> perspective(
180  T fovy,
181  T aspect,
182  T near,
183  T far);
184 
194  template <typename T>
195  GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFov(
196  T fov,
197  T width,
198  T height,
199  T near,
200  T far);
201 
209  template <typename T>
210  GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspective(
211  T fovy, T aspect, T near);
212 
220  template <typename T>
221  GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
222  T fovy, T aspect, T near);
223 
232  template <typename T>
233  GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
234  T fovy, T aspect, T near, T ep);
235 
246  template <typename T, typename U, precision P>
247  GLM_FUNC_DECL tvec3<T, P> project(
248  tvec3<T, P> const & obj,
249  tmat4x4<T, P> const & model,
250  tmat4x4<T, P> const & proj,
251  tvec4<U, P> const & viewport);
252 
263  template <typename T, typename U, precision P>
264  GLM_FUNC_DECL tvec3<T, P> unProject(
265  tvec3<T, P> const & win,
266  tmat4x4<T, P> const & model,
267  tmat4x4<T, P> const & proj,
268  tvec4<U, P> const & viewport);
269 
278  template <typename T, precision P, typename U>
279  GLM_FUNC_DECL tmat4x4<T, P> pickMatrix(
280  tvec2<T, P> const & center,
281  tvec2<T, P> const & delta,
282  tvec4<U, P> const & viewport);
283 
291  template <typename T, precision P>
292  GLM_FUNC_DECL tmat4x4<T, P> lookAt(
293  tvec3<T, P> const & eye,
294  tvec3<T, P> const & center,
295  tvec3<T, P> const & up);
296 
298 }//namespace glm
299 
300 #include "matrix_transform.inl"
GLM_FUNC_DECL tvec3< T, P > unProject(tvec3< T, P > const &win, tmat4x4< T, P > const &model, tmat4x4< T, P > const &proj, tvec4< U, P > const &viewport)
Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
GLM_FUNC_DECL tmat4x4< T, P > lookAt(tvec3< T, P > const &eye, tvec3< T, P > const &center, tvec3< T, P > const &up)
Build a look at view matrix.
GLM_FUNC_DECL tmat4x4< T, P > translate(tmat4x4< T, P > const &m, tvec3< T, P > const &v)
Builds a translation 4 * 4 matrix created from a vector of 3 components.
GLM_FUNC_DECL tmat4x4< T, defaultp > frustum(T left, T right, T bottom, T top, T near, T far)
Creates a frustum matrix.
GLM_FUNC_DECL tmat4x4< 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 tmat4x4< T, defaultp > infinitePerspective(T fovy, T aspect, T near)
Creates a matrix for a symmetric perspective-view frustum with far plane at infinite.
GLM_FUNC_DECL tmat4x4< T, defaultp > perspective(T fovy, T aspect, T near, T far)
Creates a matrix for a symetric perspective-view frustum.
GLM_FUNC_DECL tmat4x4< T, P > rotate(tmat4x4< T, P > const &m, T angle, tvec3< T, P > const &axis)
Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
GLM_FUNC_DECL tmat4x4< T, defaultp > ortho(T left, T right, T bottom, T top)
Creates a matrix for projecting two-dimensional coordinates onto the screen.
GLM_FUNC_DECL vecType proj(vecType const &x, vecType const &Normal)
Projects x on Normal.
GLM_FUNC_DECL tmat4x4< T, P > pickMatrix(tvec2< T, P > const &center, tvec2< T, P > const &delta, tvec4< U, P > const &viewport)
Define a picking region.
Definition: _noise.hpp:31
GLM_FUNC_DECL tvec3< T, P > project(tvec3< T, P > const &obj, tmat4x4< T, P > const &model, tmat4x4< T, P > const &proj, tvec4< U, P > const &viewport)
Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
GLM_FUNC_DECL tmat4x4< T, P > scale(tmat4x4< T, P > const &m, tvec3< T, P > const &v)
Builds a scale 4 * 4 matrix created from 3 scalars.
GLM_FUNC_DECL T angle(tquat< T, P > const &x)
Returns the quaternion rotation angle.
GLM_FUNC_DECL tvec3< T, P > axis(tquat< T, P > const &x)
Returns the q rotation axis.
GLM_FUNC_DECL tmat4x4< T, defaultp > perspectiveFov(T fov, T width, T height, T near, T far)
Builds a perspective projection matrix based on a field of view.