matrix type Parameterize on dimensions #584

This commit is contained in:
Christophe Riccio
2016-12-30 16:00:25 +01:00
parent 1477d323d9
commit b92fdf5a59
84 changed files with 2198 additions and 2208 deletions

View File

@@ -33,300 +33,300 @@ namespace glm
/// High-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, highp> highp_imat2;
typedef mat<2, 2, int, highp> highp_imat2;
/// High-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, highp> highp_imat3;
typedef mat<3, 3, int, highp> highp_imat3;
/// High-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, highp> highp_imat4;
typedef mat<4, 4, int, highp> highp_imat4;
/// High-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, highp> highp_imat2x2;
typedef mat<2, 2, int, highp> highp_imat2x2;
/// High-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, highp> highp_imat2x3;
typedef mat<2, 3, int, highp> highp_imat2x3;
/// High-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, highp> highp_imat2x4;
typedef mat<2, 4, int, highp> highp_imat2x4;
/// High-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, highp> highp_imat3x2;
typedef mat<3, 2, int, highp> highp_imat3x2;
/// High-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, highp> highp_imat3x3;
typedef mat<3, 3, int, highp> highp_imat3x3;
/// High-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, highp> highp_imat3x4;
typedef mat<3, 4, int, highp> highp_imat3x4;
/// High-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, highp> highp_imat4x2;
typedef mat<4, 2, int, highp> highp_imat4x2;
/// High-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, highp> highp_imat4x3;
typedef mat<4, 3, int, highp> highp_imat4x3;
/// High-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, highp> highp_imat4x4;
typedef mat<4, 4, int, highp> highp_imat4x4;
/// Medium-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, mediump> mediump_imat2;
typedef mat<2, 2, int, mediump> mediump_imat2;
/// Medium-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, mediump> mediump_imat3;
typedef mat<3, 3, int, mediump> mediump_imat3;
/// Medium-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, mediump> mediump_imat4;
typedef mat<4, 4, int, mediump> mediump_imat4;
/// Medium-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, mediump> mediump_imat2x2;
typedef mat<2, 2, int, mediump> mediump_imat2x2;
/// Medium-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, mediump> mediump_imat2x3;
typedef mat<2, 3, int, mediump> mediump_imat2x3;
/// Medium-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, mediump> mediump_imat2x4;
typedef mat<2, 4, int, mediump> mediump_imat2x4;
/// Medium-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, mediump> mediump_imat3x2;
typedef mat<3, 2, int, mediump> mediump_imat3x2;
/// Medium-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, mediump> mediump_imat3x3;
typedef mat<3, 3, int, mediump> mediump_imat3x3;
/// Medium-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, mediump> mediump_imat3x4;
typedef mat<3, 4, int, mediump> mediump_imat3x4;
/// Medium-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, mediump> mediump_imat4x2;
typedef mat<4, 2, int, mediump> mediump_imat4x2;
/// Medium-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, mediump> mediump_imat4x3;
typedef mat<4, 3, int, mediump> mediump_imat4x3;
/// Medium-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, mediump> mediump_imat4x4;
typedef mat<4, 4, int, mediump> mediump_imat4x4;
/// Low-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, lowp> lowp_imat2;
typedef mat<2, 2, int, lowp> lowp_imat2;
/// Low-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, lowp> lowp_imat3;
typedef mat<3, 3, int, lowp> lowp_imat3;
/// Low-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, lowp> lowp_imat4;
typedef mat<4, 4, int, lowp> lowp_imat4;
/// Low-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, lowp> lowp_imat2x2;
typedef mat<2, 2, int, lowp> lowp_imat2x2;
/// Low-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, lowp> lowp_imat2x3;
typedef mat<2, 3, int, lowp> lowp_imat2x3;
/// Low-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, lowp> lowp_imat2x4;
typedef mat<2, 4, int, lowp> lowp_imat2x4;
/// Low-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, lowp> lowp_imat3x2;
typedef mat<3, 2, int, lowp> lowp_imat3x2;
/// Low-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, lowp> lowp_imat3x3;
typedef mat<3, 3, int, lowp> lowp_imat3x3;
/// Low-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, lowp> lowp_imat3x4;
typedef mat<3, 4, int, lowp> lowp_imat3x4;
/// Low-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, lowp> lowp_imat4x2;
typedef mat<4, 2, int, lowp> lowp_imat4x2;
/// Low-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, lowp> lowp_imat4x3;
typedef mat<4, 3, int, lowp> lowp_imat4x3;
/// Low-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, lowp> lowp_imat4x4;
typedef mat<4, 4, int, lowp> lowp_imat4x4;
/// High-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, highp> highp_umat2;
typedef mat<2, 2, uint, highp> highp_umat2;
/// High-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, highp> highp_umat3;
typedef mat<3, 3, uint, highp> highp_umat3;
/// High-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, highp> highp_umat4;
typedef mat<4, 4, uint, highp> highp_umat4;
/// High-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, highp> highp_umat2x2;
typedef mat<2, 2, uint, highp> highp_umat2x2;
/// High-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, highp> highp_umat2x3;
typedef mat<2, 3, uint, highp> highp_umat2x3;
/// High-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, highp> highp_umat2x4;
typedef mat<2, 4, uint, highp> highp_umat2x4;
/// High-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, highp> highp_umat3x2;
typedef mat<3, 2, uint, highp> highp_umat3x2;
/// High-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, highp> highp_umat3x3;
typedef mat<3, 3, uint, highp> highp_umat3x3;
/// High-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, highp> highp_umat3x4;
typedef mat<3, 4, uint, highp> highp_umat3x4;
/// High-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, highp> highp_umat4x2;
typedef mat<4, 2, uint, highp> highp_umat4x2;
/// High-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, highp> highp_umat4x3;
typedef mat<4, 3, uint, highp> highp_umat4x3;
/// High-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, highp> highp_umat4x4;
typedef mat<4, 4, uint, highp> highp_umat4x4;
/// Medium-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, mediump> mediump_umat2;
typedef mat<2, 2, uint, mediump> mediump_umat2;
/// Medium-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, mediump> mediump_umat3;
typedef mat<3, 3, uint, mediump> mediump_umat3;
/// Medium-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, mediump> mediump_umat4;
typedef mat<4, 4, uint, mediump> mediump_umat4;
/// Medium-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, mediump> mediump_umat2x2;
typedef mat<2, 2, uint, mediump> mediump_umat2x2;
/// Medium-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, mediump> mediump_umat2x3;
typedef mat<2, 3, uint, mediump> mediump_umat2x3;
/// Medium-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, mediump> mediump_umat2x4;
typedef mat<2, 4, uint, mediump> mediump_umat2x4;
/// Medium-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, mediump> mediump_umat3x2;
typedef mat<3, 2, uint, mediump> mediump_umat3x2;
/// Medium-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, mediump> mediump_umat3x3;
typedef mat<3, 3, uint, mediump> mediump_umat3x3;
/// Medium-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, mediump> mediump_umat3x4;
typedef mat<3, 4, uint, mediump> mediump_umat3x4;
/// Medium-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, mediump> mediump_umat4x2;
typedef mat<4, 2, uint, mediump> mediump_umat4x2;
/// Medium-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, mediump> mediump_umat4x3;
typedef mat<4, 3, uint, mediump> mediump_umat4x3;
/// Medium-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, mediump> mediump_umat4x4;
typedef mat<4, 4, uint, mediump> mediump_umat4x4;
/// Low-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, lowp> lowp_umat2;
typedef mat<2, 2, uint, lowp> lowp_umat2;
/// Low-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, lowp> lowp_umat3;
typedef mat<3, 3, uint, lowp> lowp_umat3;
/// Low-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, lowp> lowp_umat4;
typedef mat<4, 4, uint, lowp> lowp_umat4;
/// Low-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, lowp> lowp_umat2x2;
typedef mat<2, 2, uint, lowp> lowp_umat2x2;
/// Low-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, lowp> lowp_umat2x3;
typedef mat<2, 3, uint, lowp> lowp_umat2x3;
/// Low-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, lowp> lowp_umat2x4;
typedef mat<2, 4, uint, lowp> lowp_umat2x4;
/// Low-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, lowp> lowp_umat3x2;
typedef mat<3, 2, uint, lowp> lowp_umat3x2;
/// Low-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, lowp> lowp_umat3x3;
typedef mat<3, 3, uint, lowp> lowp_umat3x3;
/// Low-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, lowp> lowp_umat3x4;
typedef mat<3, 4, uint, lowp> lowp_umat3x4;
/// Low-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, lowp> lowp_umat4x2;
typedef mat<4, 2, uint, lowp> lowp_umat4x2;
/// Low-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, lowp> lowp_umat4x3;
typedef mat<4, 3, uint, lowp> lowp_umat4x3;
/// Low-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, lowp> lowp_umat4x4;
typedef mat<4, 4, uint, lowp> lowp_umat4x4;
#if(defined(GLM_PRECISION_HIGHP_INT))
typedef highp_imat2 imat2;

