GLM 0.9.5

- Main Page
- Related Pages
- Modules
- Namespaces
- Files

- File List

matrix_transform.hpp
Go to the documentation of this file.
1
46 #ifndef GLM_GTC_matrix_transform
47 #define GLM_GTC_matrix_transform
48
49 // Dependency:
50 #include "../mat4x4.hpp"
51 #include "../vec2.hpp"
52 #include "../vec3.hpp"
53 #include "../vec4.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
84 template <typename T, precision P>
85 GLM_FUNC_DECL detail::tmat4x4<T, P> translate(
86 detail::tmat4x4<T, P> const & m,
87 detail::tvec3<T, P> const & v);
88
100 template <typename T, precision P>
101 GLM_FUNC_DECL detail::tmat4x4<T, P> rotate(
102 detail::tmat4x4<T, P> const & m,
103 T const & angle,
104 detail::tvec3<T, P> const & axis);
105
116 template <typename T, precision P>
117 GLM_FUNC_DECL detail::tmat4x4<T, P> scale(
118 detail::tmat4x4<T, P> const & m,
119 detail::tvec3<T, P> const & v);
120
132 template <typename T>
133 GLM_FUNC_DECL detail::tmat4x4<T, defaultp> ortho(
134 T const & left,
135 T const & right,
136 T const & bottom,
137 T const & top,
138 T const & zNear,
139 T const & zFar);
140
150 template <typename T>
151 GLM_FUNC_DECL detail::tmat4x4<T, defaultp> ortho(
152 T const & left,
153 T const & right,
154 T const & bottom,
155 T const & top);
156
167 template <typename T, precision P>
168 GLM_FUNC_DECL detail::tmat4x4<T, P> frustum(
169 T const & left,
170 T const & right,
171 T const & bottom,
172 T const & top,
173 T const & near,
174 T const & far);
175
184 template <typename T, precision P>
185 GLM_FUNC_DECL detail::tmat4x4<T, P> perspective(
186 T const & fovy,
187 T const & aspect,
188 T const & near,
189 T const & far);
190
200 template <typename T, precision P>
201 GLM_FUNC_DECL detail::tmat4x4<T, P> perspectiveFov(
202 T const & fov,
203 T const & width,
204 T const & height,
205 T const & near,
206 T const & far);
207
215 template <typename T, precision P>
216 GLM_FUNC_DECL detail::tmat4x4<T, P> infinitePerspective(
217 T fovy, T aspect, T near);
218
226 template <typename T, precision P>
227 GLM_FUNC_DECL detail::tmat4x4<T, P> tweakedInfinitePerspective(
228 T fovy, T aspect, T near);
229
239 template <typename T, typename U, precision P>
240 GLM_FUNC_DECL detail::tvec3<T, P> project(
241 detail::tvec3<T, P> const & obj,
242 detail::tmat4x4<T, P> const & model,
243 detail::tmat4x4<T, P> const & proj,
244 detail::tvec4<U, P> const & viewport);
245
255 template <typename T, typename U, precision P>
256 GLM_FUNC_DECL detail::tvec3<T, P> unProject(
257 detail::tvec3<T, P> const & win,
258 detail::tmat4x4<T, P> const & model,
259 detail::tmat4x4<T, P> const & proj,
260 detail::tvec4<U, P> const & viewport);
261
270 template <typename T, precision P, typename U>
271 GLM_FUNC_DECL detail::tmat4x4<T, P> pickMatrix(
272 detail::tvec2<T, P> const & center,
273 detail::tvec2<T, P> const & delta,
274 detail::tvec4<U, P> const & viewport);
275
283 template <typename T, precision P>
284 GLM_FUNC_DECL detail::tmat4x4<T, P> lookAt(
285 detail::tvec3<T, P> const & eye,
286 detail::tvec3<T, P> const & center,
287 detail::tvec3<T, P> const & up);
288
290 }//namespace glm
291
292 #include "matrix_transform.inl"
293
294 #endif//GLM_GTC_matrix_transform
glm::rotate
GLM_FUNC_DECL detail::tmat4x4< T, P > rotate(detail::tmat4x4< T, P > const &m, T const &angle, detail::tvec3< T, P > const &axis)
Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
glm::proj
vecType proj(vecType const &x, vecType const &Normal)
Projects x on Normal.
glm::angle
GLM_FUNC_DECL T angle(detail::tquat< T, P > const &x)
Returns the quaternion rotation angle.
glm::scale
GLM_FUNC_DECL detail::tmat4x4< T, P > scale(detail::tmat4x4< T, P > const &m, detail::tvec3< T, P > const &v)
Builds a scale 4 * 4 matrix created from 3 scalars.
glm::tweakedInfinitePerspective
GLM_FUNC_DECL detail::tmat4x4< T, P > tweakedInfinitePerspective(T fovy, T aspect, T near)
Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics har...
glm::translate
GLM_FUNC_DECL detail::tmat4x4< T, P > translate(detail::tmat4x4< T, P > const &m, detail::tvec3< T, P > const &v)
Builds a translation 4 * 4 matrix created from a vector of 3 components.
glm::perspective
GLM_FUNC_DECL detail::tmat4x4< T, P > perspective(T const &fovy, T const &aspect, T const &near, T const &far)
Creates a matrix for a symetric perspective-view frustum.
glm::pickMatrix
GLM_FUNC_DECL detail::tmat4x4< T, P > pickMatrix(detail::tvec2< T, P > const &center, detail::tvec2< T, P > const &delta, detail::tvec4< U, P > const &viewport)
Define a picking region.
glm::infinitePerspective
GLM_FUNC_DECL detail::tmat4x4< T, P > infinitePerspective(T fovy, T aspect, T near)
Creates a matrix for a symmetric perspective-view frustum with far plane at infinite.
glm::ortho
GLM_FUNC_DECL detail::tmat4x4< T, defaultp > ortho(T const &left, T const &right, T const &bottom, T const &top, T const &zNear, T const &zFar)
Creates a matrix for an orthographic parallel viewing volume.
glm::axis
GLM_FUNC_DECL detail::tvec3< T, P > axis(detail::tquat< T, P > const &x)
Returns the q rotation axis.
glm::unProject
GLM_FUNC_DECL detail::tvec3< T, P > unProject(detail::tvec3< T, P > const &win, detail::tmat4x4< T, P > const &model, detail::tmat4x4< T, P > const &proj, detail::tvec4< U, P > const &viewport)
Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
glm::perspectiveFov
GLM_FUNC_DECL detail::tmat4x4< T, P > perspectiveFov(T const &fov, T const &width, T const &height, T const &near, T const &far)
Builds a perspective projection matrix based on a field of view.
glm::lookAt
GLM_FUNC_DECL detail::tmat4x4< T, P > lookAt(detail::tvec3< T, P > const &eye, detail::tvec3< T, P > const &center, detail::tvec3< T, P > const &up)
Build a look at view matrix.
glm::frustum
GLM_FUNC_DECL detail::tmat4x4< T, P > frustum(T const &left, T const &right, T const &bottom, T const &top, T const &near, T const &far)
Creates a frustum matrix.
glm::project
GLM_FUNC_DECL detail::tvec3< T, P > project(detail::tvec3< T, P > const &obj, detail::tmat4x4< T, P > const &model, detail::tmat4x4< T, P > const &proj, detail::tvec4< U, P > const &viewport)
Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.