More consistent coding style
This commit is contained in:
@@ -40,7 +40,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<typename T, qualifier P, template<typename, qualifier> class vecIUType>
|
||||
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
|
||||
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const& v);
|
||||
|
||||
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
|
||||
///
|
||||
@@ -52,7 +52,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const & In, int Shift);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const& In, int Shift);
|
||||
|
||||
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
|
||||
///
|
||||
@@ -64,7 +64,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const & In, int Shift);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const& In, int Shift);
|
||||
|
||||
/// Set to 1 a range of bits.
|
||||
///
|
||||
@@ -76,7 +76,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const & Value, int FirstBit, int BitCount);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const& Value, int FirstBit, int BitCount);
|
||||
|
||||
/// Set to 0 a range of bits.
|
||||
///
|
||||
@@ -88,7 +88,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, T, P> const & Value, int FirstBit, int BitCount);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, T, P> const& Value, int FirstBit, int BitCount);
|
||||
|
||||
/// Interleaves the bits of x and y.
|
||||
/// The first bit is the first bit of x followed by the first bit of y.
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const & In, int Shift)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const& In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
|
||||
|
||||
@@ -33,22 +33,22 @@ namespace glm
|
||||
/// Convert a linear color to sRGB color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const & ColorLinear);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear);
|
||||
|
||||
/// Convert a linear color to sRGB color using a custom gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const & ColorLinear, T Gamma);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear, T Gamma);
|
||||
|
||||
/// Convert a sRGB color to linear color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const & ColorSRGB);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB);
|
||||
|
||||
/// Convert a sRGB color to linear color using a custom gamma correction.
|
||||
// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const & ColorSRGB, T Gamma);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB, T Gamma);
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
|
||||
@@ -31,28 +31,28 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const & epsilon);
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon);
|
||||
|
||||
/// Returns the component-wise comparison of |x - y| < epsilon.
|
||||
/// True if this expression is satisfied.
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL bool epsilonEqual(genType const & x, genType const & y, genType const & epsilon);
|
||||
GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon);
|
||||
|
||||
/// Returns the component-wise comparison of |x - y| < epsilon.
|
||||
/// True if this expression is not satisfied.
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const & epsilon);
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon);
|
||||
|
||||
/// Returns the component-wise comparison of |x - y| >= epsilon.
|
||||
/// True if this expression is not satisfied.
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL bool epsilonNotEqual(genType const & x, genType const & y, genType const & epsilon);
|
||||
GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace glm
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
float const & x,
|
||||
float const & y,
|
||||
float const & epsilon
|
||||
float const& x,
|
||||
float const& y,
|
||||
float const& epsilon
|
||||
)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
@@ -25,9 +25,9 @@ namespace glm
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
double const & x,
|
||||
double const & y,
|
||||
double const & epsilon
|
||||
double const& x,
|
||||
double const& y,
|
||||
double const& epsilon
|
||||
)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
@@ -46,7 +46,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const & y, float const& epsilon)
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon)
|
||||
{
|
||||
return abs(x - y) >= epsilon;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat<T, P> const& x, tquat<T, P> const & y, T const& epsilon)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat<T, P> const& x, tquat<T, P> const& y, T const& epsilon)
|
||||
{
|
||||
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
|
||||
return lessThan(abs(v), vec<4, T, P>(epsilon));
|
||||
|
||||
@@ -27,31 +27,31 @@ namespace glm
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::row_type row(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index);
|
||||
|
||||
/// Set a specific row to a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType row(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::row_type const & x);
|
||||
typename genType::row_type const& x);
|
||||
|
||||
/// Get a specific column of a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::col_type column(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index);
|
||||
|
||||
/// Set a specific column to a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType column(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::col_type const & x);
|
||||
typename genType::col_type const& x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@@ -6,9 +6,9 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType row
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::row_type const & x
|
||||
typename genType::row_type const& x
|
||||
)
|
||||
{
|
||||
assert(index >= 0 && index < m[0].length());
|
||||
@@ -22,7 +22,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER typename genType::row_type row
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index
|
||||
)
|
||||
{
|
||||
@@ -37,9 +37,9 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType column
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::col_type const & x
|
||||
typename genType::col_type const& x
|
||||
)
|
||||
{
|
||||
assert(index >= 0 && index < m.length());
|
||||
@@ -52,7 +52,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER typename genType::col_type column
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index
|
||||
)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace glm
|
||||
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
|
||||
/// @see gtc_matrix_inverse
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType affineInverse(genType const & m);
|
||||
GLM_FUNC_DECL genType affineInverse(genType const& m);
|
||||
|
||||
/// Compute the inverse transpose of a matrix.
|
||||
///
|
||||
@@ -41,7 +41,7 @@ namespace glm
|
||||
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
|
||||
/// @see gtc_matrix_inverse
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType inverseTranspose(genType const & m);
|
||||
GLM_FUNC_DECL genType inverseTranspose(genType const& m);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace glm
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m)));
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m)));
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, 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];
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, 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])
|
||||
@@ -64,7 +64,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, 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];
|
||||
|
||||
@@ -52,12 +52,12 @@ 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(mat<4, 4, T, P> const & m, T x, T y, T z)
|
||||
/// @see - translate(vec<3, T, P> const & v)
|
||||
/// @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, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> translate(
|
||||
mat<4, 4, T, P> const& m,
|
||||
vec<3, T, P> const & v);
|
||||
vec<3, T, P> const& v);
|
||||
|
||||
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
|
||||
///
|
||||
@@ -66,13 +66,13 @@ 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(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)
|
||||
/// @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, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> rotate(
|
||||
mat<4, 4, T, P> const& m,
|
||||
T angle,
|
||||
vec<3, T, P> const & axis);
|
||||
vec<3, T, P> const& axis);
|
||||
|
||||
/// Builds a scale 4 * 4 matrix created from 3 scalars.
|
||||
///
|
||||
@@ -80,12 +80,12 @@ 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(mat<4, 4, T, P> const & m, T x, T y, T z)
|
||||
/// @see - scale(vec<3, T, P> const & v)
|
||||
/// @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, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> scale(
|
||||
mat<4, 4, T, P> const& m,
|
||||
vec<3, T, P> const & v);
|
||||
vec<3, T, P> const& v);
|
||||
|
||||
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
|
||||
///
|
||||
@@ -97,7 +97,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
|
||||
T left,
|
||||
@@ -117,7 +117,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH(
|
||||
T left,
|
||||
@@ -137,7 +137,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH(
|
||||
T left,
|
||||
@@ -155,7 +155,7 @@ namespace glm
|
||||
/// @param top
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @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)
|
||||
/// @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 mat<4, 4, T, defaultp> ortho(
|
||||
T left,
|
||||
@@ -384,10 +384,10 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> project(
|
||||
vec<3, T, P> const & obj,
|
||||
vec<3, T, P> const& obj,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport);
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
|
||||
///
|
||||
@@ -401,10 +401,10 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> unProject(
|
||||
vec<3, T, P> const & win,
|
||||
vec<3, T, P> const& win,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport);
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Define a picking region
|
||||
///
|
||||
@@ -416,9 +416,9 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, qualifier P, typename U>
|
||||
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);
|
||||
vec<2, T, P> const& center,
|
||||
vec<2, T, P> const& delta,
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Build a look at view matrix based on the default handedness.
|
||||
///
|
||||
@@ -426,12 +426,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @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)
|
||||
/// @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, qualifier P>
|
||||
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);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// Build a right handed look at view matrix.
|
||||
///
|
||||
@@ -439,12 +439,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @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)
|
||||
/// @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, qualifier P>
|
||||
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);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// Build a left handed look at view matrix.
|
||||
///
|
||||
@@ -452,12 +452,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @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)
|
||||
/// @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, qualifier P>
|
||||
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);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
namespace glm
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, 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)
|
||||
{
|
||||
mat<4, 4, T, P> Result(m);
|
||||
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
|
||||
@@ -16,7 +16,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, 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);
|
||||
@@ -47,7 +47,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
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)
|
||||
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);
|
||||
@@ -76,7 +76,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, 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)
|
||||
{
|
||||
mat<4, 4, T, P> Result;
|
||||
Result[0] = m[0] * v[0];
|
||||
@@ -87,7 +87,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, 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)
|
||||
{
|
||||
mat<4, 4, T, P> Result(T(1));
|
||||
Result[0][0] = v.x;
|
||||
@@ -438,10 +438,10 @@ namespace glm
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> project
|
||||
(
|
||||
vec<3, T, P> const & obj,
|
||||
vec<3, T, P> const& obj,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport
|
||||
vec<4, U, P> const& viewport
|
||||
)
|
||||
{
|
||||
vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast<T>(1));
|
||||
@@ -464,10 +464,10 @@ namespace glm
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
|
||||
(
|
||||
vec<3, T, P> const & win,
|
||||
vec<3, T, P> const& win,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport
|
||||
vec<4, U, P> const& viewport
|
||||
)
|
||||
{
|
||||
mat<4, 4, T, P> Inverse = inverse(proj * model);
|
||||
@@ -489,7 +489,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P, typename U>
|
||||
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)
|
||||
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));
|
||||
mat<4, 4, T, P> Result(static_cast<T>(1));
|
||||
@@ -508,7 +508,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
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)
|
||||
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);
|
||||
@@ -520,9 +520,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
|
||||
(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up
|
||||
)
|
||||
{
|
||||
vec<3, T, P> const f(normalize(center - eye));
|
||||
@@ -548,9 +548,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
|
||||
(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up
|
||||
)
|
||||
{
|
||||
vec<3, T, P> const f(normalize(center - eye));
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace glm{
|
||||
namespace gtc
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const & j, vec<4, T, P> const & ip)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const& j, vec<4, T, P> const& ip)
|
||||
{
|
||||
vec<3, T, P> pXYZ = floor(fract(vec<3, T, P>(j) * vec<3, T, P>(ip)) * T(7)) * ip[2] - T(1);
|
||||
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), vec<3, T, P>(1));
|
||||
@@ -22,7 +22,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position)
|
||||
{
|
||||
vec<4, T, P> Pi = glm::floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
vec<4, T, P> Pf = glm::fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
@@ -63,7 +63,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position)
|
||||
{
|
||||
vec<3, T, P> Pi0 = floor(Position); // Integer part for indexing
|
||||
vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@@ -134,7 +134,7 @@ namespace gtc
|
||||
/*
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & P)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& P)
|
||||
{
|
||||
vec<3, T, P> Pi0 = floor(P); // Integer part for indexing
|
||||
vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@@ -207,7 +207,7 @@ namespace gtc
|
||||
*/
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position)
|
||||
{
|
||||
vec<4, T, P> Pi0 = floor(Position); // Integer part for indexing
|
||||
vec<4, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@@ -343,7 +343,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic variant
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position, vec<2, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position, vec<2, T, P> const& rep)
|
||||
{
|
||||
vec<4, T, P> Pi = floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
vec<4, T, P> Pf = fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
@@ -385,7 +385,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic variant
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position, vec<3, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position, vec<3, T, P> const& rep)
|
||||
{
|
||||
vec<3, T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period
|
||||
vec<3, T, P> Pi1 = mod(Pi0 + vec<3, T, P>(T(1)), rep); // Integer part + 1, mod period
|
||||
@@ -456,7 +456,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic version
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position, vec<4, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position, vec<4, T, P> const& rep)
|
||||
{
|
||||
vec<4, T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep
|
||||
vec<4, T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep
|
||||
@@ -589,7 +589,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> const C = vec<4, T, P>(
|
||||
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
|
||||
@@ -646,7 +646,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const& v)
|
||||
{
|
||||
vec<2, T, P> const C(1.0 / 6.0, 1.0 / 3.0);
|
||||
vec<4, T, P> const D(0.0, 0.5, 1.0, 2.0);
|
||||
@@ -721,7 +721,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> const C(
|
||||
0.138196601125011, // (5 - sqrt(5))/20 G4
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace glm
|
||||
/// packUnorm1x8: round(clamp(c, 0, +1) * 255.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm2x8(vec2 const & v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const & v)
|
||||
/// @see uint16 packUnorm2x8(vec2 const& v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint8 packUnorm1x8(float v);
|
||||
@@ -60,11 +60,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm1x8(float const & v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const & v)
|
||||
/// @see uint8 packUnorm1x8(float const& v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v);
|
||||
|
||||
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
|
||||
@@ -89,8 +89,8 @@ namespace glm
|
||||
/// packSnorm1x8: round(clamp(s, -1, +1) * 127.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm2x8(vec2 const & v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const & v)
|
||||
/// @see uint16 packSnorm2x8(vec2 const& v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint8 packSnorm1x8(float s);
|
||||
@@ -118,11 +118,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packSnorm1x8(float const & v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const & v)
|
||||
/// @see uint8 packSnorm1x8(float const& v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const & v);
|
||||
GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v);
|
||||
|
||||
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
|
||||
@@ -147,8 +147,8 @@ namespace glm
|
||||
/// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm1x16(float const & v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const & v)
|
||||
/// @see uint16 packSnorm1x16(float const& v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packUnorm1x16(float v);
|
||||
@@ -176,11 +176,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm1x16(float const & v)
|
||||
/// @see uint32 packUnorm2x16(vec2 const & v)
|
||||
/// @see uint16 packUnorm1x16(float const& v)
|
||||
/// @see uint32 packUnorm2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@@ -205,8 +205,8 @@ namespace glm
|
||||
/// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm2x16(vec2 const & v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const & v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const& v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packSnorm1x16(float v);
|
||||
@@ -234,11 +234,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm1x16(float const & v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const & v)
|
||||
/// @see uint16 packSnorm1x16(float const& v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@@ -261,8 +261,8 @@ namespace glm
|
||||
/// and then packing this 16-bit value into a 16-bit unsigned integer.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packHalf2x16(vec2 const & v)
|
||||
/// @see uint64 packHalf4x16(vec4 const & v)
|
||||
/// @see uint32 packHalf2x16(vec2 const& v)
|
||||
/// @see uint64 packHalf4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packHalf1x16(float v);
|
||||
@@ -272,8 +272,8 @@ namespace glm
|
||||
/// and converting it to 32-bit floating-point values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec2 unpackHalf2x16(uint32 const & v)
|
||||
/// @see vec4 unpackHalf4x16(uint64 const & v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const& v)
|
||||
/// @see vec4 unpackHalf4x16(uint64 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL float unpackHalf1x16(uint16 v);
|
||||
@@ -285,11 +285,11 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packHalf1x16(float const & v)
|
||||
/// @see uint32 packHalf2x16(vec2 const & v)
|
||||
/// @see uint16 packHalf1x16(float const& v)
|
||||
/// @see uint32 packHalf2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v);
|
||||
|
||||
/// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values,
|
||||
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
|
||||
@@ -298,8 +298,8 @@ namespace glm
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see float unpackHalf1x16(uint16 const & v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const & v)
|
||||
/// @see float unpackHalf1x16(uint16 const& v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p);
|
||||
@@ -311,11 +311,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packI3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see ivec4 unpackI3x10_1x2(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v);
|
||||
/// @see uint32 packI3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see ivec4 unpackI3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v);
|
||||
|
||||
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
|
||||
///
|
||||
@@ -323,9 +323,9 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p);
|
||||
GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p);
|
||||
|
||||
/// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector
|
||||
@@ -335,11 +335,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see ivec4 unpackU3x10_1x2(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v);
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see ivec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v);
|
||||
|
||||
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
|
||||
///
|
||||
@@ -347,9 +347,9 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p);
|
||||
GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values.
|
||||
@@ -364,11 +364,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const & v);
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@@ -381,10 +381,10 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const & p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const& p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values.
|
||||
@@ -399,11 +399,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const & v);
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@@ -416,10 +416,10 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see vec4 unpackInorm3x10_1x2(uint32 const & p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see vec4 unpackInorm3x10_1x2(uint32 const& p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values.
|
||||
@@ -430,8 +430,8 @@ namespace glm
|
||||
/// the last component specifies the 10 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackF2x11_1x10(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const & v);
|
||||
/// @see vec3 unpackF2x11_1x10(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector.
|
||||
@@ -440,7 +440,7 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packF2x11_1x10(vec3 const & v)
|
||||
/// @see uint32 packF2x11_1x10(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p);
|
||||
|
||||
|
||||
@@ -454,8 +454,8 @@ namespace glm
|
||||
/// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackF3x9_E1x5(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const & v);
|
||||
/// @see vec3 unpackF3x9_E1x5(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector.
|
||||
@@ -466,7 +466,7 @@ namespace glm
|
||||
/// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packF3x9_E1x5(vec3 const & v)
|
||||
/// @see uint32 packF3x9_E1x5(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p);
|
||||
|
||||
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
|
||||
@@ -475,20 +475,20 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const & p)
|
||||
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const& p)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const & rgb);
|
||||
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const& rgb);
|
||||
|
||||
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const & v)
|
||||
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const& v)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm);
|
||||
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm);
|
||||
|
||||
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
|
||||
/// to the 16-bit floating-point representation found in the OpenGL Specification.
|
||||
@@ -496,107 +496,107 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, float, P> unpackHalf(vec<L, uint16, P> const & p)
|
||||
/// @see vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uint16, P> packHalf(vec<L, float, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, uint16, P> packHalf(vec<L, float, P> const& v);
|
||||
|
||||
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, uint16, P> packHalf(vec<L, float, P> const & v)
|
||||
/// @see vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, float, P> unpackHalf(vec<L, uint16, P> const & p);
|
||||
GLM_FUNC_DECL vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, floatType, P> unpackUnorm(vec<L, intType, P> const & p);
|
||||
/// @see vec<L, floatType, P> unpackUnorm(vec<L, intType, P> const& p);
|
||||
template<typename uintType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, intType, P> packUnorm(vec<L, floatType, P> const & v)
|
||||
/// @see vec<L, intType, P> packUnorm(vec<L, floatType, P> const& v)
|
||||
template<typename floatType, length_t L, typename uintType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into signed integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & p);
|
||||
/// @see vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& p);
|
||||
template<typename intType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
|
||||
/// @see vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
|
||||
template<typename floatType, length_t L, typename intType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec2 unpackUnorm2x4(uint8 p)
|
||||
GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const & v);
|
||||
GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm2x4(vec2 const & v)
|
||||
/// @see uint8 packUnorm2x4(vec2 const& v)
|
||||
GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm4x4(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm4x4(vec4 const & v)
|
||||
/// @see uint16 packUnorm4x4(vec4 const& v)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm1x5_1x6_1x5(vec3 const & v)
|
||||
/// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm3x5_1x1(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm3x5_1x1(vec4 const & v)
|
||||
/// @see uint16 packUnorm3x5_1x1(vec4 const& v)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackUnorm2x3_1x2(uint8 p)
|
||||
GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const & v);
|
||||
GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm2x3_1x2(vec3 const & v)
|
||||
/// @see uint8 packUnorm2x3_1x2(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p);
|
||||
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<1, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const& v)
|
||||
{
|
||||
int16 const Unpack(detail::toFloat16(v.x));
|
||||
u16vec1 Packed;
|
||||
@@ -286,7 +286,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const& v)
|
||||
{
|
||||
i16vec1 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@@ -297,7 +297,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<2, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const& v)
|
||||
{
|
||||
vec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
|
||||
u16vec2 Packed;
|
||||
@@ -305,7 +305,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const& v)
|
||||
{
|
||||
i16vec2 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@@ -316,7 +316,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<3, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const& v)
|
||||
{
|
||||
vec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
|
||||
u16vec3 Packed;
|
||||
@@ -324,7 +324,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const& v)
|
||||
{
|
||||
i16vec3 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@@ -335,7 +335,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<4, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
|
||||
u16vec4 Packed;
|
||||
@@ -343,7 +343,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const& v)
|
||||
{
|
||||
i16vec4 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@@ -363,7 +363,7 @@ namespace detail
|
||||
return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v)
|
||||
{
|
||||
u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
|
||||
@@ -396,7 +396,7 @@ namespace detail
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v)
|
||||
{
|
||||
i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f));
|
||||
uint16 Packed = 0;
|
||||
@@ -424,7 +424,7 @@ namespace detail
|
||||
return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const& v)
|
||||
{
|
||||
u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f));
|
||||
uint64 Packed = 0;
|
||||
@@ -456,7 +456,7 @@ namespace detail
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const& v)
|
||||
{
|
||||
i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
|
||||
uint64 Packed = 0;
|
||||
@@ -488,7 +488,7 @@ namespace detail
|
||||
return detail::toFloat32(Unpack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const& v)
|
||||
{
|
||||
i16vec4 const Unpack(
|
||||
detail::toFloat16(v.x),
|
||||
@@ -511,7 +511,7 @@ namespace detail
|
||||
detail::toFloat32(Unpack.w));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const& v)
|
||||
{
|
||||
detail::i10i10i10i2 Result;
|
||||
Result.data.x = v.x;
|
||||
@@ -532,7 +532,7 @@ namespace detail
|
||||
Unpack.data.w);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const& v)
|
||||
{
|
||||
detail::u10u10u10u2 Result;
|
||||
Result.data.x = v.x;
|
||||
@@ -553,7 +553,7 @@ namespace detail
|
||||
Unpack.data.w);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
{
|
||||
ivec4 const Pack(round(clamp(v,-1.0f, 1.0f) * vec4(511.f, 511.f, 511.f, 1.f)));
|
||||
|
||||
@@ -575,7 +575,7 @@ namespace detail
|
||||
return clamp(Result * vec4(1.f / 511.f, 1.f / 511.f, 1.f / 511.f, 1.f), -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
{
|
||||
uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f)));
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const& v)
|
||||
{
|
||||
return
|
||||
((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) |
|
||||
@@ -612,7 +612,7 @@ namespace detail
|
||||
detail::packed10bitToFloat(v >> 22));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const& v)
|
||||
{
|
||||
float const SharedExpMax = (pow(2.0f, 9.0f - 1.0f) / pow(2.0f, 9.0f)) * pow(2.0f, 31.f - 15.f);
|
||||
vec3 const Color = clamp(v, 0.0f, SharedExpMax);
|
||||
@@ -642,7 +642,7 @@ namespace detail
|
||||
|
||||
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const& rgb)
|
||||
{
|
||||
vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
|
||||
T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast<T>(1e-6))), static_cast<T>(0), static_cast<T>(1));
|
||||
@@ -651,19 +651,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm)
|
||||
{
|
||||
return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
|
||||
}
|
||||
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, uint16, P> packHalf(vec<L, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
|
||||
{
|
||||
return detail::compute_half<L, P>::pack(v);
|
||||
}
|
||||
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, float, P> unpackHalf(vec<L, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, float, P> unpackHalf(vec<L, uint16, P> const& v)
|
||||
{
|
||||
return detail::compute_half<L, P>::unpack(v);
|
||||
}
|
||||
@@ -687,7 +687,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename intType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
@@ -696,7 +696,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename floatType, length_t L, typename intType, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
@@ -704,7 +704,7 @@ namespace detail
|
||||
return clamp(vec<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v)
|
||||
{
|
||||
u32vec2 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f));
|
||||
detail::u4u4 Result;
|
||||
@@ -721,7 +721,7 @@ namespace detail
|
||||
return vec2(Unpack.data.x, Unpack.data.y) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const& v)
|
||||
{
|
||||
u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f));
|
||||
detail::u4u4u4u4 Result;
|
||||
@@ -740,7 +740,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const& v)
|
||||
{
|
||||
u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(31.f, 63.f, 31.f)));
|
||||
detail::u5u6u5 Result;
|
||||
@@ -758,7 +758,7 @@ namespace detail
|
||||
return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const& v)
|
||||
{
|
||||
u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(31.f, 31.f, 31.f, 1.f)));
|
||||
detail::u5u5u5u1 Result;
|
||||
@@ -777,7 +777,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const& v)
|
||||
{
|
||||
u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(7.f, 7.f, 3.f)));
|
||||
detail::u3u3u2 Result;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL T const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace glm
|
||||
/// @param v A second normalized axis
|
||||
/// @see gtc_quaternion
|
||||
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
|
||||
GLM_FUNC_DECL tquat(vec<3, T, P> const & u, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL tquat(vec<3, T, P> const& u, vec<3, T, P> const& v);
|
||||
|
||||
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const& eulerAngles);
|
||||
@@ -140,39 +140,39 @@ namespace glm
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(T const& s, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const& q, T const& s);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2);
|
||||
|
||||
/// Returns the length of the quaternion.
|
||||
///
|
||||
@@ -180,7 +180,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL T length(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL T length(tquat<T, P> const& q);
|
||||
|
||||
/// Returns the normalized quaternion.
|
||||
///
|
||||
@@ -188,7 +188,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const& q);
|
||||
|
||||
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
|
||||
///
|
||||
@@ -196,7 +196,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL T dot(tquat<T, P> const & x, tquat<T, P> const & y);
|
||||
GLM_FUNC_DECL T dot(tquat<T, P> const& x, tquat<T, P> const& y);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions.
|
||||
/// The interpolation is oriented and the rotation is performed at constant speed.
|
||||
@@ -207,10 +207,10 @@ namespace glm
|
||||
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
|
||||
/// @tparam T Floating-point scalar types.
|
||||
///
|
||||
/// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
|
||||
/// @see - slerp(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Linear interpolation of two quaternions.
|
||||
/// The interpolation is oriented.
|
||||
@@ -222,7 +222,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions.
|
||||
/// The interpolation always take the short path and the rotation is performed at constant speed.
|
||||
@@ -234,7 +234,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Returns the q conjugate.
|
||||
///
|
||||
@@ -242,7 +242,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const& q);
|
||||
|
||||
/// Returns the q inverse.
|
||||
///
|
||||
@@ -250,7 +250,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const& q);
|
||||
|
||||
/// Rotates a quaternion from a vector of 3 components axis and an angle.
|
||||
///
|
||||
@@ -261,7 +261,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis);
|
||||
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& axis);
|
||||
|
||||
/// Returns euler angles, pitch as x, yaw as y, roll as z.
|
||||
/// The result is expressed in radians.
|
||||
@@ -270,7 +270,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x);
|
||||
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const& x);
|
||||
|
||||
/// Returns roll value of euler angles expressed in radians.
|
||||
///
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_quat_mul_vec4
|
||||
{
|
||||
static vec<4, T, P> call(tquat<T, P> const & q, vec<4, T, P> const & v)
|
||||
static vec<4, T, P> call(tquat<T, P> const& q, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(q * vec<3, T, P>(v), v.w);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER T const& tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
@@ -93,7 +93,7 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const& q)
|
||||
: x(q.x), y(q.y), z(q.z), w(q.w)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
@@ -130,9 +130,9 @@ namespace detail
|
||||
//template<typename valType>
|
||||
//GLM_FUNC_QUALIFIER tquat<valType>::tquat
|
||||
//(
|
||||
// valType const & pitch,
|
||||
// valType const & yaw,
|
||||
// valType const & roll
|
||||
// valType const& pitch,
|
||||
// valType const& yaw,
|
||||
// valType const& roll
|
||||
//)
|
||||
//{
|
||||
// vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5));
|
||||
@@ -200,7 +200,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const& q)
|
||||
{
|
||||
return conjugate(q) / dot(q, q);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const& q)
|
||||
{
|
||||
this->w = q.w;
|
||||
this->x = q.x;
|
||||
@@ -221,7 +221,7 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const& q)
|
||||
{
|
||||
this->w = static_cast<T>(q.w);
|
||||
this->x = static_cast<T>(q.x);
|
||||
@@ -246,7 +246,7 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const& r)
|
||||
{
|
||||
tquat<T, P> const p(*this);
|
||||
tquat<T, P> const q(r);
|
||||
@@ -275,13 +275,13 @@ namespace detail
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const& q)
|
||||
{
|
||||
return tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
|
||||
}
|
||||
@@ -289,19 +289,19 @@ namespace detail
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p)
|
||||
{
|
||||
return tquat<T, P>(q) += p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p)
|
||||
{
|
||||
return tquat<T, P>(q) *= p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v)
|
||||
{
|
||||
vec<3, T, P> const QuatVector(q.x, q.y, q.z);
|
||||
vec<3, T, P> const uv(glm::cross(QuatVector, v));
|
||||
@@ -311,7 +311,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
@@ -323,26 +323,26 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q.w * s, q.x * s, q.y * s, q.z * s);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const& s, tquat<T, P> const& q)
|
||||
{
|
||||
return q * s;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q.w / s, q.x / s, q.y / s, q.z / s);
|
||||
@@ -351,13 +351,13 @@ namespace detail
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return all(epsilonEqual(q1, q2, epsilon<T>()));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return any(epsilonNotEqual(q1, q2, epsilon<T>()));
|
||||
}
|
||||
@@ -365,13 +365,13 @@ namespace detail
|
||||
// -- Operations --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T length(tquat<T, P> const& q)
|
||||
{
|
||||
return glm::sqrt(dot(q, q));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const& q)
|
||||
{
|
||||
T len = length(q);
|
||||
if(len <= T(0)) // Problem
|
||||
@@ -381,7 +381,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,
|
||||
@@ -392,7 +392,7 @@ namespace detail
|
||||
/*
|
||||
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
|
||||
{
|
||||
if(a <= T(0)) return x;
|
||||
if(a >= T(1)) return y;
|
||||
@@ -431,9 +431,9 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix2
|
||||
(
|
||||
tquat<T, P> const & x,
|
||||
tquat<T, P> const & y,
|
||||
T const & a
|
||||
tquat<T, P> const& x,
|
||||
tquat<T, P> const& y,
|
||||
T const& a
|
||||
)
|
||||
{
|
||||
bool flip = false;
|
||||
@@ -467,7 +467,7 @@ namespace detail
|
||||
*/
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
T cosTheta = dot(x, y);
|
||||
|
||||
@@ -490,7 +490,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
// Lerp is only defined in [0, 1]
|
||||
assert(a >= static_cast<T>(0));
|
||||
@@ -500,7 +500,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
tquat<T, P> z = y;
|
||||
|
||||
@@ -533,7 +533,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& v)
|
||||
{
|
||||
vec<3, T, P> Tmp = v;
|
||||
|
||||
@@ -555,19 +555,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const& x)
|
||||
{
|
||||
return vec<3, T, P>(pitch(x), yaw(x), roll(x));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const& q)
|
||||
{
|
||||
return static_cast<T>(atan(static_cast<T>(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const& q)
|
||||
{
|
||||
//return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
|
||||
const T y = static_cast<T>(2) * (q.y * q.z + q.w * q.x);
|
||||
@@ -580,13 +580,13 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const& q)
|
||||
{
|
||||
return asin(clamp(static_cast<T>(-2) * (q.x * q.z - q.w * q.y), static_cast<T>(-1), static_cast<T>(1)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const& q)
|
||||
{
|
||||
mat<3, 3, T, P> Result(T(1));
|
||||
T qxx(q.x * q.x);
|
||||
@@ -614,13 +614,13 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, 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 mat<4, 4, T, P>(mat3_cast(q));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, 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];
|
||||
@@ -684,19 +684,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const & m4)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const& m4)
|
||||
{
|
||||
return quat_cast(mat<3, 3, T, P>(m4));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const& x)
|
||||
{
|
||||
return acos(x.w) * static_cast<T>(2);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const& x)
|
||||
{
|
||||
T tmp1 = static_cast<T>(1) - x.w * x.w;
|
||||
if(tmp1 <= static_cast<T>(0))
|
||||
@@ -706,7 +706,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const& angle, vec<3, T, P> const& v)
|
||||
{
|
||||
tquat<T, P> Result;
|
||||
|
||||
@@ -721,7 +721,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@@ -730,7 +730,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@@ -739,7 +739,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@@ -748,7 +748,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_quat_add<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
static tquat<double, P> call(tquat<double, P> const& a, tquat<double, P> const& b)
|
||||
{
|
||||
tquat<double, P> Result;
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
@@ -109,7 +109,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_quat_sub<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
static tquat<double, P> call(tquat<double, P> const& a, tquat<double, P> const& b)
|
||||
{
|
||||
tquat<double, P> Result;
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace detail
|
||||
template<length_t L, qualifier P>
|
||||
struct compute_linearRand<L, int32, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, int32, P> call(vec<L, int32, P> const & Min, vec<L, int32, P> const& Max)
|
||||
GLM_FUNC_QUALIFIER static vec<L, int32, P> call(vec<L, int32, P> const& Min, vec<L, int32, P> const& Max)
|
||||
{
|
||||
return (vec<L, int32, P>(compute_rand<L, uint32, P>::call() % vec<L, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
|
||||
}
|
||||
@@ -266,7 +266,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> linearRand(vec<L, T, P> const & Min, vec<L, T, P> const& Max)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> linearRand(vec<L, T, P> const& Min, vec<L, T, P> const& Max)
|
||||
{
|
||||
return detail::compute_linearRand<L, T, P>::call(Min, Max);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sec(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sec(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(sec, x);
|
||||
@@ -30,7 +30,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csc(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csc(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(csc, x);
|
||||
@@ -47,7 +47,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> cot(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> cot(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(cot, x);
|
||||
@@ -62,7 +62,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asec(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asec(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(asec, x);
|
||||
@@ -77,7 +77,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsc(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsc(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acsc, x);
|
||||
@@ -94,7 +94,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acot(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acot(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acot, x);
|
||||
@@ -109,7 +109,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sech(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sech(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(sech, x);
|
||||
@@ -124,7 +124,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csch(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csch(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(csch, x);
|
||||
@@ -139,7 +139,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> coth(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> coth(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(coth, x);
|
||||
@@ -154,7 +154,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asech(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asech(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(asech, x);
|
||||
@@ -169,7 +169,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsch(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsch(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acsch, x);
|
||||
@@ -184,7 +184,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acoth(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acoth(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acoth, x);
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_round
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const & Source, vec<L, T, P> const& Multiple);
|
||||
GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
|
||||
|
||||
/// Lower multiple number of Source.
|
||||
///
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const & Value)
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const& Value)
|
||||
{
|
||||
vec<L, T, P> const Result(abs(Value));
|
||||
return equal(Result & (Result - 1), vec<L, T, P>(0));
|
||||
@@ -251,7 +251,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const& v)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(floorPowerOfTwo, v);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const& v)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(roundPowerOfTwo, v);
|
||||
}
|
||||
@@ -286,7 +286,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const & Value, T Multiple)
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, T Multiple)
|
||||
{
|
||||
return (Value % Multiple) == vec<L, T, P>(0);
|
||||
}
|
||||
|
||||
@@ -31,32 +31,32 @@ namespace glm
|
||||
/// Return the next ULP value(s) after the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType next_float(genType const & x);
|
||||
GLM_FUNC_DECL genType next_float(genType const& x);
|
||||
|
||||
/// Return the previous ULP value(s) before the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType prev_float(genType const & x);
|
||||
GLM_FUNC_DECL genType prev_float(genType const& x);
|
||||
|
||||
/// Return the value(s) ULP distance after the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance);
|
||||
GLM_FUNC_DECL genType next_float(genType const& x, uint const& Distance);
|
||||
|
||||
/// Return the value(s) ULP distance before the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance);
|
||||
GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance);
|
||||
|
||||
/// Return the distance in the number of ULP between 2 scalars.
|
||||
/// @see gtc_ulp
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL uint float_distance(T const & x, T const & y);
|
||||
GLM_FUNC_DECL uint float_distance(T const& x, T const& y);
|
||||
|
||||
/// Return the distance in the number of ULP between 2 vectors.
|
||||
/// @see gtc_ulp
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const & x, vec<2, T, Q> const & y);
|
||||
GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y);
|
||||
|
||||
/// @}
|
||||
}// namespace glm
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace detail
|
||||
namespace glm
|
||||
{
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER float next_float(float const & x)
|
||||
GLM_FUNC_QUALIFIER float next_float(float const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<float>::max());
|
||||
@@ -204,7 +204,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER double next_float(double const & x)
|
||||
GLM_FUNC_QUALIFIER double next_float(double const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<double>::max());
|
||||
@@ -218,7 +218,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@@ -226,7 +226,7 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER float prev_float(float const & x)
|
||||
GLM_FUNC_QUALIFIER float prev_float(float const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<float>::min());
|
||||
@@ -239,7 +239,7 @@ namespace glm
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double prev_float(double const & x)
|
||||
GLM_FUNC_QUALIFIER double prev_float(double const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<double>::min());
|
||||
@@ -253,7 +253,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@@ -262,7 +262,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps)
|
||||
GLM_FUNC_QUALIFIER T next_float(T const& x, uint const& ulps)
|
||||
{
|
||||
T temp = x;
|
||||
for(uint i = 0; i < ulps; ++i)
|
||||
@@ -271,7 +271,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const & x, vec<L, uint, P> const & ulps)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@@ -280,7 +280,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps)
|
||||
GLM_FUNC_QUALIFIER T prev_float(T const& x, uint const& ulps)
|
||||
{
|
||||
T temp = x;
|
||||
for(uint i = 0; i < ulps; ++i)
|
||||
@@ -289,7 +289,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const & x, vec<L, uint, P> const & ulps)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@@ -298,7 +298,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y)
|
||||
GLM_FUNC_QUALIFIER uint float_distance(T const& x, T const& y)
|
||||
{
|
||||
uint ulp = 0;
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, uint, P> float_distance(vec<L, T, P> const & x, vec<L, T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<L, uint, P> float_distance(vec<L, T, P> const& x, vec<L, T, P> const& y)
|
||||
{
|
||||
vec<L, uint, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
|
||||
Reference in New Issue
Block a user