View File

@@ -4,22 +4,22 @@
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const & m)
{
tmat2x2<T, P> const Inv(inverse(tmat2x2<T, P>(m)));
mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m)));
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
vec<3, T, P>(Inv[0], static_cast<T>(0)),
vec<3, T, P>(Inv[1], static_cast<T>(0)),
vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast<T>(1)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse(tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const & m)
{
tmat3x3<T, P> const Inv(inverse(tmat3x3<T, P>(m)));
mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m)));
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
vec<4, T, P>(Inv[0], static_cast<T>(0)),
vec<4, T, P>(Inv[1], static_cast<T>(0)),
vec<4, T, P>(Inv[2], static_cast<T>(0)),
@@ -27,11 +27,11 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose(tmat2x2<T, P> const & m)
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const & m)
{
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
tmat2x2<T, P> Inverse(
mat<2, 2, T, P> Inverse(
+ m[1][1] / Determinant,
- m[0][1] / Determinant,
- m[1][0] / Determinant,
@@ -41,14 +41,14 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const & m)
{
T Determinant =
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
- m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0])
+ m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);
tmat3x3<T, P> Inverse(uninitialize);
mat<3, 3, T, P> Inverse(uninitialize);
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);
Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);
Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);
@@ -64,7 +64,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose(tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const & m)
{
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
@@ -86,7 +86,7 @@ namespace glm
T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
tmat4x4<T, P> Inverse(uninitialize);
mat<4, 4, T, P> Inverse(uninitialize);
Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02);
Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04);
Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05);

