0.9.6: matrix_transform.hpp Source File

| 0.9.6

- Main Page
- Modules
- Files

- File List

matrix_transform.hpp
Go to the documentation of this file.
1
50 #pragma once
51
52 // Dependencies
53 #include "../mat4x4.hpp"
54 #include "../vec2.hpp"
55 #include "../vec3.hpp"
56 #include "../vec4.hpp"
57 #include "../gtc/constants.hpp"
58
59 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
60 # pragma message("GLM: GLM_GTC_matrix_transform extension included")
61 #endif
62
63 namespace glm
64 {
67
86 template <typename T, precision P>
87 GLM_FUNC_DECL tmat4x4<T, P> translate(
88 tmat4x4<T, P> const & m,
89 tvec3<T, P> const & v);
90
100 template <typename T, precision P>
101 GLM_FUNC_DECL tmat4x4<T, P> rotate(
102 tmat4x4<T, P> const & m,
103 T angle,
104 tvec3<T, P> const & axis);
105
114 template <typename T, precision P>
115 GLM_FUNC_DECL tmat4x4<T, P> scale(
116 tmat4x4<T, P> const & m,
117 tvec3<T, P> const & v);
118
130 template <typename T>
131 GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
132 T left,
133 T right,
134 T bottom,
135 T top,
136 T zNear,
137 T zFar);
138
148 template <typename T>
149 GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
150 T left,
151 T right,
152 T bottom,
153 T top);
154
165 template <typename T>
166 GLM_FUNC_DECL tmat4x4<T, defaultp> frustum(
167 T left,
168 T right,
169 T bottom,
170 T top,
171 T near,
172 T far);
173
182 template <typename T>
183 GLM_FUNC_DECL tmat4x4<T, defaultp> perspective(
184 T fovy,
185 T aspect,
186 T near,
187 T far);
188
198 template <typename T>
199 GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFov(
200 T fov,
201 T width,
202 T height,
203 T near,
204 T far);
205
213 template <typename T>
214 GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspective(
215 T fovy, T aspect, T near);
216
224 template <typename T>
225 GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
226 T fovy, T aspect, T near);
227
236 template <typename T>
237 GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
238 T fovy, T aspect, T near, T ep);
239
250 template <typename T, typename U, precision P>
251 GLM_FUNC_DECL tvec3<T, P> project(
252 tvec3<T, P> const & obj,
253 tmat4x4<T, P> const & model,
254 tmat4x4<T, P> const & proj,
255 tvec4<U, P> const & viewport);
256
267 template <typename T, typename U, precision P>
268 GLM_FUNC_DECL tvec3<T, P> unProject(
269 tvec3<T, P> const & win,
270 tmat4x4<T, P> const & model,
271 tmat4x4<T, P> const & proj,
272 tvec4<U, P> const & viewport);
273
282 template <typename T, precision P, typename U>
283 GLM_FUNC_DECL tmat4x4<T, P> pickMatrix(
284 tvec2<T, P> const & center,
285 tvec2<T, P> const & delta,
286 tvec4<U, P> const & viewport);
287
295 template <typename T, precision P>
296 GLM_FUNC_DECL tmat4x4<T, P> lookAt(
297 tvec3<T, P> const & eye,
298 tvec3<T, P> const & center,
299 tvec3<T, P> const & up);
300
302 }//namespace glm
303
304 #include "matrix_transform.inl"
glm::ortho
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::scale
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::proj
GLM_FUNC_DECL vecType proj(vecType const &x, vecType const &Normal)
Projects x on Normal.
glm::project
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::axis
GLM_FUNC_DECL tvec3< T, P > axis(tquat< T, P > const &x)
Returns the q rotation axis.
glm::perspectiveFov
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.
glm::angle
GLM_FUNC_DECL T angle(tquat< T, P > const &x)
Returns the quaternion rotation angle.
glm::translate
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::frustum
GLM_FUNC_DECL tmat4x4< T, defaultp > frustum(T left, T right, T bottom, T top, T near, T far)
Creates a frustum matrix.
glm::tweakedInfinitePerspective
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::rotate
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
Definition: _noise.hpp:39
glm::perspective
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::unProject
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::pickMatrix
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.
glm::infinitePerspective
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::lookAt
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.