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