View File

@@ -52,11 +52,11 @@ namespace glm
/// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
/// @endcode
/// @see gtc_matrix_transform
/// @see - translate(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - translate(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - translate(vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> translate(
tmat4x4<T, P> const & m,
GLM_FUNC_DECL mat<4, 4, T, P> translate(
mat<4, 4, T, P> const& m,
vec<3, T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
@@ -66,11 +66,11 @@ namespace glm
/// @param axis Rotation axis, recommended to be normalized.
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
/// @see gtc_matrix_transform
/// @see - rotate(tmat4x4<T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(mat<4, 4, T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> rotate(
tmat4x4<T, P> const & m,
GLM_FUNC_DECL mat<4, 4, T, P> rotate(
mat<4, 4, T, P> const& m,
T angle,
vec<3, T, P> const & axis);
@@ -80,11 +80,11 @@ namespace glm
/// @param v Ratio of scaling for each axis.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
/// @see gtc_matrix_transform
/// @see - scale(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - scale(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - scale(vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> scale(
tmat4x4<T, P> const & m,
GLM_FUNC_DECL mat<4, 4, T, P> scale(
mat<4, 4, T, P> const& m,
vec<3, T, P> const & v);
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
@@ -99,7 +99,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left,
T right,
T bottom,
@@ -119,7 +119,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> orthoLH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH(
T left,
T right,
T bottom,
@@ -139,7 +139,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> orthoRH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH(
T left,
T right,
T bottom,
@@ -157,7 +157,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left,
T right,
T bottom,
@@ -174,7 +174,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustum(
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum(
T left,
T right,
T bottom,
@@ -193,7 +193,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustumLH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH(
T left,
T right,
T bottom,
@@ -212,7 +212,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustumRH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH(
T left,
T right,
T bottom,
@@ -229,7 +229,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspective(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective(
T fovy,
T aspect,
T near,
@@ -244,7 +244,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveRH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH(
T fovy,
T aspect,
T near,
@@ -259,7 +259,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveLH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH(
T fovy,
T aspect,
T near,
@@ -275,7 +275,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFov(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov(
T fov,
T width,
T height,
@@ -292,7 +292,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFovRH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH(
T fov,
T width,
T height,
@@ -309,7 +309,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFovLH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH(
T fov,
T width,
T height,
@@ -324,7 +324,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspective(
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective(
T fovy, T aspect, T near);
/// Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite.
@@ -335,7 +335,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspectiveLH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH(
T fovy, T aspect, T near);
/// Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite.
@@ -346,7 +346,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspectiveRH(
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH(
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
@@ -357,7 +357,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
@@ -369,7 +369,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near, T ep);
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
@@ -385,8 +385,8 @@ namespace glm
template <typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> project(
vec<3, T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport);
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
@@ -402,8 +402,8 @@ namespace glm
template <typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> unProject(
vec<3, T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport);
/// Define a picking region
@@ -415,7 +415,7 @@ namespace glm
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, precision P, typename U>
GLM_FUNC_DECL tmat4x4<T, P> pickMatrix(
GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix(
vec<2, T, P> const & center,
vec<2, T, P> const & delta,
vec<4, U, P> const & viewport);
@@ -428,7 +428,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAt(
GLM_FUNC_DECL mat<4, 4, T, P> lookAt(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
@@ -441,7 +441,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtRH(
GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
@@ -454,7 +454,7 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtLH(
GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);

View File

@@ -8,15 +8,15 @@
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> translate(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(m);
mat<4, 4, T, P> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate(tmat4x4<T, P> const & m, T angle, vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
@@ -25,7 +25,7 @@ namespace glm
vec<3, T, P> axis(normalize(v));
vec<3, T, P> temp((T(1) - c) * axis);
tmat4x4<T, P> Rotate(uninitialize);
mat<4, 4, T, P> Rotate(uninitialize);
Rotate[0][0] = c + temp[0] * axis[0];
Rotate[0][1] = temp[0] * axis[1] + s * axis[2];
Rotate[0][2] = temp[0] * axis[2] - s * axis[1];
@@ -38,7 +38,7 @@ namespace glm
Rotate[2][1] = temp[2] * axis[1] - s * axis[0];
Rotate[2][2] = c + temp[2] * axis[2];
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];
Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2];
Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2];
@@ -47,12 +47,12 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate_slow(tmat4x4<T, P> const & m, T angle, vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tmat4x4<T, P> Result;
mat<4, 4, T, P> Result;
vec<3, T, P> axis = normalize(v);
@@ -76,9 +76,9 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1];
Result[2] = m[2] * v[2];
@@ -87,9 +87,9 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale_slow(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(T(1));
mat<4, 4, T, P> Result(T(1));
Result[0][0] = v.x;
Result[1][1] = v.y;
Result[2][2] = v.z;
@@ -97,7 +97,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
(
T left, T right,
T bottom, T top,
@@ -112,14 +112,14 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoLH
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH
(
T left, T right,
T bottom, T top,
T zNear, T zFar
)
{
tmat4x4<T, defaultp> Result(1);
mat<4, 4, T, defaultp> Result(1);
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[3][0] = - (right + left) / (right - left);
@@ -137,14 +137,14 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoRH
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH
(
T left, T right,
T bottom, T top,
T zNear, T zFar
)
{
tmat4x4<T, defaultp> Result(1);
mat<4, 4, T, defaultp> Result(1);
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[3][0] = - (right + left) / (right - left);
@@ -162,13 +162,13 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
(
T left, T right,
T bottom, T top
)
{
tmat4x4<T, defaultp> Result(static_cast<T>(1));
mat<4, 4, T, defaultp> Result(static_cast<T>(1));
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[2][2] = - static_cast<T>(1);
@@ -178,7 +178,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustum
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum
(
T left, T right,
T bottom, T top,
@@ -193,14 +193,14 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumLH
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH
(
T left, T right,
T bottom, T top,
T nearVal, T farVal
)
{
tmat4x4<T, defaultp> Result(0);
mat<4, 4, T, defaultp> Result(0);
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
Result[2][0] = (right + left) / (right - left);
@@ -219,14 +219,14 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumRH
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH
(
T left, T right,
T bottom, T top,
T nearVal, T farVal
)
{
tmat4x4<T, defaultp> Result(0);
mat<4, 4, T, defaultp> Result(0);
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
Result[2][0] = (right + left) / (right - left);
@@ -245,7 +245,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return perspectiveLH(fovy, aspect, zNear, zFar);
@@ -255,13 +255,13 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar)
{
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
Result[2][3] = - static_cast<T>(1);
@@ -278,13 +278,13 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar)
{
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
Result[2][3] = static_cast<T>(1);
@@ -301,7 +301,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return perspectiveFovLH(fov, width, height, zNear, zFar);
@@ -311,7 +311,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar)
{
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
@@ -321,7 +321,7 @@ namespace glm
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = w;
Result[1][1] = h;
Result[2][3] = - static_cast<T>(1);
@@ -338,7 +338,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar)
{
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
@@ -348,7 +348,7 @@ namespace glm
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = w;
Result[1][1] = h;
Result[2][3] = static_cast<T>(1);
@@ -365,7 +365,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return infinitePerspectiveLH(fovy, aspect, zNear);
@@ -375,7 +375,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -383,7 +383,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = - static_cast<T>(1);
@@ -393,7 +393,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -401,7 +401,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(T(0));
mat<4, 4, T, defaultp> Result(T(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = static_cast<T>(1);
@@ -412,7 +412,7 @@ namespace glm
// Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -420,7 +420,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = ep - static_cast<T>(1);
@@ -430,7 +430,7 @@ namespace glm
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear)
{
return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>());
}
@@ -439,8 +439,8 @@ namespace glm
GLM_FUNC_QUALIFIER vec<3, T, P> project
(
vec<3, T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport
)
{
@@ -465,12 +465,12 @@ namespace glm
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
(
vec<3, T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport
)
{
tmat4x4<T, P> Inverse = inverse(proj * model);
mat<4, 4, T, P> Inverse = inverse(proj * model);
vec<4, T, P> tmp = vec<4, T, P>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
@@ -489,10 +489,10 @@ namespace glm
}
template <typename T, precision P, typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
{
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
tmat4x4<T, P> Result(static_cast<T>(1));
mat<4, 4, T, P> Result(static_cast<T>(1));
if(!(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0)))
return Result; // Error
@@ -508,7 +508,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return lookAtLH(eye, center, up);
@@ -518,7 +518,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtRH
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
@@ -529,7 +529,7 @@ namespace glm
vec<3, T, P> const s(normalize(cross(f, up)));
vec<3, T, P> const u(cross(s, f));
tmat4x4<T, P> Result(1);
mat<4, 4, T, P> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;
@@ -546,7 +546,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtLH
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
@@ -557,7 +557,7 @@ namespace glm
vec<3, T, P> const s(normalize(cross(up, f)));
vec<3, T, P> const u(cross(f, s));
tmat4x4<T, P> Result(1);
mat<4, 4, T, P> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;

View File

@@ -95,8 +95,8 @@ namespace glm
/// Explicit conversion operators
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
GLM_FUNC_DECL explicit operator mat<3, 3, T, P>();
GLM_FUNC_DECL explicit operator mat<4, 4, T, P>();
# endif
/// Create a quaternion from two normalized axis
@@ -109,8 +109,8 @@ namespace glm
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat4x4<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, P> const & m);
// -- Unary arithmetic operators --
@@ -279,25 +279,25 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> mat3_cast(tquat<T, P> const & x);
GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat<T, P> const & x);
/// Converts a quaternion to a 4 * 4 matrix.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> mat4_cast(tquat<T, P> const & x);
GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat<T, P> const & x);
/// Converts a 3 * 3 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat3x3<T, P> const & x);
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<3, 3, T, P> const & x);
/// Converts a 4 * 4 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat4x4<T, P> const & x);
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<4, 4, T, P> const & x);
/// Returns the quaternion rotation angle.
///

View File

@@ -173,26 +173,26 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<3, 3, T, P> const & m)
{
*this = quat_cast(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<4, 4, T, P> const & m)
{
*this = quat_cast(m);
}
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat3x3<T, P>()
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<3, 3, T, P>()
{
return mat3_cast(*this);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat4x4<T, P>()
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<4, 4, T, P>()
{
return mat4_cast(*this);
}
@@ -584,9 +584,9 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> mat3_cast(tquat<T, P> const & q)
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const & q)
{
tmat3x3<T, P> Result(T(1));
mat<3, 3, T, P> Result(T(1));
T qxx(q.x * q.x);
T qyy(q.y * q.y);
T qzz(q.z * q.z);
@@ -612,13 +612,13 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> mat4_cast(tquat<T, P> const & q)
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const & q)
{
return tmat4x4<T, P>(mat3_cast(q));
return mat<4, 4, T, P>(mat3_cast(q));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const & m)
{
T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
@@ -682,9 +682,9 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(tmat4x4<T, P> const & m4)
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const & m4)
{
return quat_cast(tmat3x3<T, P>(m4));
return quat_cast(mat<3, 3, T, P>(m4));
}
template <typename T, precision P>

View File

@@ -675,15 +675,15 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> fmat2;
typedef mat<2, 2, f32, defaultp> fmat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> fmat3;
typedef mat<3, 3, f32, defaultp> fmat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> fmat4;
typedef mat<4, 4, f32, defaultp> fmat4;
/// Single-precision floating-point 1x1 matrix.
@@ -692,39 +692,39 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> fmat2x2;
typedef mat<2, 2, f32, defaultp> fmat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, defaultp> fmat2x3;
typedef mat<2, 3, f32, defaultp> fmat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, defaultp> fmat2x4;
typedef mat<2, 4, f32, defaultp> fmat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, defaultp> fmat3x2;
typedef mat<3, 2, f32, defaultp> fmat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> fmat3x3;
typedef mat<3, 3, f32, defaultp> fmat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, defaultp> fmat3x4;
typedef mat<3, 4, f32, defaultp> fmat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, defaultp> fmat4x2;
typedef mat<4, 2, f32, defaultp> fmat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, defaultp> fmat4x3;
typedef mat<4, 3, f32, defaultp> fmat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> fmat4x4;
typedef mat<4, 4, f32, defaultp> fmat4x4;
/// Single-precision floating-point 1x1 matrix.
@@ -733,15 +733,15 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> f32mat2;
typedef mat<2, 2, f32, defaultp> f32mat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> f32mat3;
typedef mat<3, 3, f32, defaultp> f32mat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> f32mat4;
typedef mat<4, 4, f32, defaultp> f32mat4;
/// Single-precision floating-point 1x1 matrix.
@@ -750,39 +750,39 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> f32mat2x2;
typedef mat<2, 2, f32, defaultp> f32mat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, defaultp> f32mat2x3;
typedef mat<2, 3, f32, defaultp> f32mat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, defaultp> f32mat2x4;
typedef mat<2, 4, f32, defaultp> f32mat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, defaultp> f32mat3x2;
typedef mat<3, 2, f32, defaultp> f32mat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> f32mat3x3;
typedef mat<3, 3, f32, defaultp> f32mat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, defaultp> f32mat3x4;
typedef mat<3, 4, f32, defaultp> f32mat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, defaultp> f32mat4x2;
typedef mat<4, 2, f32, defaultp> f32mat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, defaultp> f32mat4x3;
typedef mat<4, 3, f32, defaultp> f32mat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> f32mat4x4;
typedef mat<4, 4, f32, defaultp> f32mat4x4;
/// Double-precision floating-point 1x1 matrix.
@@ -791,15 +791,15 @@ namespace glm
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, defaultp> f64mat2;
typedef mat<2, 2, f64, defaultp> f64mat2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, defaultp> f64mat3;
typedef mat<3, 3, f64, defaultp> f64mat3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, defaultp> f64mat4;
typedef mat<4, 4, f64, defaultp> f64mat4;
/// Double-precision floating-point 1x1 matrix.
@@ -808,39 +808,39 @@ namespace glm
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, defaultp> f64mat2x2;
typedef mat<2, 2, f64, defaultp> f64mat2x2;
/// Double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f64, defaultp> f64mat2x3;
typedef mat<2, 3, f64, defaultp> f64mat2x3;
/// Double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f64, defaultp> f64mat2x4;
typedef mat<2, 4, f64, defaultp> f64mat2x4;
/// Double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f64, defaultp> f64mat3x2;
typedef mat<3, 2, f64, defaultp> f64mat3x2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, defaultp> f64mat3x3;
typedef mat<3, 3, f64, defaultp> f64mat3x3;
/// Double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f64, defaultp> f64mat3x4;
typedef mat<3, 4, f64, defaultp> f64mat3x4;
/// Double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f64, defaultp> f64mat4x2;
typedef mat<4, 2, f64, defaultp> f64mat4x2;
/// Double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f64, defaultp> f64mat4x3;
typedef mat<4, 3, f64, defaultp> f64mat4x3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, defaultp> f64mat4x4;
typedef mat<4, 4, f64, defaultp> f64mat4x4;
//////////////////////////

View File

@@ -80,62 +80,62 @@ namespace glm
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2x2(T const * const ptr);
GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x3<T, defaultp> make_mat2x3(T const * const ptr);
GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x4<T, defaultp> make_mat2x4(T const * const ptr);
GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x2<T, defaultp> make_mat3x2(T const * const ptr);
GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3x3(T const * const ptr);
GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x4<T, defaultp> make_mat3x4(T const * const ptr);
GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x2<T, defaultp> make_mat4x2(T const * const ptr);
GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x3<T, defaultp> make_mat4x3(T const * const ptr);
GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4x4(T const * const ptr);
GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2(T const * const ptr);
GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3(T const * const ptr);
GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4(T const * const ptr);
GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr);
/// Build a quaternion from a pointer.
/// @see gtc_type_ptr

View File

@@ -79,7 +79,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x2<T, P> const & mat
mat<2, 2, T, P> const& mat
)
{
return &(mat[0].x);
@@ -90,7 +90,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x2<T, P> & mat
mat<2, 2, T, P> & mat
)
{
return &(mat[0].x);
@@ -101,7 +101,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x3<T, P> const & mat
mat<3, 3, T, P> const& mat
)
{
return &(mat[0].x);
@@ -112,7 +112,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x3<T, P> & mat
mat<3, 3, T, P> & mat
)
{
return &(mat[0].x);
@@ -123,7 +123,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x4<T, P> const & mat
mat<4, 4, T, P> const& mat
)
{
return &(mat[0].x);
@@ -134,7 +134,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat4x4<T, P> & mat
mat<4, 4, T, P> & mat
)
{
return &(mat[0].x);
@@ -145,7 +145,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x3<T, P> const & mat
mat<2, 3, T, P> const& mat
)
{
return &(mat[0].x);
@@ -156,7 +156,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x3<T, P> & mat
mat<2, 3, T, P> & mat
)
{
return &(mat[0].x);
@@ -167,7 +167,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x2<T, P> const & mat
mat<3, 2, T, P> const& mat
)
{
return &(mat[0].x);
@@ -178,7 +178,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x2<T, P> & mat
mat<3, 2, T, P> & mat
)
{
return &(mat[0].x);
@@ -189,7 +189,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x4<T, P> const & mat
mat<2, 4, T, P> const& mat
)
{
return &(mat[0].x);
@@ -200,7 +200,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x4<T, P> & mat
mat<2, 4, T, P> & mat
)
{
return &(mat[0].x);
@@ -211,7 +211,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x2<T, P> const & mat
mat<4, 2, T, P> const& mat
)
{
return &(mat[0].x);
@@ -222,7 +222,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat4x2<T, P> & mat
mat<4, 2, T, P> & mat
)
{
return &(mat[0].x);
@@ -233,7 +233,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x4<T, P> const & mat
mat<3, 4, T, P> const& mat
)
{
return &(mat[0].x);
@@ -244,7 +244,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x4<T, P> & mat
mat<3, 4, T, P> & mat
)
{
return &(mat[0].x);
@@ -255,7 +255,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x3<T, P> const & mat
mat<4, 3, T, P> const& mat
)
{
return &(mat[0].x);
@@ -264,7 +264,7 @@ namespace glm
/// Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr(tmat4x3<T, P> & mat)
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P> & mat)
{
return &(mat[0].x);
}
@@ -324,97 +324,97 @@ namespace glm
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2x2(T const * const ptr)
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr)
{
tmat2x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x2<T, defaultp>));
mat<2, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x3<T, defaultp> make_mat2x3(T const * const ptr)
GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr)
{
tmat2x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x3<T, defaultp>));
mat<2, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x4<T, defaultp> make_mat2x4(T const * const ptr)
GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr)
{
tmat2x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x4<T, defaultp>));
mat<2, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x2<T, defaultp> make_mat3x2(T const * const ptr)
GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr)
{
tmat3x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x2<T, defaultp>));
mat<3, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3x3(T const * const ptr)
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr)
{
tmat3x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x3<T, defaultp>));
mat<3, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x4<T, defaultp> make_mat3x4(T const * const ptr)
GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr)
{
tmat3x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x4<T, defaultp>));
mat<3, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x2<T, defaultp> make_mat4x2(T const * const ptr)
GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr)
{
tmat4x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x2<T, defaultp>));
mat<4, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x3<T, defaultp> make_mat4x3(T const * const ptr)
GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr)
{
tmat4x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x3<T, defaultp>));
mat<4, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4x4(T const * const ptr)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr)
{
tmat4x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x4<T, defaultp>));
mat<4, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2(T const * const ptr)
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const * const ptr)
{
return make_mat2x2(ptr);
}
@@ -422,7 +422,7 @@ namespace glm
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3(T const * const ptr)
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const * const ptr)
{
return make_mat3x3(ptr);
}
@@ -430,7 +430,7 @@ namespace glm
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4(T const * const ptr)
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const * const ptr)
{
return make_mat4x4(ptr);
}