7 Result[0][0] =
static_cast<T
>(2) / (right - left);
8 Result[1][1] =
static_cast<T
>(2) / (top - bottom);
9 Result[2][2] = -
static_cast<T
>(1);
10 Result[3][0] = - (right + left) / (right - left);
11 Result[3][1] = - (top + bottom) / (top - bottom);
19 Result[0][0] =
static_cast<T
>(2) / (right - left);
20 Result[1][1] =
static_cast<T
>(2) / (top - bottom);
21 Result[2][2] =
static_cast<T
>(1) / (zFar - zNear);
22 Result[3][0] = - (right + left) / (right - left);
23 Result[3][1] = - (top + bottom) / (top - bottom);
24 Result[3][2] = - zNear / (zFar - zNear);
32 Result[0][0] =
static_cast<T
>(2) / (right - left);
33 Result[1][1] =
static_cast<T
>(2) / (top - bottom);
34 Result[2][2] =
static_cast<T
>(2) / (zFar - zNear);
35 Result[3][0] = - (right + left) / (right - left);
36 Result[3][1] = - (top + bottom) / (top - bottom);
37 Result[3][2] = - (zFar + zNear) / (zFar - zNear);
45 Result[0][0] =
static_cast<T
>(2) / (right - left);
46 Result[1][1] =
static_cast<T
>(2) / (top - bottom);
47 Result[2][2] = -
static_cast<T
>(1) / (zFar - zNear);
48 Result[3][0] = - (right + left) / (right - left);
49 Result[3][1] = - (top + bottom) / (top - bottom);
50 Result[3][2] = - zNear / (zFar - zNear);
58 Result[0][0] =
static_cast<T
>(2) / (right - left);
59 Result[1][1] =
static_cast<T
>(2) / (top - bottom);
60 Result[2][2] = -
static_cast<T
>(2) / (zFar - zNear);
61 Result[3][0] = - (right + left) / (right - left);
62 Result[3][1] = - (top + bottom) / (top - bottom);
63 Result[3][2] = - (zFar + zNear) / (zFar - zNear);
70# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
71 return orthoLH_ZO(left, right, bottom, top, zNear, zFar);
73 return orthoRH_ZO(left, right, bottom, top, zNear, zFar);
80# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
81 return orthoLH_NO(left, right, bottom, top, zNear, zFar);
83 return orthoRH_NO(left, right, bottom, top, zNear, zFar);
90# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
91 return orthoLH_ZO(left, right, bottom, top, zNear, zFar);
93 return orthoLH_NO(left, right, bottom, top, zNear, zFar);
101# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
102 return orthoRH_ZO(left, right, bottom, top, zNear, zFar);
104 return orthoRH_NO(left, right, bottom, top, zNear, zFar);
111# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO
112 return orthoLH_ZO(left, right, bottom, top, zNear, zFar);
113# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO
114 return orthoLH_NO(left, right, bottom, top, zNear, zFar);
115# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO
116 return orthoRH_ZO(left, right, bottom, top, zNear, zFar);
117# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO
118 return orthoRH_NO(left, right, bottom, top, zNear, zFar);
126 Result[0][0] = (
static_cast<T
>(2) * nearVal) / (right - left);
127 Result[1][1] = (
static_cast<T
>(2) * nearVal) / (top - bottom);
128 Result[2][0] = (right + left) / (right - left);
129 Result[2][1] = (top + bottom) / (top - bottom);
130 Result[2][2] = farVal / (farVal - nearVal);
131 Result[2][3] =
static_cast<T
>(1);
132 Result[3][2] = -(farVal * nearVal) / (farVal - nearVal);
140 Result[0][0] = (
static_cast<T
>(2) * nearVal) / (right - left);
141 Result[1][1] = (
static_cast<T
>(2) * nearVal) / (top - bottom);
142 Result[2][0] = (right + left) / (right - left);
143 Result[2][1] = (top + bottom) / (top - bottom);
144 Result[2][2] = (farVal + nearVal) / (farVal - nearVal);
145 Result[2][3] =
static_cast<T
>(1);
146 Result[3][2] = - (
static_cast<T
>(2) * farVal * nearVal) / (farVal - nearVal);
154 Result[0][0] = (
static_cast<T
>(2) * nearVal) / (right - left);
155 Result[1][1] = (
static_cast<T
>(2) * nearVal) / (top - bottom);
156 Result[2][0] = (right + left) / (right - left);
157 Result[2][1] = (top + bottom) / (top - bottom);
158 Result[2][2] = farVal / (nearVal - farVal);
159 Result[2][3] =
static_cast<T
>(-1);
160 Result[3][2] = -(farVal * nearVal) / (farVal - nearVal);
168 Result[0][0] = (
static_cast<T
>(2) * nearVal) / (right - left);
169 Result[1][1] = (
static_cast<T
>(2) * nearVal) / (top - bottom);
170 Result[2][0] = (right + left) / (right - left);
171 Result[2][1] = (top + bottom) / (top - bottom);
172 Result[2][2] = - (farVal + nearVal) / (farVal - nearVal);
173 Result[2][3] =
static_cast<T
>(-1);
174 Result[3][2] = - (
static_cast<T
>(2) * farVal * nearVal) / (farVal - nearVal);
181# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
182 return frustumLH_ZO(left, right, bottom, top, nearVal, farVal);
184 return frustumRH_ZO(left, right, bottom, top, nearVal, farVal);
191# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
192 return frustumLH_NO(left, right, bottom, top, nearVal, farVal);
194 return frustumRH_NO(left, right, bottom, top, nearVal, farVal);
201# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
202 return frustumLH_ZO(left, right, bottom, top, nearVal, farVal);
204 return frustumLH_NO(left, right, bottom, top, nearVal, farVal);
211# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
212 return frustumRH_ZO(left, right, bottom, top, nearVal, farVal);
214 return frustumRH_NO(left, right, bottom, top, nearVal, farVal);
221# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO
222 return frustumLH_ZO(left, right, bottom, top, nearVal, farVal);
223# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO
224 return frustumLH_NO(left, right, bottom, top, nearVal, farVal);
225# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO
226 return frustumRH_ZO(left, right, bottom, top, nearVal, farVal);
227# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO
228 return frustumRH_NO(left, right, bottom, top, nearVal, farVal);
235 assert(
abs(aspect - std::numeric_limits<T>::epsilon()) >
static_cast<T
>(0));
237 T
const tanHalfFovy =
tan(fovy /
static_cast<T
>(2));
240 Result[0][0] =
static_cast<T
>(1) / (aspect * tanHalfFovy);
241 Result[1][1] =
static_cast<T
>(1) / (tanHalfFovy);
242 Result[2][2] = zFar / (zNear - zFar);
243 Result[2][3] = -
static_cast<T
>(1);
244 Result[3][2] = -(zFar * zNear) / (zFar - zNear);
251 assert(
abs(aspect - std::numeric_limits<T>::epsilon()) >
static_cast<T
>(0));
253 T
const tanHalfFovy =
tan(fovy /
static_cast<T
>(2));
256 Result[0][0] =
static_cast<T
>(1) / (aspect * tanHalfFovy);
257 Result[1][1] =
static_cast<T
>(1) / (tanHalfFovy);
258 Result[2][2] = - (zFar + zNear) / (zFar - zNear);
259 Result[2][3] = -
static_cast<T
>(1);
260 Result[3][2] = - (
static_cast<T
>(2) * zFar * zNear) / (zFar - zNear);
267 assert(
abs(aspect - std::numeric_limits<T>::epsilon()) >
static_cast<T
>(0));
269 T
const tanHalfFovy =
tan(fovy /
static_cast<T
>(2));
272 Result[0][0] =
static_cast<T
>(1) / (aspect * tanHalfFovy);
273 Result[1][1] =
static_cast<T
>(1) / (tanHalfFovy);
274 Result[2][2] = zFar / (zFar - zNear);
275 Result[2][3] =
static_cast<T
>(1);
276 Result[3][2] = -(zFar * zNear) / (zFar - zNear);
283 assert(
abs(aspect - std::numeric_limits<T>::epsilon()) >
static_cast<T
>(0));
285 T
const tanHalfFovy =
tan(fovy /
static_cast<T
>(2));
288 Result[0][0] =
static_cast<T
>(1) / (aspect * tanHalfFovy);
289 Result[1][1] =
static_cast<T
>(1) / (tanHalfFovy);
290 Result[2][2] = (zFar + zNear) / (zFar - zNear);
291 Result[2][3] =
static_cast<T
>(1);
292 Result[3][2] = - (
static_cast<T
>(2) * zFar * zNear) / (zFar - zNear);
299# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
309# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
319# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
330# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
340# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO
342# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO
344# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO
346# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO
354 assert(width >
static_cast<T
>(0));
355 assert(height >
static_cast<T
>(0));
356 assert(fov >
static_cast<T
>(0));
359 T
const h =
glm::cos(
static_cast<T
>(0.5) * rad) /
glm::sin(
static_cast<T
>(0.5) * rad);
360 T
const w = h * height / width;
365 Result[2][2] = zFar / (zNear - zFar);
366 Result[2][3] = -
static_cast<T
>(1);
367 Result[3][2] = -(zFar * zNear) / (zFar - zNear);
374 assert(width >
static_cast<T
>(0));
375 assert(height >
static_cast<T
>(0));
376 assert(fov >
static_cast<T
>(0));
379 T
const h =
glm::cos(
static_cast<T
>(0.5) * rad) /
glm::sin(
static_cast<T
>(0.5) * rad);
380 T
const w = h * height / width;
385 Result[2][2] = - (zFar + zNear) / (zFar - zNear);
386 Result[2][3] = -
static_cast<T
>(1);
387 Result[3][2] = - (
static_cast<T
>(2) * zFar * zNear) / (zFar - zNear);
394 assert(width >
static_cast<T
>(0));
395 assert(height >
static_cast<T
>(0));
396 assert(fov >
static_cast<T
>(0));
399 T
const h =
glm::cos(
static_cast<T
>(0.5) * rad) /
glm::sin(
static_cast<T
>(0.5) * rad);
400 T
const w = h * height / width;
405 Result[2][2] = zFar / (zFar - zNear);
406 Result[2][3] =
static_cast<T
>(1);
407 Result[3][2] = -(zFar * zNear) / (zFar - zNear);
414 assert(width >
static_cast<T
>(0));
415 assert(height >
static_cast<T
>(0));
416 assert(fov >
static_cast<T
>(0));
419 T
const h =
glm::cos(
static_cast<T
>(0.5) * rad) /
glm::sin(
static_cast<T
>(0.5) * rad);
420 T
const w = h * height / width;
425 Result[2][2] = (zFar + zNear) / (zFar - zNear);
426 Result[2][3] =
static_cast<T
>(1);
427 Result[3][2] = - (
static_cast<T
>(2) * zFar * zNear) / (zFar - zNear);
434# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
444# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
454# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
464# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT
474# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO
476# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO
478# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO
480# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO
488 T
const range =
tan(fovy /
static_cast<T
>(2)) * zNear;
489 T
const left = -range * aspect;
490 T
const right = range * aspect;
491 T
const bottom = -range;
495 Result[0][0] = (
static_cast<T
>(2) * zNear) / (right - left);
496 Result[1][1] = (
static_cast<T
>(2) * zNear) / (top - bottom);
497 Result[2][2] = -
static_cast<T
>(1);
498 Result[2][3] = -
static_cast<T
>(1);
499 Result[3][2] = -
static_cast<T
>(2) * zNear;
506 T
const range =
tan(fovy /
static_cast<T
>(2)) * zNear;
507 T
const left = -range * aspect;
508 T
const right = range * aspect;
509 T
const bottom = -range;
513 Result[0][0] = (
static_cast<T
>(2) * zNear) / (right - left);
514 Result[1][1] = (
static_cast<T
>(2) * zNear) / (top - bottom);
515 Result[2][2] =
static_cast<T
>(1);
516 Result[2][3] =
static_cast<T
>(1);
517 Result[3][2] = -
static_cast<T
>(2) * zNear;
524# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT
535 T
const range =
tan(fovy /
static_cast<T
>(2)) * zNear;
536 T
const left = -range * aspect;
537 T
const right = range * aspect;
538 T
const bottom = -range;
542 Result[0][0] = (
static_cast<T
>(2) * zNear) / (right - left);
543 Result[1][1] = (
static_cast<T
>(2) * zNear) / (top - bottom);
544 Result[2][2] = ep -
static_cast<T
>(1);
545 Result[2][3] =
static_cast<T
>(-1);
546 Result[3][2] = (ep -
static_cast<T
>(2)) * zNear;
GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x)
GLM_FUNC_QUALIFIER vec< L, T, Q > sin(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:41
GLM_FUNC_QUALIFIER vec< L, T, Q > cos(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:50
GLM_FUNC_QUALIFIER vec< L, T, Q > tan(vec< L, T, Q > const &v)
Definition func_trigonometric.inl:59
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:328
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH_ZO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:352
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH_NO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:137
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH_ZO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:151
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH_NO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:412
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveZO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:297
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovZO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:432
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumNO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:189
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFov(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:472
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumZO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:179
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:55
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:29
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH_NO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:249
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveRH_ZO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:233
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveNO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:307
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoZO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:68
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH_NO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:372
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:317
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:88
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspective(T fovy, T aspect, T near)
Definition matrix_clip_space.inl:522
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH_ZO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:265
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspective(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:338
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH_ZO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:392
GLM_FUNC_DECL mat< 4, 4, T, defaultp > ortho(T left, T right, T bottom, T top)
Definition matrix_clip_space.inl:4
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:209
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoNO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:78
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveLH_NO(T fovy, T aspect, T near, T far)
Definition matrix_clip_space.inl:281
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovRH(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:462
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:42
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovNO(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:442
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH_ZO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:123
GLM_FUNC_DECL mat< 4, 4, T, defaultp > tweakedInfinitePerspective(T fovy, T aspect, T near)
Definition matrix_clip_space.inl:551
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:16
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspectiveRH(T fovy, T aspect, T near)
Definition matrix_clip_space.inl:486
GLM_FUNC_DECL mat< 4, 4, T, defaultp > infinitePerspectiveLH(T fovy, T aspect, T near)
Definition matrix_clip_space.inl:504
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumLH(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:199
GLM_FUNC_DECL mat< 4, 4, T, defaultp > perspectiveFovLH(T fov, T width, T height, T near, T far)
Definition matrix_clip_space.inl:452
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustum(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:219
GLM_FUNC_DECL mat< 4, 4, T, defaultp > frustumRH_NO(T left, T right, T bottom, T top, T near, T far)
Definition matrix_clip_space.inl:165
GLM_FUNC_DECL mat< 4, 4, T, defaultp > orthoRH(T left, T right, T bottom, T top, T zNear, T zFar)
Definition matrix_clip_space.inl:99
GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon()
Return the epsilon constant for floating point types.
Definition scalar_constants.inl:6
Core features
Definition common.hpp:21
Definition qualifier.hpp:36