mirror of
https://github.com/g-truc/glm.git
synced 2024-11-27 02:34:35 +00:00
Clean up GTX_matrix_transform coding style
This commit is contained in:
parent
ecfebe640f
commit
a391bc1be6
@ -150,12 +150,9 @@ namespace glm
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T zNear,
|
||||
T zFar
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
# ifdef GLM_LEFT_HANDED
|
||||
@ -168,12 +165,9 @@ namespace glm
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoLH
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T zNear,
|
||||
T zFar
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
tmat4x4<T, defaultp> Result(1);
|
||||
@ -189,18 +183,16 @@ namespace glm
|
||||
Result[2][2] = static_cast<T>(2) / (zFar - zNear);
|
||||
Result[3][2] = - (zFar + zNear) / (zFar - zNear);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoRH
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T zNear,
|
||||
T zFar
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
tmat4x4<T, defaultp> Result(1);
|
||||
@ -216,16 +208,15 @@ namespace glm
|
||||
Result[2][2] = - static_cast<T>(2) / (zFar - zNear);
|
||||
Result[3][2] = - (zFar + zNear) / (zFar - zNear);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top
|
||||
T left, T right,
|
||||
T bottom, T top
|
||||
)
|
||||
{
|
||||
tmat4x4<T, defaultp> Result(1);
|
||||
@ -240,12 +231,9 @@ namespace glm
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustum
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T nearVal,
|
||||
T farVal
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T nearVal, T farVal
|
||||
)
|
||||
{
|
||||
# ifdef GLM_LEFT_HANDED
|
||||
@ -258,12 +246,9 @@ namespace glm
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumLH
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T nearVal,
|
||||
T farVal
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T nearVal, T farVal
|
||||
)
|
||||
{
|
||||
tmat4x4<T, defaultp> Result(0);
|
||||
@ -280,18 +265,16 @@ namespace glm
|
||||
Result[2][2] = (farVal + nearVal) / (farVal - nearVal);
|
||||
Result[3][2] = - (static_cast<T>(2) * farVal * nearVal) / (farVal - nearVal);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumRH
|
||||
(
|
||||
T left,
|
||||
T right,
|
||||
T bottom,
|
||||
T top,
|
||||
T nearVal,
|
||||
T farVal
|
||||
T left, T right,
|
||||
T bottom, T top,
|
||||
T nearVal, T farVal
|
||||
)
|
||||
{
|
||||
tmat4x4<T, defaultp> Result(0);
|
||||
@ -308,6 +291,7 @@ namespace glm
|
||||
Result[2][2] = - (farVal + nearVal) / (farVal - nearVal);
|
||||
Result[3][2] = - (static_cast<T>(2) * farVal * nearVal) / (farVal - nearVal);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -332,8 +316,7 @@ namespace glm
|
||||
(
|
||||
T fovy,
|
||||
T aspect,
|
||||
T zNear,
|
||||
T zFar
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
|
||||
@ -352,6 +335,7 @@ namespace glm
|
||||
Result[2][2] = - (zFar + zNear) / (zFar - zNear);
|
||||
Result[3][2] = - (static_cast<T>(2) * zFar * zNear) / (zFar - zNear);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -360,8 +344,7 @@ namespace glm
|
||||
(
|
||||
T fovy,
|
||||
T aspect,
|
||||
T zNear,
|
||||
T zFar
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
|
||||
@ -380,6 +363,7 @@ namespace glm
|
||||
Result[2][2] = (zFar + zNear) / (zFar - zNear);
|
||||
Result[3][2] = - (static_cast<T>(2) * zFar * zNear) / (zFar - zNear);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -387,10 +371,8 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFov
|
||||
(
|
||||
T fov,
|
||||
T width,
|
||||
T height,
|
||||
T zNear,
|
||||
T zFar
|
||||
T width, T height,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
# ifdef GLM_LEFT_HANDED
|
||||
@ -404,10 +386,8 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovRH
|
||||
(
|
||||
T fov,
|
||||
T width,
|
||||
T height,
|
||||
T zNear,
|
||||
T zFar
|
||||
T width, T height,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
assert(width > static_cast<T>(0));
|
||||
@ -430,6 +410,7 @@ namespace glm
|
||||
Result[2][2] = - (zFar + zNear) / (zFar - zNear);
|
||||
Result[3][2] = - (static_cast<T>(2) * zFar * zNear) / (zFar - zNear);
|
||||
# endif
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
@ -437,10 +418,8 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovLH
|
||||
(
|
||||
T fov,
|
||||
T width,
|
||||
T height,
|
||||
T zNear,
|
||||
T zFar
|
||||
T width, T height,
|
||||
T zNear, T zFar
|
||||
)
|
||||
{
|
||||
assert(width > static_cast<T>(0));
|
||||
|
Loading…
Reference in New Issue
Block a user