Merge branch '0.9.5' into 0.9.6

This commit is contained in:
Christophe Riccio 2014-03-15 21:45:47 +01:00
commit ea87e50c59
50 changed files with 287 additions and 382 deletions

View File

@ -45,7 +45,7 @@ namespace detail
struct compute_log2<true> struct compute_log2<true>
{ {
template <typename T> template <typename T>
T operator() (T const & Value) const GLM_FUNC_QUALIFIER T operator() (T const & Value) const
{ {
return static_cast<T>(::std::log(Value)) * static_cast<T>(1.4426950408889634073599246810019); return static_cast<T>(::std::log(Value)) * static_cast<T>(1.4426950408889634073599246810019);
} }
@ -54,7 +54,7 @@ namespace detail
template <template <class, precision> class vecType, typename T, precision P> template <template <class, precision> class vecType, typename T, precision P>
struct compute_inversesqrt struct compute_inversesqrt
{ {
static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
{ {
return static_cast<T>(1) / sqrt(x); return static_cast<T>(1) / sqrt(x);
} }
@ -63,7 +63,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_inversesqrt<vecType, float, lowp> struct compute_inversesqrt<vecType, float, lowp>
{ {
static vecType<float, lowp> call(vecType<float, lowp> const & x) GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x)
{ {
vecType<float, lowp> tmp(x); vecType<float, lowp> tmp(x);
vecType<float, lowp> xhalf(tmp * 0.5f); vecType<float, lowp> xhalf(tmp * 0.5f);

View File

@ -41,7 +41,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<detail::tvec1, T, P> struct compute_dot<detail::tvec1, T, P>
{ {
static T call(detail::tvec1<T, P> const & x, detail::tvec1<T, P> const & y) GLM_FUNC_QUALIFIER static T call(detail::tvec1<T, P> const & x, detail::tvec1<T, P> const & y)
{ {
return detail::tvec1<T, P>(x * y).x; return detail::tvec1<T, P>(x * y).x;
} }
@ -50,7 +50,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<detail::tvec2, T, P> struct compute_dot<detail::tvec2, T, P>
{ {
static T call(detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & y) GLM_FUNC_QUALIFIER static T call(detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & y)
{ {
detail::tvec2<T, P> tmp(x * y); detail::tvec2<T, P> tmp(x * y);
return tmp.x + tmp.y; return tmp.x + tmp.y;
@ -60,7 +60,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<detail::tvec3, T, P> struct compute_dot<detail::tvec3, T, P>
{ {
static T call(detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & y) GLM_FUNC_QUALIFIER static T call(detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & y)
{ {
detail::tvec3<T, P> tmp(x * y); detail::tvec3<T, P> tmp(x * y);
return tmp.x + tmp.y + tmp.z; return tmp.x + tmp.y + tmp.z;
@ -70,7 +70,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<detail::tvec4, T, P> struct compute_dot<detail::tvec4, T, P>
{ {
static T call(detail::tvec4<T, P> const & x, detail::tvec4<T, P> const & y) GLM_FUNC_QUALIFIER static T call(detail::tvec4<T, P> const & x, detail::tvec4<T, P> const & y)
{ {
detail::tvec4<T, P> tmp(x * y); detail::tvec4<T, P> tmp(x * y);
return (tmp.x + tmp.y) + (tmp.z + tmp.w); return (tmp.x + tmp.y) + (tmp.z + tmp.w);

View File

@ -153,7 +153,7 @@ namespace detail
T const & s); T const & s);
template <typename T, precision P> template <typename T, precision P>
tmat2x3<T, P> operator+ ( GLM_FUNC_DECL tmat2x3<T, P> operator+ (
tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m1,
tmat2x3<T, P> const & m2); tmat2x3<T, P> const & m2);

View File

@ -52,14 +52,14 @@ namespace glm
/// Get a specific row of a matrix. /// Get a specific row of a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template <typename genType>
typename genType::row_type row( GLM_FUNC_DECL typename genType::row_type row(
genType const & m, genType const & m,
length_t const & index); length_t const & index);
/// Set a specific row to a matrix. /// Set a specific row to a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template <typename genType>
genType row( GLM_FUNC_DECL genType row(
genType const & m, genType const & m,
length_t const & index, length_t const & index,
typename genType::row_type const & x); typename genType::row_type const & x);
@ -67,14 +67,14 @@ namespace glm
/// Get a specific column of a matrix. /// Get a specific column of a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template <typename genType>
typename genType::col_type column( GLM_FUNC_DECL typename genType::col_type column(
genType const & m, genType const & m,
length_t const & index); length_t const & index);
/// Set a specific column to a matrix. /// Set a specific column to a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template <typename genType>
genType column( GLM_FUNC_DECL genType column(
genType const & m, genType const & m,
length_t const & index, length_t const & index,
typename genType::col_type const & x); typename genType::col_type const & x);

View File

@ -55,7 +55,7 @@ namespace glm
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse /// @see gtc_matrix_inverse
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType affineInverse(genType const & m); GLM_FUNC_DECL genType affineInverse(genType const & m);
/// Compute the inverse transpose of a matrix. /// Compute the inverse transpose of a matrix.
/// ///
@ -63,7 +63,7 @@ namespace glm
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse /// @see gtc_matrix_inverse
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER typename genType::value_type inverseTranspose( GLM_FUNC_DECL typename genType::value_type inverseTranspose(
genType const & m); genType const & m);
/// @} /// @}

View File

@ -57,20 +57,20 @@ namespace glm
/// Classic perlin noise. /// Classic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, precision P, template<typename, precision> class vecType> template <typename T, precision P, template<typename, precision> class vecType>
T perlin( GLM_FUNC_DECL T perlin(
vecType<T, P> const & p); vecType<T, P> const & p);
/// Periodic perlin noise. /// Periodic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, precision P, template<typename, precision> class vecType> template <typename T, precision P, template<typename, precision> class vecType>
T perlin( GLM_FUNC_DECL T perlin(
vecType<T, P> const & p, vecType<T, P> const & p,
vecType<T, P> const & rep); vecType<T, P> const & rep);
/// Simplex noise. /// Simplex noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, precision P, template<typename, precision> class vecType> template <typename T, precision P, template<typename, precision> class vecType>
T simplex( GLM_FUNC_DECL T simplex(
vecType<T, P> const & p); vecType<T, P> const & p);
/// @} /// @}

View File

@ -53,14 +53,14 @@ namespace glm
/// Min comparison between 2 variables /// Min comparison between 2 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMin( GLM_FUNC_DECL genTypeU associatedMin(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b); const genTypeT& y, const genTypeU& b);
/// Min comparison between 3 variables /// Min comparison between 3 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMin( GLM_FUNC_DECL genTypeU associatedMin(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b, const genTypeT& y, const genTypeU& b,
const genTypeT& z, const genTypeU& c); const genTypeT& z, const genTypeU& c);
@ -68,7 +68,7 @@ namespace glm
/// Min comparison between 4 variables /// Min comparison between 4 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMin( GLM_FUNC_DECL genTypeU associatedMin(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b, const genTypeT& y, const genTypeU& b,
const genTypeT& z, const genTypeU& c, const genTypeT& z, const genTypeU& c,
@ -77,14 +77,14 @@ namespace glm
/// Max comparison between 2 variables /// Max comparison between 2 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMax( GLM_FUNC_DECL genTypeU associatedMax(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b); const genTypeT& y, const genTypeU& b);
/// Max comparison between 3 variables /// Max comparison between 3 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMax( GLM_FUNC_DECL genTypeU associatedMax(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b, const genTypeT& y, const genTypeU& b,
const genTypeT& z, const genTypeU& c); const genTypeT& z, const genTypeU& c);
@ -92,7 +92,7 @@ namespace glm
/// Max comparison between 4 variables /// Max comparison between 4 variables
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
genTypeU associatedMax( GLM_FUNC_DECL genTypeU associatedMax(
const genTypeT& x, const genTypeU& a, const genTypeT& x, const genTypeU& a,
const genTypeT& y, const genTypeU& b, const genTypeT& y, const genTypeU& b,
const genTypeT& z, const genTypeU& c, const genTypeT& z, const genTypeU& c,

View File

@ -53,7 +53,7 @@ namespace glm
/// Find the point on a straight line which is the closet of a point. /// Find the point on a straight line which is the closet of a point.
/// @see gtx_closest_point /// @see gtx_closest_point
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> closestPointOnLine( GLM_FUNC_DECL detail::tvec3<T, P> closestPointOnLine(
detail::tvec3<T, P> const & point, detail::tvec3<T, P> const & point,
detail::tvec3<T, P> const & a, detail::tvec3<T, P> const & a,
detail::tvec3<T, P> const & b); detail::tvec3<T, P> const & b);

View File

@ -53,39 +53,39 @@ namespace glm
/// Converts a color from HSV color space to its color in RGB color space. /// Converts a color from HSV color space to its color in RGB color space.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rgbColor( GLM_FUNC_DECL detail::tvec3<T, P> rgbColor(
detail::tvec3<T, P> const & hsvValue); detail::tvec3<T, P> const & hsvValue);
/// Converts a color from RGB color space to its color in HSV color space. /// Converts a color from RGB color space to its color in HSV color space.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> hsvColor( GLM_FUNC_DECL detail::tvec3<T, P> hsvColor(
detail::tvec3<T, P> const & rgbValue); detail::tvec3<T, P> const & rgbValue);
/// Build a saturation matrix. /// Build a saturation matrix.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> saturation( GLM_FUNC_DECL detail::tmat4x4<T, P> saturation(
T const s); T const s);
/// Modify the saturation of a color. /// Modify the saturation of a color.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> saturation( GLM_FUNC_DECL detail::tvec3<T, P> saturation(
T const s, T const s,
detail::tvec3<T, P> const & color); detail::tvec3<T, P> const & color);
/// Modify the saturation of a color. /// Modify the saturation of a color.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> saturation( GLM_FUNC_DECL detail::tvec4<T, P> saturation(
T const s, T const s,
detail::tvec4<T, P> const & color); detail::tvec4<T, P> const & color);
/// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
/// @see gtx_color_space /// @see gtx_color_space
template <typename T, precision P> template <typename T, precision P>
T luminosity( GLM_FUNC_DECL T luminosity(
detail::tvec3<T, P> const & color); detail::tvec3<T, P> const & color);
/// @} /// @}

View File

@ -53,27 +53,27 @@ namespace glm
/// Convert a color from RGB color space to YCoCg color space. /// Convert a color from RGB color space to YCoCg color space.
/// @see gtx_color_space_YCoCg /// @see gtx_color_space_YCoCg
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rgb2YCoCg( GLM_FUNC_DECL detail::tvec3<T, P> rgb2YCoCg(
detail::tvec3<T, P> const & rgbColor); detail::tvec3<T, P> const & rgbColor);
/// Convert a color from YCoCg color space to RGB color space. /// Convert a color from YCoCg color space to RGB color space.
/// @see gtx_color_space_YCoCg /// @see gtx_color_space_YCoCg
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> YCoCg2rgb( GLM_FUNC_DECL detail::tvec3<T, P> YCoCg2rgb(
detail::tvec3<T, P> const & YCoCgColor); detail::tvec3<T, P> const & YCoCgColor);
/// Convert a color from RGB color space to YCoCgR color space. /// Convert a color from RGB color space to YCoCgR color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg /// @see gtx_color_space_YCoCg
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rgb2YCoCgR( GLM_FUNC_DECL detail::tvec3<T, P> rgb2YCoCgR(
detail::tvec3<T, P> const & rgbColor); detail::tvec3<T, P> const & rgbColor);
/// Convert a color from YCoCgR color space to RGB color space. /// Convert a color from YCoCgR color space to RGB color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg /// @see gtx_color_space_YCoCg
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> YCoCgR2rgb( GLM_FUNC_DECL detail::tvec3<T, P> YCoCgR2rgb(
detail::tvec3<T, P> const & YCoCgColor); detail::tvec3<T, P> const & YCoCgColor);
/// @} /// @}

View File

@ -53,25 +53,25 @@ namespace glm
/// Add all vector components together. /// Add all vector components together.
/// @see gtx_component_wise /// @see gtx_component_wise
template <typename genType> template <typename genType>
typename genType::value_type compAdd( GLM_FUNC_DECL typename genType::value_type compAdd(
genType const & v); genType const & v);
/// Multiply all vector components together. /// Multiply all vector components together.
/// @see gtx_component_wise /// @see gtx_component_wise
template <typename genType> template <typename genType>
typename genType::value_type compMul( GLM_FUNC_DECL typename genType::value_type compMul(
genType const & v); genType const & v);
/// Find the minimum value between single vector components. /// Find the minimum value between single vector components.
/// @see gtx_component_wise /// @see gtx_component_wise
template <typename genType> template <typename genType>
typename genType::value_type compMin( GLM_FUNC_DECL typename genType::value_type compMin(
genType const & v); genType const & v);
/// Find the maximum value between single vector components. /// Find the maximum value between single vector components.
/// @see gtx_component_wise /// @see gtx_component_wise
template <typename genType> template <typename genType>
typename genType::value_type compMax( GLM_FUNC_DECL typename genType::value_type compMax(
genType const & v); genType const & v);
/// @} /// @}

View File

@ -66,71 +66,71 @@ namespace detail
GLM_FUNC_DECL GLM_CONSTEXPR int length() const; GLM_FUNC_DECL GLM_CONSTEXPR int length() const;
// Constructors // Constructors
tdualquat(); GLM_FUNC_DECL tdualquat();
explicit tdualquat(tquat<T, P> const & real); GLM_FUNC_DECL explicit tdualquat(tquat<T, P> const & real);
tdualquat(tquat<T, P> const & real,tquat<T, P> const & dual); GLM_FUNC_DECL tdualquat(tquat<T, P> const & real,tquat<T, P> const & dual);
tdualquat(tquat<T, P> const & orientation,tvec3<T, P> const& translation); GLM_FUNC_DECL tdualquat(tquat<T, P> const & orientation,tvec3<T, P> const& translation);
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
// tdualquat conversions // tdualquat conversions
explicit tdualquat(tmat2x4<T, P> const & holder_mat); GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
explicit tdualquat(tmat3x4<T, P> const & aug_mat); GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);
// Accesses // Accesses
part_type & operator[](int i); GLM_FUNC_DECL part_type & operator[](int i);
part_type const & operator[](int i) const; GLM_FUNC_DECL part_type const & operator[](int i) const;
// Operators // Operators
tdualquat<T, P> & operator*=(T const & s); GLM_FUNC_DECL tdualquat<T, P> & operator*=(T const & s);
tdualquat<T, P> & operator/=(T const & s); GLM_FUNC_DECL tdualquat<T, P> & operator/=(T const & s);
}; };
template <typename T, precision P> template <typename T, precision P>
detail::tquat<T, P> operator- ( GLM_FUNC_DECL detail::tquat<T, P> operator- (
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
template <typename T, precision P> template <typename T, precision P>
detail::tdualquat<T, P> operator+ ( GLM_FUNC_DECL detail::tdualquat<T, P> operator+ (
detail::tdualquat<T, P> const & q, detail::tdualquat<T, P> const & q,
detail::tdualquat<T, P> const & p); detail::tdualquat<T, P> const & p);
template <typename T, precision P> template <typename T, precision P>
detail::tdualquat<T, P> operator* ( GLM_FUNC_DECL detail::tdualquat<T, P> operator* (
detail::tdualquat<T, P> const & q, detail::tdualquat<T, P> const & q,
detail::tdualquat<T, P> const & p); detail::tdualquat<T, P> const & p);
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> operator* ( GLM_FUNC_DECL detail::tvec3<T, P> operator* (
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> operator* ( GLM_FUNC_DECL detail::tvec3<T, P> operator* (
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> operator* ( GLM_FUNC_DECL detail::tvec4<T, P> operator* (
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
detail::tvec4<T, P> const & v); detail::tvec4<T, P> const & v);
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> operator* ( GLM_FUNC_DECL detail::tvec4<T, P> operator* (
detail::tvec4<T, P> const & v, detail::tvec4<T, P> const & v,
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
template <typename T, precision P> template <typename T, precision P>
detail::tdualquat<T, P> operator* ( GLM_FUNC_DECL detail::tdualquat<T, P> operator* (
detail::tdualquat<T, P> const & q, detail::tdualquat<T, P> const & q,
T const & s); T const & s);
template <typename T, precision P> template <typename T, precision P>
detail::tdualquat<T, P> operator* ( GLM_FUNC_DECL detail::tdualquat<T, P> operator* (
T const & s, T const & s,
detail::tdualquat<T, P> const & q); detail::tdualquat<T, P> const & q);
template <typename T, precision P> template <typename T, precision P>
detail::tdualquat<T, P> operator/ ( GLM_FUNC_DECL detail::tdualquat<T, P> operator/ (
detail::tdualquat<T, P> const & q, detail::tdualquat<T, P> const & q,
T const & s); T const & s);
} //namespace detail } //namespace detail

View File

@ -54,67 +54,67 @@ namespace glm
/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleX( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleX(
T const & angleX); T const & angleX);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleY( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleY(
T const & angleY); T const & angleY);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleZ( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZ(
T const & angleZ); T const & angleZ);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleXY( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleXY(
T const & angleX, T const & angleX,
T const & angleY); T const & angleY);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleYX( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYX(
T const & angleY, T const & angleY,
T const & angleX); T const & angleX);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleXZ( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleXZ(
T const & angleX, T const & angleX,
T const & angleZ); T const & angleZ);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleZX( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZX(
T const & angle, T const & angle,
T const & angleX); T const & angleX);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleYZ( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYZ(
T const & angleY, T const & angleY,
T const & angleZ); T const & angleZ);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleZY( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleZY(
T const & angleZ, T const & angleZ,
T const & angleY); T const & angleY);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> eulerAngleYXZ( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> eulerAngleYXZ(
T const & yaw, T const & yaw,
T const & pitch, T const & pitch,
T const & roll); T const & roll);
@ -122,7 +122,7 @@ namespace glm
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat4x4<T, defaultp> yawPitchRoll( GLM_FUNC_DECL detail::tmat4x4<T, defaultp> yawPitchRoll(
T const & yaw, T const & yaw,
T const & pitch, T const & pitch,
T const & roll); T const & roll);
@ -130,22 +130,22 @@ namespace glm
/// Creates a 2D 2 * 2 rotation matrix from an euler angle. /// Creates a 2D 2 * 2 rotation matrix from an euler angle.
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat2x2<T, defaultp> orientate2(T const & angle); GLM_FUNC_DECL detail::tmat2x2<T, defaultp> orientate2(T const & angle);
/// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T> template <typename T>
detail::tmat3x3<T, defaultp> orientate3(T const & angle); GLM_FUNC_DECL detail::tmat3x3<T, defaultp> orientate3(T const & angle);
/// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> orientate3(detail::tvec3<T, P> const & angles); GLM_FUNC_DECL detail::tmat3x3<T, P> orientate3(detail::tvec3<T, P> const & angles);
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
/// @see gtx_euler_angles /// @see gtx_euler_angles
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> orientate4(detail::tvec3<T, P> const & angles); GLM_FUNC_DECL detail::tmat4x4<T, P> orientate4(detail::tvec3<T, P> const & angles);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -54,31 +54,23 @@ namespace glm
/// Return the minimum component-wise values of 3 inputs /// Return the minimum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template <typename T> template <typename T>
T min( GLM_FUNC_DECL T min(
T const & x, T const & x,
T const & y, T const & y,
T const & z); T const & z);
/// Return the minimum component-wise values of 3 inputs /// Return the minimum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> min(
typename T,
template <typename> class C
>
C<T> min(
C<T> const & x, C<T> const & x,
typename C<T>::T const & y, typename C<T>::T const & y,
typename C<T>::T const & z); typename C<T>::T const & z);
/// Return the minimum component-wise values of 3 inputs /// Return the minimum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> min(
typename T,
template <typename> class C
>
C<T> min(
C<T> const & x, C<T> const & x,
C<T> const & y, C<T> const & y,
C<T> const & z); C<T> const & z);
@ -86,7 +78,7 @@ namespace glm
/// Return the minimum component-wise values of 4 inputs /// Return the minimum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template <typename T> template <typename T>
T min( GLM_FUNC_DECL T min(
T const & x, T const & x,
T const & y, T const & y,
T const & z, T const & z,
@ -94,12 +86,8 @@ namespace glm
/// Return the minimum component-wise values of 4 inputs /// Return the minimum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> min(
typename T,
template <typename> class C
>
C<T> min(
C<T> const & x, C<T> const & x,
typename C<T>::T const & y, typename C<T>::T const & y,
typename C<T>::T const & z, typename C<T>::T const & z,
@ -107,12 +95,8 @@ namespace glm
/// Return the minimum component-wise values of 4 inputs /// Return the minimum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> min(
typename T,
template <typename> class C
>
C<T> min(
C<T> const & x, C<T> const & x,
C<T> const & y, C<T> const & y,
C<T> const & z, C<T> const & z,
@ -121,31 +105,23 @@ namespace glm
/// Return the maximum component-wise values of 3 inputs /// Return the maximum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template <typename T> template <typename T>
T max( GLM_FUNC_DECL T max(
T const & x, T const & x,
T const & y, T const & y,
T const & z); T const & z);
/// Return the maximum component-wise values of 3 inputs /// Return the maximum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> max(
typename T,
template <typename> class C
>
C<T> max(
C<T> const & x, C<T> const & x,
typename C<T>::T const & y, typename C<T>::T const & y,
typename C<T>::T const & z); typename C<T>::T const & z);
/// Return the maximum component-wise values of 3 inputs /// Return the maximum component-wise values of 3 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> max(
typename T,
template <typename> class C
>
C<T> max(
C<T> const & x, C<T> const & x,
C<T> const & y, C<T> const & y,
C<T> const & z); C<T> const & z);
@ -153,7 +129,7 @@ namespace glm
/// Return the maximum component-wise values of 4 inputs /// Return the maximum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template <typename T> template <typename T>
T max( GLM_FUNC_DECL T max(
T const & x, T const & x,
T const & y, T const & y,
T const & z, T const & z,
@ -161,12 +137,8 @@ namespace glm
/// Return the maximum component-wise values of 4 inputs /// Return the maximum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> max(
typename T,
template <typename> class C
>
C<T> max(
C<T> const & x, C<T> const & x,
typename C<T>::T const & y, typename C<T>::T const & y,
typename C<T>::T const & z, typename C<T>::T const & z,
@ -174,12 +146,8 @@ namespace glm
/// Return the maximum component-wise values of 4 inputs /// Return the maximum component-wise values of 4 inputs
/// @see gtx_extented_min_max /// @see gtx_extented_min_max
template template <typename T, template <typename> class C>
< GLM_FUNC_DECL C<T> max(
typename T,
template <typename> class C
>
C<T> max(
C<T> const & x, C<T> const & x,
C<T> const & y, C<T> const & y,
C<T> const & z, C<T> const & z,

View File

@ -18,11 +18,7 @@ namespace glm
return glm::min(glm::min(x, y), z); return glm::min(glm::min(x, y), z);
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> min GLM_FUNC_QUALIFIER C<T> min
( (
C<T> const & x, C<T> const & x,
@ -33,11 +29,7 @@ namespace glm
return glm::min(glm::min(x, y), z); return glm::min(glm::min(x, y), z);
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> min GLM_FUNC_QUALIFIER C<T> min
( (
C<T> const & x, C<T> const & x,
@ -60,11 +52,7 @@ namespace glm
return glm::min(glm::min(x, y), glm::min(z, w)); return glm::min(glm::min(x, y), glm::min(z, w));
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> min GLM_FUNC_QUALIFIER C<T> min
( (
C<T> const & x, C<T> const & x,
@ -76,11 +64,7 @@ namespace glm
return glm::min(glm::min(x, y), glm::min(z, w)); return glm::min(glm::min(x, y), glm::min(z, w));
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> min GLM_FUNC_QUALIFIER C<T> min
( (
C<T> const & x, C<T> const & x,
@ -101,11 +85,7 @@ namespace glm
return glm::max(glm::max(x, y), z); return glm::max(glm::max(x, y), z);
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> max GLM_FUNC_QUALIFIER C<T> max
( (
C<T> const & x, C<T> const & x,
@ -116,11 +96,7 @@ namespace glm
return glm::max(glm::max(x, y), z); return glm::max(glm::max(x, y), z);
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> max GLM_FUNC_QUALIFIER C<T> max
( (
C<T> const & x, C<T> const & x,
@ -143,11 +119,7 @@ namespace glm
return glm::max(glm::max(x, y), glm::max(z, w)); return glm::max(glm::max(x, y), glm::max(z, w));
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> max GLM_FUNC_QUALIFIER C<T> max
( (
C<T> const & x, C<T> const & x,
@ -159,11 +131,7 @@ namespace glm
return glm::max(glm::max(x, y), glm::max(z, w)); return glm::max(glm::max(x, y), glm::max(z, w));
} }
template template <typename T, template <typename> class C>
<
typename T,
template <typename> class C
>
GLM_FUNC_QUALIFIER C<T> max GLM_FUNC_QUALIFIER C<T> max
( (
C<T> const & x, C<T> const & x,

View File

@ -54,41 +54,41 @@ namespace glm
/// Faster than the common pow function but less accurate. /// Faster than the common pow function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename genType> template <typename genType>
genType fastPow( GLM_FUNC_DECL genType fastPow(
genType const & x, genType const & x,
genType const & y); genType const & y);
/// Faster than the common pow function but less accurate. /// Faster than the common pow function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename genTypeT, typename genTypeU> template <typename genTypeT, typename genTypeU>
genTypeT fastPow( GLM_FUNC_DECL genTypeT fastPow(
genTypeT const & x, genTypeT const & x,
genTypeU const & y); genTypeU const & y);
/// Faster than the common exp function but less accurate. /// Faster than the common exp function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename T> template <typename T>
T fastExp(const T& x); GLM_FUNC_DECL T fastExp(const T& x);
/// Faster than the common log function but less accurate. /// Faster than the common log function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename T> template <typename T>
T fastLog(const T& x); GLM_FUNC_DECL T fastLog(const T& x);
/// Faster than the common exp2 function but less accurate. /// Faster than the common exp2 function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename T> template <typename T>
T fastExp2(const T& x); GLM_FUNC_DECL T fastExp2(const T& x);
/// Faster than the common log2 function but less accurate. /// Faster than the common log2 function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename T> template <typename T>
T fastLog2(const T& x); GLM_FUNC_DECL T fastLog2(const T& x);
/// Faster than the common ln function but less accurate. /// Faster than the common ln function but less accurate.
/// @see gtx_fast_exponential /// @see gtx_fast_exponential
template <typename T> template <typename T>
T fastLn(const T& x); GLM_FUNC_DECL T fastLn(const T& x);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -53,44 +53,44 @@ namespace glm
//! Faster than the common sin function but less accurate. //! Faster than the common sin function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastSin(const T& angle); GLM_FUNC_DECL T fastSin(const T& angle);
//! Faster than the common cos function but less accurate. //! Faster than the common cos function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastCos(const T& angle); GLM_FUNC_DECL T fastCos(const T& angle);
//! Faster than the common tan function but less accurate. //! Faster than the common tan function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastTan(const T& angle); GLM_FUNC_DECL T fastTan(const T& angle);
//! Faster than the common asin function but less accurate. //! Faster than the common asin function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastAsin(const T& angle); GLM_FUNC_DECL T fastAsin(const T& angle);
//! Faster than the common acos function but less accurate. //! Faster than the common acos function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastAcos(const T& angle); GLM_FUNC_DECL T fastAcos(const T& angle);
//! Faster than the common atan function but less accurate. //! Faster than the common atan function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastAtan(const T& y, const T& x); GLM_FUNC_DECL T fastAtan(const T& y, const T& x);
//! Faster than the common atan function but less accurate. //! Faster than the common atan function but less accurate.
//! Defined between -2pi and 2pi. //! Defined between -2pi and 2pi.
//! From GLM_GTX_fast_trigonometry extension. //! From GLM_GTX_fast_trigonometry extension.
template <typename T> template <typename T>
T fastAtan(const T& angle); GLM_FUNC_DECL T fastAtan(const T& angle);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -54,7 +54,7 @@ namespace glm
/// Return a color from a radial gradient. /// Return a color from a radial gradient.
/// @see - gtx_gradient_paint /// @see - gtx_gradient_paint
template <typename T, precision P> template <typename T, precision P>
T radialGradient( GLM_FUNC_DECL T radialGradient(
detail::tvec2<T, P> const & Center, detail::tvec2<T, P> const & Center,
T const & Radius, T const & Radius,
detail::tvec2<T, P> const & Focal, detail::tvec2<T, P> const & Focal,
@ -63,7 +63,7 @@ namespace glm
/// Return a color from a linear gradient. /// Return a color from a linear gradient.
/// @see - gtx_gradient_paint /// @see - gtx_gradient_paint
template <typename T, precision P> template <typename T, precision P>
T linearGradient( GLM_FUNC_DECL T linearGradient(
detail::tvec2<T, P> const & Point0, detail::tvec2<T, P> const & Point0,
detail::tvec2<T, P> const & Point1, detail::tvec2<T, P> const & Point1,
detail::tvec2<T, P> const & Position); detail::tvec2<T, P> const & Position);

View File

@ -10,7 +10,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template <typename T, precision P>
T radialGradient GLM_FUNC_QUALIFIER T radialGradient
( (
detail::tvec2<T, P> const & Center, detail::tvec2<T, P> const & Center,
T const & Radius, T const & Radius,
@ -30,7 +30,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
T linearGradient GLM_FUNC_QUALIFIER T linearGradient
( (
detail::tvec2<T, P> const & Point0, detail::tvec2<T, P> const & Point0,
detail::tvec2<T, P> const & Point1, detail::tvec2<T, P> const & Point1,

View File

@ -53,7 +53,7 @@ namespace glm
//! Return if a trihedron right handed or not. //! Return if a trihedron right handed or not.
//! From GLM_GTX_handed_coordinate_space extension. //! From GLM_GTX_handed_coordinate_space extension.
template <typename T, precision P> template <typename T, precision P>
bool rightHanded( GLM_FUNC_DECL bool rightHanded(
detail::tvec3<T, P> const & tangent, detail::tvec3<T, P> const & tangent,
detail::tvec3<T, P> const & binormal, detail::tvec3<T, P> const & binormal,
detail::tvec3<T, P> const & normal); detail::tvec3<T, P> const & normal);
@ -61,7 +61,7 @@ namespace glm
//! Return if a trihedron left handed or not. //! Return if a trihedron left handed or not.
//! From GLM_GTX_handed_coordinate_space extension. //! From GLM_GTX_handed_coordinate_space extension.
template <typename T, precision P> template <typename T, precision P>
bool leftHanded( GLM_FUNC_DECL bool leftHanded(
detail::tvec3<T, P> const & tangent, detail::tvec3<T, P> const & tangent,
detail::tvec3<T, P> const & binormal, detail::tvec3<T, P> const & binormal,
detail::tvec3<T, P> const & normal); detail::tvec3<T, P> const & normal);

View File

@ -52,29 +52,29 @@ namespace glm
//! Returns x raised to the y power. //! Returns x raised to the y power.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
int pow(int x, int y); GLM_FUNC_DECL int pow(int x, int y);
//! Returns the positive square root of x. //! Returns the positive square root of x.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
int sqrt(int x); GLM_FUNC_DECL int sqrt(int x);
//! Returns the log2 of x. Can be reliably using to compute mipmap count from the texture size. //! Returns the log2 of x. Can be reliably using to compute mipmap count from the texture size.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
template <typename genIUType> template <typename genIUType>
genIUType log2(genIUType x); GLM_FUNC_DECL genIUType log2(genIUType x);
//! Returns the floor log2 of x. //! Returns the floor log2 of x.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
unsigned int floor_log2(unsigned int x); GLM_FUNC_DECL unsigned int floor_log2(unsigned int x);
//! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
int mod(int x, int y); GLM_FUNC_DECL int mod(int x, int y);
//! Return the factorial value of a number (!12 max, integer only) //! Return the factorial value of a number (!12 max, integer only)
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
template <typename genType> template <typename genType>
genType factorial(genType const & x); GLM_FUNC_DECL genType factorial(genType const & x);
//! 32bit signed integer. //! 32bit signed integer.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
@ -82,19 +82,19 @@ namespace glm
//! Returns x raised to the y power. //! Returns x raised to the y power.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
uint pow(uint x, uint y); GLM_FUNC_DECL uint pow(uint x, uint y);
//! Returns the positive square root of x. //! Returns the positive square root of x.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
uint sqrt(uint x); GLM_FUNC_DECL uint sqrt(uint x);
//! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
uint mod(uint x, uint y); GLM_FUNC_DECL uint mod(uint x, uint y);
//! Returns the number of leading zeros. //! Returns the number of leading zeros.
//! From GLM_GTX_integer extension. //! From GLM_GTX_integer extension.
uint nlz(uint x); GLM_FUNC_DECL uint nlz(uint x);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -56,7 +56,7 @@ namespace glm
//! Ray direction and plane normal must be unit length. //! Ray direction and plane normal must be unit length.
//! From GLM_GTX_intersect extension. //! From GLM_GTX_intersect extension.
template <typename genType> template <typename genType>
bool intersectRayPlane( GLM_FUNC_DECL bool intersectRayPlane(
genType const & orig, genType const & dir, genType const & orig, genType const & dir,
genType const & planeOrig, genType const & planeNormal, genType const & planeOrig, genType const & planeNormal,
typename genType::value_type & intersectionDistance); typename genType::value_type & intersectionDistance);
@ -64,7 +64,7 @@ namespace glm
//! Compute the intersection of a ray and a triangle. //! Compute the intersection of a ray and a triangle.
//! From GLM_GTX_intersect extension. //! From GLM_GTX_intersect extension.
template <typename genType> template <typename genType>
bool intersectRayTriangle( GLM_FUNC_DECL bool intersectRayTriangle(
genType const & orig, genType const & dir, genType const & orig, genType const & dir,
genType const & vert0, genType const & vert1, genType const & vert2, genType const & vert0, genType const & vert1, genType const & vert2,
genType & baryPosition); genType & baryPosition);
@ -72,7 +72,7 @@ namespace glm
//! Compute the intersection of a line and a triangle. //! Compute the intersection of a line and a triangle.
//! From GLM_GTX_intersect extension. //! From GLM_GTX_intersect extension.
template <typename genType> template <typename genType>
bool intersectLineTriangle( GLM_FUNC_DECL bool intersectLineTriangle(
genType const & orig, genType const & dir, genType const & orig, genType const & dir,
genType const & vert0, genType const & vert1, genType const & vert2, genType const & vert0, genType const & vert1, genType const & vert2,
genType & position); genType & position);
@ -81,7 +81,7 @@ namespace glm
//! The ray direction vector is unit length. //! The ray direction vector is unit length.
//! From GLM_GTX_intersect extension. //! From GLM_GTX_intersect extension.
template <typename genType> template <typename genType>
bool intersectRaySphere( GLM_FUNC_DECL bool intersectRaySphere(
genType const & rayStarting, genType const & rayNormalizedDirection, genType const & rayStarting, genType const & rayNormalizedDirection,
genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered, genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered,
typename genType::value_type & intersectionDistance); typename genType::value_type & intersectionDistance);
@ -89,7 +89,7 @@ namespace glm
//! Compute the intersection of a ray and a sphere. //! Compute the intersection of a ray and a sphere.
//! From GLM_GTX_intersect extension. //! From GLM_GTX_intersect extension.
template <typename genType> template <typename genType>
bool intersectRaySphere( GLM_FUNC_DECL bool intersectRaySphere(
genType const & rayStarting, genType const & rayNormalizedDirection, genType const & rayStarting, genType const & rayNormalizedDirection,
genType const & sphereCenter, const typename genType::value_type sphereRadius, genType const & sphereCenter, const typename genType::value_type sphereRadius,
genType & intersectionPosition, genType & intersectionNormal); genType & intersectionPosition, genType & intersectionNormal);
@ -97,7 +97,7 @@ namespace glm
//! Compute the intersection of a line and a sphere. //! Compute the intersection of a line and a sphere.
//! From GLM_GTX_intersect extension //! From GLM_GTX_intersect extension
template <typename genType> template <typename genType>
bool intersectLineSphere( GLM_FUNC_DECL bool intersectLineSphere(
genType const & point0, genType const & point1, genType const & point0, genType const & point1,
genType const & sphereCenter, typename genType::value_type sphereRadius, genType const & sphereCenter, typename genType::value_type sphereRadius,
genType & intersectionPosition1, genType & intersectionNormal1, genType & intersectionPosition1, genType & intersectionNormal1,

View File

@ -53,7 +53,7 @@ namespace glm
//! Logarithm for any base. //! Logarithm for any base.
//! From GLM_GTX_log_base. //! From GLM_GTX_log_base.
template <typename genType> template <typename genType>
genType log( GLM_FUNC_DECL genType log(
genType const & x, genType const & x,
genType const & base); genType const & base);

View File

@ -54,13 +54,13 @@ namespace glm
//! Build a cross product matrix. //! Build a cross product matrix.
//! From GLM_GTX_matrix_cross_product extension. //! From GLM_GTX_matrix_cross_product extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> matrixCross3( GLM_FUNC_DECL detail::tmat3x3<T, P> matrixCross3(
detail::tvec3<T, P> const & x); detail::tvec3<T, P> const & x);
//! Build a cross product matrix. //! Build a cross product matrix.
//! From GLM_GTX_matrix_cross_product extension. //! From GLM_GTX_matrix_cross_product extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> matrixCross4( GLM_FUNC_DECL detail::tmat4x4<T, P> matrixCross4(
detail::tvec3<T, P> const & x); detail::tvec3<T, P> const & x);
/// @} /// @}

View File

@ -53,7 +53,7 @@ namespace glm
/// Get the axis and angle of the rotation from a matrix. /// Get the axis and angle of the rotation from a matrix.
/// From GLM_GTX_matrix_interpolation extension. /// From GLM_GTX_matrix_interpolation extension.
template <typename T, precision P> template <typename T, precision P>
void axisAngle( GLM_FUNC_DECL void axisAngle(
detail::tmat4x4<T, P> const & mat, detail::tmat4x4<T, P> const & mat,
detail::tvec3<T, P> & axis, detail::tvec3<T, P> & axis,
T & angle); T & angle);
@ -61,21 +61,21 @@ namespace glm
/// Build a matrix from axis and angle. /// Build a matrix from axis and angle.
/// From GLM_GTX_matrix_interpolation extension. /// From GLM_GTX_matrix_interpolation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> axisAngleMatrix( GLM_FUNC_DECL detail::tmat4x4<T, P> axisAngleMatrix(
detail::tvec3<T, P> const & axis, detail::tvec3<T, P> const & axis,
T const angle); T const angle);
/// Extracts the rotation part of a matrix. /// Extracts the rotation part of a matrix.
/// From GLM_GTX_matrix_interpolation extension. /// From GLM_GTX_matrix_interpolation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> extractMatrixRotation( GLM_FUNC_DECL detail::tmat4x4<T, P> extractMatrixRotation(
detail::tmat4x4<T, P> const & mat); detail::tmat4x4<T, P> const & mat);
/// Build a interpolation of 4 * 4 matrixes. /// Build a interpolation of 4 * 4 matrixes.
/// From GLM_GTX_matrix_interpolation extension. /// From GLM_GTX_matrix_interpolation extension.
/// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> interpolate( GLM_FUNC_DECL detail::tmat4x4<T, P> interpolate(
detail::tmat4x4<T, P> const & m1, detail::tmat4x4<T, P> const & m1,
detail::tmat4x4<T, P> const & m2, detail::tmat4x4<T, P> const & m2,
T const delta); T const delta);

View File

@ -54,20 +54,20 @@ namespace glm
//! Build a row major matrix from row vectors. //! Build a row major matrix from row vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x2<T, P> rowMajor2( GLM_FUNC_DECL detail::tmat2x2<T, P> rowMajor2(
detail::tvec2<T, P> const & v1, detail::tvec2<T, P> const & v1,
detail::tvec2<T, P> const & v2); detail::tvec2<T, P> const & v2);
//! Build a row major matrix from other matrix. //! Build a row major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x2<T, P> rowMajor2( GLM_FUNC_DECL detail::tmat2x2<T, P> rowMajor2(
detail::tmat2x2<T, P> const & m); detail::tmat2x2<T, P> const & m);
//! Build a row major matrix from row vectors. //! Build a row major matrix from row vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> rowMajor3( GLM_FUNC_DECL detail::tmat3x3<T, P> rowMajor3(
detail::tvec3<T, P> const & v1, detail::tvec3<T, P> const & v1,
detail::tvec3<T, P> const & v2, detail::tvec3<T, P> const & v2,
detail::tvec3<T, P> const & v3); detail::tvec3<T, P> const & v3);
@ -75,13 +75,13 @@ namespace glm
//! Build a row major matrix from other matrix. //! Build a row major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> rowMajor3( GLM_FUNC_DECL detail::tmat3x3<T, P> rowMajor3(
detail::tmat3x3<T, P> const & m); detail::tmat3x3<T, P> const & m);
//! Build a row major matrix from row vectors. //! Build a row major matrix from row vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> rowMajor4( GLM_FUNC_DECL detail::tmat4x4<T, P> rowMajor4(
detail::tvec4<T, P> const & v1, detail::tvec4<T, P> const & v1,
detail::tvec4<T, P> const & v2, detail::tvec4<T, P> const & v2,
detail::tvec4<T, P> const & v3, detail::tvec4<T, P> const & v3,
@ -90,26 +90,26 @@ namespace glm
//! Build a row major matrix from other matrix. //! Build a row major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> rowMajor4( GLM_FUNC_DECL detail::tmat4x4<T, P> rowMajor4(
detail::tmat4x4<T, P> const & m); detail::tmat4x4<T, P> const & m);
//! Build a column major matrix from column vectors. //! Build a column major matrix from column vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x2<T, P> colMajor2( GLM_FUNC_DECL detail::tmat2x2<T, P> colMajor2(
detail::tvec2<T, P> const & v1, detail::tvec2<T, P> const & v1,
detail::tvec2<T, P> const & v2); detail::tvec2<T, P> const & v2);
//! Build a column major matrix from other matrix. //! Build a column major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x2<T, P> colMajor2( GLM_FUNC_DECL detail::tmat2x2<T, P> colMajor2(
detail::tmat2x2<T, P> const & m); detail::tmat2x2<T, P> const & m);
//! Build a column major matrix from column vectors. //! Build a column major matrix from column vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> colMajor3( GLM_FUNC_DECL detail::tmat3x3<T, P> colMajor3(
detail::tvec3<T, P> const & v1, detail::tvec3<T, P> const & v1,
detail::tvec3<T, P> const & v2, detail::tvec3<T, P> const & v2,
detail::tvec3<T, P> const & v3); detail::tvec3<T, P> const & v3);
@ -117,13 +117,13 @@ namespace glm
//! Build a column major matrix from other matrix. //! Build a column major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> colMajor3( GLM_FUNC_DECL detail::tmat3x3<T, P> colMajor3(
detail::tmat3x3<T, P> const & m); detail::tmat3x3<T, P> const & m);
//! Build a column major matrix from column vectors. //! Build a column major matrix from column vectors.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> colMajor4( GLM_FUNC_DECL detail::tmat4x4<T, P> colMajor4(
detail::tvec4<T, P> const & v1, detail::tvec4<T, P> const & v1,
detail::tvec4<T, P> const & v2, detail::tvec4<T, P> const & v2,
detail::tvec4<T, P> const & v3, detail::tvec4<T, P> const & v3,
@ -132,7 +132,7 @@ namespace glm
//! Build a column major matrix from other matrix. //! Build a column major matrix from other matrix.
//! From GLM_GTX_matrix_major_storage extension. //! From GLM_GTX_matrix_major_storage extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> colMajor4( GLM_FUNC_DECL detail::tmat4x4<T, P> colMajor4(
detail::tmat4x4<T, P> const & m); detail::tmat4x4<T, P> const & m);
/// @} /// @}

View File

@ -53,55 +53,55 @@ namespace glm
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x2<T, P> diagonal2x2( GLM_FUNC_DECL detail::tmat2x2<T, P> diagonal2x2(
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x3<T, P> diagonal2x3( GLM_FUNC_DECL detail::tmat2x3<T, P> diagonal2x3(
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat2x4<T, P> diagonal2x4( GLM_FUNC_DECL detail::tmat2x4<T, P> diagonal2x4(
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x2<T, P> diagonal3x2( GLM_FUNC_DECL detail::tmat3x2<T, P> diagonal3x2(
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> diagonal3x3( GLM_FUNC_DECL detail::tmat3x3<T, P> diagonal3x3(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x4<T, P> diagonal3x4( GLM_FUNC_DECL detail::tmat3x4<T, P> diagonal3x4(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x2<T, P> diagonal4x2( GLM_FUNC_DECL detail::tmat4x2<T, P> diagonal4x2(
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x3<T, P> diagonal4x3( GLM_FUNC_DECL detail::tmat4x3<T, P> diagonal4x3(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
//! Build a diagonal matrix. //! Build a diagonal matrix.
//! From GLM_GTX_matrix_operation extension. //! From GLM_GTX_matrix_operation extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> diagonal4x4( GLM_FUNC_DECL detail::tmat4x4<T, P> diagonal4x4(
detail::tvec4<T, P> const & v); detail::tvec4<T, P> const & v);
/// @} /// @}

View File

@ -56,42 +56,42 @@ namespace glm
/// Return whether a matrix a null matrix. /// Return whether a matrix a null matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNull(detail::tmat2x2<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNull(detail::tmat2x2<T, P> const & m, T const & epsilon);
/// Return whether a matrix a null matrix. /// Return whether a matrix a null matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNull(detail::tmat3x3<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNull(detail::tmat3x3<T, P> const & m, T const & epsilon);
/// Return whether a matrix is a null matrix. /// Return whether a matrix is a null matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNull(detail::tmat4x4<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNull(detail::tmat4x4<T, P> const & m, T const & epsilon);
/// Return whether a matrix is an identity matrix. /// Return whether a matrix is an identity matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template <typename, precision> class matType>
bool isIdentity(matType<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isIdentity(matType<T, P> const & m, T const & epsilon);
/// Return whether a matrix is a normalized matrix. /// Return whether a matrix is a normalized matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNormalized(detail::tmat2x2<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNormalized(detail::tmat2x2<T, P> const & m, T const & epsilon);
/// Return whether a matrix is a normalized matrix. /// Return whether a matrix is a normalized matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNormalized(detail::tmat3x3<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNormalized(detail::tmat3x3<T, P> const & m, T const & epsilon);
/// Return whether a matrix is a normalized matrix. /// Return whether a matrix is a normalized matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P> template<typename T, precision P>
bool isNormalized(detail::tmat4x4<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isNormalized(detail::tmat4x4<T, P> const & m, T const & epsilon);
/// Return whether a matrix is an orthonormalized matrix. /// Return whether a matrix is an orthonormalized matrix.
/// From GLM_GTX_matrix_query extension. /// From GLM_GTX_matrix_query extension.
template<typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template <typename, precision> class matType>
bool isOrthogonal(matType<T, P> const & m, T const & epsilon); GLM_FUNC_DECL bool isOrthogonal(matType<T, P> const & m, T const & epsilon);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -13,10 +13,7 @@
namespace glm namespace glm
{ {
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull GLM_FUNC_QUALIFIER bool isNull(detail::tmat2x2<T, P> const & m, T const & epsilon)
(
detail::tmat2x2<T, P> const & m,
T const & epsilon)
{ {
bool result = true; bool result = true;
for(length_t i = 0; result && i < 2 ; ++i) for(length_t i = 0; result && i < 2 ; ++i)
@ -25,11 +22,7 @@ namespace glm
} }
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull GLM_FUNC_QUALIFIER bool isNull(detail::tmat3x3<T, P> const & m, T const & epsilon)
(
detail::tmat3x3<T, P> const & m,
T const & epsilon
)
{ {
bool result = true; bool result = true;
for(length_t i = 0; result && i < 3 ; ++i) for(length_t i = 0; result && i < 3 ; ++i)
@ -38,11 +31,7 @@ namespace glm
} }
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNull GLM_FUNC_QUALIFIER bool isNull(detail::tmat4x4<T, P> const & m, T const & epsilon)
(
detail::tmat4x4<T, P> const & m,
T const & epsilon
)
{ {
bool result = true; bool result = true;
for(length_t i = 0; result && i < 4 ; ++i) for(length_t i = 0; result && i < 4 ; ++i)
@ -51,11 +40,7 @@ namespace glm
} }
template<typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER bool isIdentity GLM_FUNC_QUALIFIER bool isIdentity(matType<T, P> const & m, T const & epsilon)
(
matType<T, P> const & m,
T const & epsilon
)
{ {
bool result = true; bool result = true;
for(length_t i(0); result && i < m[0].length(); ++i) for(length_t i(0); result && i < m[0].length(); ++i)
@ -71,11 +56,7 @@ namespace glm
} }
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized GLM_FUNC_QUALIFIER bool isNormalized(detail::tmat2x2<T, P> const & m, T const & epsilon)
(
detail::tmat2x2<T, P> const & m,
T const & epsilon
)
{ {
bool result(true); bool result(true);
for(length_t i(0); result && i < m.length(); ++i) for(length_t i(0); result && i < m.length(); ++i)
@ -91,11 +72,7 @@ namespace glm
} }
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized GLM_FUNC_QUALIFIER bool isNormalized(detail::tmat3x3<T, P> const & m, T const & epsilon)
(
detail::tmat3x3<T, P> const & m,
T const & epsilon
)
{ {
bool result(true); bool result(true);
for(length_t i(0); result && i < m.length(); ++i) for(length_t i(0); result && i < m.length(); ++i)
@ -111,11 +88,7 @@ namespace glm
} }
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool isNormalized GLM_FUNC_QUALIFIER bool isNormalized(detail::tmat4x4<T, P> const & m, T const & epsilon)
(
detail::tmat4x4<T, P> const & m,
T const & epsilon
)
{ {
bool result(true); bool result(true);
for(length_t i(0); result && i < m.length(); ++i) for(length_t i(0); result && i < m.length(); ++i)
@ -131,11 +104,7 @@ namespace glm
} }
template<typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER bool isOrthogonal GLM_FUNC_QUALIFIER bool isOrthogonal(matType<T, P> const & m, T const & epsilon)
(
matType<T, P> const & m,
T const & epsilon
)
{ {
bool result(true); bool result(true);
for(length_t i(0); result && i < m.length() - 1; ++i) for(length_t i(0); result && i < m.length() - 1; ++i)

View File

@ -56,17 +56,17 @@ namespace glm
/// ///
/// @param m Input matrix multiplied by this translation matrix. /// @param m Input matrix multiplied by this translation matrix.
/// @param v Coordinates of a translation vector. /// @param v Coordinates of a translation vector.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> translate( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> translate(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
detail::tvec2<T, P> const & v); detail::tvec2<T, P> const & v);
/// Builds a rotation 3 * 3 matrix created from an angle. /// Builds a rotation 3 * 3 matrix created from an angle.
/// ///
/// @param m Input matrix multiplied by this translation matrix. /// @param m Input matrix multiplied by this translation matrix.
/// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise. /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> rotate( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> rotate(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & angle); T const & angle);
@ -84,7 +84,7 @@ namespace glm
/// @param m Input matrix multiplied by this translation matrix. /// @param m Input matrix multiplied by this translation matrix.
/// @param y Shear factor. /// @param y Shear factor.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearX( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearX(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & y); T const & y);
@ -93,7 +93,7 @@ namespace glm
/// @param m Input matrix multiplied by this translation matrix. /// @param m Input matrix multiplied by this translation matrix.
/// @param x Shear factor. /// @param x Shear factor.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearY( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearY(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & x); T const & x);

View File

@ -43,7 +43,7 @@ namespace glm
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> rotate( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> rotate(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & angle) T const & angle)
{ {
@ -55,7 +55,7 @@ namespace glm
T c = cos(a); T c = cos(a);
T s = sin(a); T s = sin(a);
detail::tmat3x3<T, P> Result(detail::tmat3x3<T, P>::_null); detail::tmat3x3<T, P> Result(detail::tmat3x3<T, P>::_null);
Result[0] = m[0] * c + m[1] * s; Result[0] = m[0] * c + m[1] * s;
Result[1] = m[0] * -s + m[1] * c; Result[1] = m[0] * -s + m[1] * c;
Result[2] = m[2]; Result[2] = m[2];
@ -67,15 +67,15 @@ namespace glm
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
detail::tvec2<T, P> const & v) detail::tvec2<T, P> const & v)
{ {
detail::tmat3x3<T, P> Result(detail::tmat3x3<T, P>::_null); detail::tmat3x3<T, P> Result(detail::tmat3x3<T, P>::_null);
Result[0] = m[0] * v[0]; Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1]; Result[1] = m[1] * v[1];
Result[2] = m[2]; Result[2] = m[2];
return Result; return Result;
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearX( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearX(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & y) T const & y)
{ {
@ -85,7 +85,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearY( GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> shearY(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T const & x) T const & x)
{ {

View File

@ -52,7 +52,7 @@ namespace glm
/// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension)
template <typename T, precision P> template <typename T, precision P>
T mixedProduct( GLM_FUNC_DECL T mixedProduct(
detail::tvec3<T, P> const & v1, detail::tvec3<T, P> const & v1,
detail::tvec3<T, P> const & v2, detail::tvec3<T, P> const & v2,
detail::tvec3<T, P> const & v3); detail::tvec3<T, P> const & v3);

View File

@ -59,7 +59,7 @@ namespace glm
/// ///
/// @see gtx_multiple /// @see gtx_multiple
template <typename genType> template <typename genType>
genType higherMultiple( GLM_FUNC_DECL genType higherMultiple(
genType const & Source, genType const & Source,
genType const & Multiple); genType const & Multiple);
@ -71,7 +71,7 @@ namespace glm
/// ///
/// @see gtx_multiple /// @see gtx_multiple
template <typename genType> template <typename genType>
genType lowerMultiple( GLM_FUNC_DECL genType lowerMultiple(
genType const & Source, genType const & Source,
genType const & Multiple); genType const & Multiple);

View File

@ -55,59 +55,59 @@ namespace glm
//! Returns the squared length of x. //! Returns the squared length of x.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T> template <typename T>
T length2( GLM_FUNC_DECL T length2(
T const & x); T const & x);
//! Returns the squared length of x. //! Returns the squared length of x.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename genType> template <typename genType>
typename genType::value_type length2( GLM_FUNC_DECL typename genType::value_type length2(
genType const & x); genType const & x);
//! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T> template <typename T>
T distance2( GLM_FUNC_DECL T distance2(
T const & p0, T const & p0,
T const & p1); T const & p1);
//! Returns the squared distance between p0 and p1, i.e., length(p0 - p1). //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename genType> template <typename genType>
typename genType::value_type distance2( GLM_FUNC_DECL typename genType::value_type distance2(
genType const & p0, genType const & p0,
genType const & p1); genType const & p1);
//! Returns the L1 norm between x and y. //! Returns the L1 norm between x and y.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T l1Norm( GLM_FUNC_DECL T l1Norm(
detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y); detail::tvec3<T, P> const & y);
//! Returns the L1 norm of v. //! Returns the L1 norm of v.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T l1Norm( GLM_FUNC_DECL T l1Norm(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
//! Returns the L2 norm between x and y. //! Returns the L2 norm between x and y.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T l2Norm( GLM_FUNC_DECL T l2Norm(
detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y); detail::tvec3<T, P> const & y);
//! Returns the L2 norm of v. //! Returns the L2 norm of v.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T l2Norm( GLM_FUNC_DECL T l2Norm(
detail::tvec3<T, P> const & x); detail::tvec3<T, P> const & x);
//! Returns the L norm between x and y. //! Returns the L norm between x and y.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T lxNorm( GLM_FUNC_DECL T lxNorm(
detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y, detail::tvec3<T, P> const & y,
unsigned int Depth); unsigned int Depth);
@ -115,7 +115,7 @@ namespace glm
//! Returns the L norm of v. //! Returns the L norm of v.
//! From GLM_GTX_norm extension. //! From GLM_GTX_norm extension.
template <typename T, precision P> template <typename T, precision P>
T lxNorm( GLM_FUNC_DECL T lxNorm(
detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & x,
unsigned int Depth); unsigned int Depth);

View File

@ -53,8 +53,8 @@ namespace glm
//! Computes triangle normal from triangle points. //! Computes triangle normal from triangle points.
//! From GLM_GTX_normal extension. //! From GLM_GTX_normal extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> triangleNormal( GLM_FUNC_DECL detail::tvec3<T, P> triangleNormal(
detail::tvec3<T, P> const & p1, detail::tvec3<T, P> const & p1,
detail::tvec3<T, P> const & p2, detail::tvec3<T, P> const & p2,
detail::tvec3<T, P> const & p3); detail::tvec3<T, P> const & p3);

View File

@ -56,7 +56,7 @@ namespace glm
//! It's faster that dot(normalize(x), normalize(y)). //! It's faster that dot(normalize(x), normalize(y)).
//! From GLM_GTX_normalize_dot extension. //! From GLM_GTX_normalize_dot extension.
template <typename genType> template <typename genType>
typename genType::value_type normalizeDot( GLM_FUNC_DECL typename genType::value_type normalizeDot(
genType const & x, genType const & x,
genType const & y); genType const & y);
@ -64,7 +64,7 @@ namespace glm
//! Faster that dot(fastNormalize(x), fastNormalize(y)). //! Faster that dot(fastNormalize(x), fastNormalize(y)).
//! From GLM_GTX_normalize_dot extension. //! From GLM_GTX_normalize_dot extension.
template <typename genType> template <typename genType>
typename genType::value_type fastNormalizeDot( GLM_FUNC_DECL typename genType::value_type fastNormalizeDot(
genType const & x, genType const & x,
genType const & y); genType const & y);

View File

@ -54,36 +54,36 @@ namespace gtx
//! Returns x raised to the power of 2. //! Returns x raised to the power of 2.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <typename genType> template <typename genType>
genType pow2(const genType& x); GLM_FUNC_DECL genType pow2(const genType& x);
//! Returns x raised to the power of 3. //! Returns x raised to the power of 3.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <typename genType> template <typename genType>
genType pow3(const genType& x); GLM_FUNC_DECL genType pow3(const genType& x);
//! Returns x raised to the power of 4. //! Returns x raised to the power of 4.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <typename genType> template <typename genType>
genType pow4(const genType& x); GLM_FUNC_DECL genType pow4(const genType& x);
//! Checks if the parameter is a power of 2 number. //! Checks if the parameter is a power of 2 number.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
bool powOfTwo(int num); GLM_FUNC_DECL bool powOfTwo(int num);
//! Checks to determine if the parameter component are power of 2 numbers. //! Checks to determine if the parameter component are power of 2 numbers.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <precision P> template <precision P>
detail::tvec2<bool, P> powOfTwo(detail::tvec2<int, P> const & x); GLM_FUNC_DECL detail::tvec2<bool, P> powOfTwo(detail::tvec2<int, P> const & x);
//! Checks to determine if the parameter component are power of 2 numbers. //! Checks to determine if the parameter component are power of 2 numbers.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <precision P> template <precision P>
detail::tvec3<bool, P> powOfTwo(detail::tvec3<int, P> const & x); GLM_FUNC_DECL detail::tvec3<bool, P> powOfTwo(detail::tvec3<int, P> const & x);
//! Checks to determine if the parameter component are power of 2 numbers. //! Checks to determine if the parameter component are power of 2 numbers.
//! From GLM_GTX_optimum_pow extension. //! From GLM_GTX_optimum_pow extension.
template <precision P> template <precision P>
detail::tvec4<bool, P> powOfTwo(detail::tvec4<int, P> const & x); GLM_FUNC_DECL detail::tvec4<bool, P> powOfTwo(detail::tvec4<int, P> const & x);
/// @} /// @}
}//namespace gtx }//namespace gtx

View File

@ -54,13 +54,13 @@ namespace glm
//! Returns the orthonormalized matrix of m. //! Returns the orthonormalized matrix of m.
//! From GLM_GTX_orthonormalize extension. //! From GLM_GTX_orthonormalize extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> orthonormalize( GLM_FUNC_DECL detail::tmat3x3<T, P> orthonormalize(
const detail::tmat3x3<T, P>& m); const detail::tmat3x3<T, P>& m);
//! Orthonormalizes x according y. //! Orthonormalizes x according y.
//! From GLM_GTX_orthonormalize extension. //! From GLM_GTX_orthonormalize extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> orthonormalize( GLM_FUNC_DECL detail::tvec3<T, P> orthonormalize(
const detail::tvec3<T, P>& x, const detail::tvec3<T, P>& x,
const detail::tvec3<T, P>& y); const detail::tvec3<T, P>& y);

View File

@ -55,7 +55,7 @@ namespace glm
//! Projects x a perpendicular axis of Normal. //! Projects x a perpendicular axis of Normal.
//! From GLM_GTX_perpendicular extension. //! From GLM_GTX_perpendicular extension.
template <typename vecType> template <typename vecType>
vecType perp( GLM_FUNC_DECL vecType perp(
vecType const & x, vecType const & x,
vecType const & Normal); vecType const & Normal);

View File

@ -54,14 +54,14 @@ namespace glm
/// ///
/// @see gtx_polar_coordinates /// @see gtx_polar_coordinates
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> polar( GLM_FUNC_DECL detail::tvec3<T, P> polar(
detail::tvec3<T, P> const & euclidean); detail::tvec3<T, P> const & euclidean);
/// Convert Polar to Euclidean coordinates. /// Convert Polar to Euclidean coordinates.
/// ///
/// @see gtx_polar_coordinates /// @see gtx_polar_coordinates
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> euclidean( GLM_FUNC_DECL detail::tvec3<T, P> euclidean(
detail::tvec2<T, P> const & polar); detail::tvec2<T, P> const & polar);
/// @} /// @}

View File

@ -53,7 +53,7 @@ namespace glm
//! Projects x on Normal. //! Projects x on Normal.
//! From GLM_GTX_projection extension. //! From GLM_GTX_projection extension.
template <typename vecType> template <typename vecType>
vecType proj( GLM_FUNC_DECL vecType proj(
vecType const & x, vecType const & x,
vecType const & Normal); vecType const & Normal);

View File

@ -58,7 +58,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tvec3<T, P> cross( GLM_FUNC_DECL detail::tvec3<T, P> cross(
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
@ -66,7 +66,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tvec3<T, P> cross( GLM_FUNC_DECL detail::tvec3<T, P> cross(
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
@ -75,7 +75,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> squad( GLM_FUNC_DECL detail::tquat<T, P> squad(
detail::tquat<T, P> const & q1, detail::tquat<T, P> const & q1,
detail::tquat<T, P> const & q2, detail::tquat<T, P> const & q2,
detail::tquat<T, P> const & s1, detail::tquat<T, P> const & s1,
@ -86,7 +86,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> intermediate( GLM_FUNC_DECL detail::tquat<T, P> intermediate(
detail::tquat<T, P> const & prev, detail::tquat<T, P> const & prev,
detail::tquat<T, P> const & curr, detail::tquat<T, P> const & curr,
detail::tquat<T, P> const & next); detail::tquat<T, P> const & next);
@ -95,21 +95,21 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> exp( GLM_FUNC_DECL detail::tquat<T, P> exp(
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
//! Returns a log of a quaternion. //! Returns a log of a quaternion.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> log( GLM_FUNC_DECL detail::tquat<T, P> log(
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
/// Returns x raised to the y power. /// Returns x raised to the y power.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> pow( GLM_FUNC_DECL detail::tquat<T, P> pow(
detail::tquat<T, P> const & x, detail::tquat<T, P> const & x,
T const & y); T const & y);
@ -124,7 +124,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tvec3<T, P> rotate( GLM_FUNC_DECL detail::tvec3<T, P> rotate(
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
@ -132,7 +132,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tvec4<T, P> rotate( GLM_FUNC_DECL detail::tvec4<T, P> rotate(
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
detail::tvec4<T, P> const & v); detail::tvec4<T, P> const & v);
@ -140,42 +140,42 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
T extractRealComponent( GLM_FUNC_DECL T extractRealComponent(
detail::tquat<T, P> const & q); detail::tquat<T, P> const & q);
/// Converts a quaternion to a 3 * 3 matrix. /// Converts a quaternion to a 3 * 3 matrix.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tmat3x3<T, P> toMat3( GLM_FUNC_DECL detail::tmat3x3<T, P> toMat3(
detail::tquat<T, P> const & x){return mat3_cast(x);} detail::tquat<T, P> const & x){return mat3_cast(x);}
/// Converts a quaternion to a 4 * 4 matrix. /// Converts a quaternion to a 4 * 4 matrix.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tmat4x4<T, P> toMat4( GLM_FUNC_DECL detail::tmat4x4<T, P> toMat4(
detail::tquat<T, P> const & x){return mat4_cast(x);} detail::tquat<T, P> const & x){return mat4_cast(x);}
/// Converts a 3 * 3 matrix to a quaternion. /// Converts a 3 * 3 matrix to a quaternion.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> toQuat( GLM_FUNC_DECL detail::tquat<T, P> toQuat(
detail::tmat3x3<T, P> const & x){return quat_cast(x);} detail::tmat3x3<T, P> const & x){return quat_cast(x);}
/// Converts a 4 * 4 matrix to a quaternion. /// Converts a 4 * 4 matrix to a quaternion.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> toQuat( GLM_FUNC_DECL detail::tquat<T, P> toQuat(
detail::tmat4x4<T, P> const & x){return quat_cast(x);} detail::tmat4x4<T, P> const & x){return quat_cast(x);}
/// Quaternion interpolation using the rotation short path. /// Quaternion interpolation using the rotation short path.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> shortMix( GLM_FUNC_DECL detail::tquat<T, P> shortMix(
detail::tquat<T, P> const & x, detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y, detail::tquat<T, P> const & y,
T const & a); T const & a);
@ -184,7 +184,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> fastMix( GLM_FUNC_DECL detail::tquat<T, P> fastMix(
detail::tquat<T, P> const & x, detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y, detail::tquat<T, P> const & y,
T const & a); T const & a);
@ -195,7 +195,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
detail::tquat<T, P> rotation( GLM_FUNC_DECL detail::tquat<T, P> rotation(
detail::tvec3<T, P> const & orig, detail::tvec3<T, P> const & orig,
detail::tvec3<T, P> const & dest); detail::tvec3<T, P> const & dest);
@ -203,7 +203,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, precision P> template<typename T, precision P>
T length2(detail::tquat<T, P> const & q); GLM_FUNC_DECL T length2(detail::tquat<T, P> const & q);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -66,7 +66,7 @@ namespace glm
/// @see - rotate(detail::tmat4x4<T, P> const & m, T angle, T x, T y, T z) /// @see - rotate(detail::tmat4x4<T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, detail::tvec3<T, P> const & v) /// @see - rotate(T angle, detail::tvec3<T, P> const & v)
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> rotateNormalizedAxis( GLM_FUNC_DECL detail::tmat4x4<T, P> rotateNormalizedAxis(
detail::tmat4x4<T, P> const & m, detail::tmat4x4<T, P> const & m,
T const & angle, T const & angle,
detail::tvec3<T, P> const & axis); detail::tvec3<T, P> const & axis);
@ -79,7 +79,7 @@ namespace glm
/// ///
/// @see gtx_rotate_normalized_axis /// @see gtx_rotate_normalized_axis
template <typename T, precision P> template <typename T, precision P>
detail::tquat<T, P> rotateNormalizedAxis( GLM_FUNC_DECL detail::tquat<T, P> rotateNormalizedAxis(
detail::tquat<T, P> const & q, detail::tquat<T, P> const & q,
T const & angle, T const & angle,
detail::tvec3<T, P> const & axis); detail::tvec3<T, P> const & axis);

View File

@ -55,14 +55,14 @@ namespace glm
//! Rotate a two dimensional vector. //! Rotate a two dimensional vector.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec2<T, P> rotate( GLM_FUNC_DECL detail::tvec2<T, P> rotate(
detail::tvec2<T, P> const & v, detail::tvec2<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a three dimensional vector around an axis. //! Rotate a three dimensional vector around an axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rotate( GLM_FUNC_DECL detail::tvec3<T, P> rotate(
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
T const & angle, T const & angle,
detail::tvec3<T, P> const & normal); detail::tvec3<T, P> const & normal);
@ -70,7 +70,7 @@ namespace glm
//! Rotate a four dimensional vector around an axis. //! Rotate a four dimensional vector around an axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> rotate( GLM_FUNC_DECL detail::tvec4<T, P> rotate(
detail::tvec4<T, P> const & v, detail::tvec4<T, P> const & v,
T const & angle, T const & angle,
detail::tvec3<T, P> const & normal); detail::tvec3<T, P> const & normal);
@ -78,49 +78,49 @@ namespace glm
//! Rotate a three dimensional vector around the X axis. //! Rotate a three dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rotateX( GLM_FUNC_DECL detail::tvec3<T, P> rotateX(
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a three dimensional vector around the Y axis. //! Rotate a three dimensional vector around the Y axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rotateY( GLM_FUNC_DECL detail::tvec3<T, P> rotateY(
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a three dimensional vector around the Z axis. //! Rotate a three dimensional vector around the Z axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec3<T, P> rotateZ( GLM_FUNC_DECL detail::tvec3<T, P> rotateZ(
detail::tvec3<T, P> const & v, detail::tvec3<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a four dimentionnals vector around the X axis. //! Rotate a four dimentionnals vector around the X axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> rotateX( GLM_FUNC_DECL detail::tvec4<T, P> rotateX(
detail::tvec4<T, P> const & v, detail::tvec4<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a four dimensional vector around the X axis. //! Rotate a four dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> rotateY( GLM_FUNC_DECL detail::tvec4<T, P> rotateY(
detail::tvec4<T, P> const & v, detail::tvec4<T, P> const & v,
T const & angle); T const & angle);
//! Rotate a four dimensional vector around the X axis. //! Rotate a four dimensional vector around the X axis.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tvec4<T, P> rotateZ( GLM_FUNC_DECL detail::tvec4<T, P> rotateZ(
detail::tvec4<T, P> const & v, detail::tvec4<T, P> const & v,
T const & angle); T const & angle);
//! Build a rotation matrix from a normal and a up vector. //! Build a rotation matrix from a normal and a up vector.
//! From GLM_GTX_rotate_vector extension. //! From GLM_GTX_rotate_vector extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> orientation( GLM_FUNC_DECL detail::tmat4x4<T, P> orientation(
detail::tvec3<T, P> const & Normal, detail::tvec3<T, P> const & Normal,
detail::tvec3<T, P> const & Up); detail::tvec3<T, P> const & Up);

View File

@ -59,7 +59,7 @@ namespace glm
/// Create a string from a GLM type value. /// Create a string from a GLM type value.
/// @see gtx_string_cast extension. /// @see gtx_string_cast extension.
template <typename genType> template <typename genType>
std::string to_string(genType const & x); GLM_FUNC_DECL std::string to_string(genType const & x);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -58,14 +58,14 @@ namespace glm
/// - From \link gtx_transform GLM_GTX_transform \endlink extension /// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::translate GLM_GTC_matrix_transform \endlink /// - See also: \link glm::translate GLM_GTC_matrix_transform \endlink
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> translate( GLM_FUNC_DECL detail::tmat4x4<T, P> translate(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees.
/// - From \link gtx_transform GLM_GTX_transform \endlink extension /// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink /// - See also: \link glm::rotate GLM_GTC_matrix_transform \endlink
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> rotate( GLM_FUNC_DECL detail::tmat4x4<T, P> rotate(
T angle, T angle,
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
@ -73,7 +73,7 @@ namespace glm
/// - From \link gtx_transform GLM_GTX_transform \endlink extension /// - From \link gtx_transform GLM_GTX_transform \endlink extension
/// - See also: \link glm::scale GLM_GTC_matrix_transform \endlink /// - See also: \link glm::scale GLM_GTC_matrix_transform \endlink
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> scale( GLM_FUNC_DECL detail::tmat4x4<T, P> scale(
detail::tvec3<T, P> const & v); detail::tvec3<T, P> const & v);
/// @} /// @}

View File

@ -55,21 +55,21 @@ namespace glm
//! Transforms a matrix with a shearing on X axis. //! Transforms a matrix with a shearing on X axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> shearX2D( GLM_FUNC_DECL detail::tmat3x3<T, P> shearX2D(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T y); T y);
//! Transforms a matrix with a shearing on Y axis. //! Transforms a matrix with a shearing on Y axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> shearY2D( GLM_FUNC_DECL detail::tmat3x3<T, P> shearY2D(
detail::tmat3x3<T, P> const & m, detail::tmat3x3<T, P> const & m,
T x); T x);
//! Transforms a matrix with a shearing on X axis //! Transforms a matrix with a shearing on X axis
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> shearX3D( GLM_FUNC_DECL detail::tmat4x4<T, P> shearX3D(
const detail::tmat4x4<T, P> & m, const detail::tmat4x4<T, P> & m,
T y, T y,
T z); T z);
@ -77,7 +77,7 @@ namespace glm
//! Transforms a matrix with a shearing on Y axis. //! Transforms a matrix with a shearing on Y axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> shearY3D( GLM_FUNC_DECL detail::tmat4x4<T, P> shearY3D(
const detail::tmat4x4<T, P> & m, const detail::tmat4x4<T, P> & m,
T x, T x,
T z); T z);
@ -85,7 +85,7 @@ namespace glm
//! Transforms a matrix with a shearing on Z axis. //! Transforms a matrix with a shearing on Z axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> shearZ3D( GLM_FUNC_DECL detail::tmat4x4<T, P> shearZ3D(
const detail::tmat4x4<T, P> & m, const detail::tmat4x4<T, P> & m,
T x, T x,
T y); T y);
@ -101,28 +101,28 @@ namespace glm
//! Build planar projection matrix along normal axis. //! Build planar projection matrix along normal axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat3x3<T, P> proj2D( GLM_FUNC_DECL detail::tmat3x3<T, P> proj2D(
const detail::tmat3x3<T, P> & m, const detail::tmat3x3<T, P> & m,
const detail::tvec3<T, P>& normal); const detail::tvec3<T, P>& normal);
//! Build planar projection matrix along normal axis. //! Build planar projection matrix along normal axis.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename T, precision P> template <typename T, precision P>
detail::tmat4x4<T, P> proj3D( GLM_FUNC_DECL detail::tmat4x4<T, P> proj3D(
const detail::tmat4x4<T, P> & m, const detail::tmat4x4<T, P> & m,
const detail::tvec3<T, P>& normal); const detail::tvec3<T, P>& normal);
//! Build a scale bias matrix. //! Build a scale bias matrix.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename valType, precision P> template <typename valType, precision P>
detail::tmat4x4<valType, P> scaleBias( GLM_FUNC_DECL detail::tmat4x4<valType, P> scaleBias(
valType scale, valType scale,
valType bias); valType bias);
//! Build a scale bias matrix. //! Build a scale bias matrix.
//! From GLM_GTX_transform2 extension. //! From GLM_GTX_transform2 extension.
template <typename valType, precision P> template <typename valType, precision P>
detail::tmat4x4<valType, P> scaleBias( GLM_FUNC_DECL detail::tmat4x4<valType, P> scaleBias(
detail::tmat4x4<valType, P> const & m, detail::tmat4x4<valType, P> const & m,
valType scale, valType scale,
valType bias); valType bias);

View File

@ -59,7 +59,7 @@ namespace glm
//! Parameters need to be normalized. //! Parameters need to be normalized.
/// @see gtx_vector_angle extension /// @see gtx_vector_angle extension
template <typename vecType> template <typename vecType>
GLM_FUNC_QUALIFIER typename vecType::value_type angle( GLM_FUNC_DECL typename vecType::value_type angle(
vecType const & x, vecType const & x,
vecType const & y); vecType const & y);
@ -67,7 +67,7 @@ namespace glm
//! Parameters need to be normalized. //! Parameters need to be normalized.
/// @see gtx_vector_angle extension. /// @see gtx_vector_angle extension.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T orientedAngle( GLM_FUNC_DECL T orientedAngle(
detail::tvec2<T, P> const & x, detail::tvec2<T, P> const & x,
detail::tvec2<T, P> const & y); detail::tvec2<T, P> const & y);
@ -75,7 +75,7 @@ namespace glm
//! Parameters need to be normalized. //! Parameters need to be normalized.
/// @see gtx_vector_angle extension. /// @see gtx_vector_angle extension.
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T orientedAngle( GLM_FUNC_DECL T orientedAngle(
detail::tvec3<T, P> const & x, detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y, detail::tvec3<T, P> const & y,
detail::tvec3<T, P> const & ref); detail::tvec3<T, P> const & ref);

View File

@ -55,32 +55,32 @@ namespace glm
//! Check whether two vectors are collinears. //! Check whether two vectors are collinears.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
bool areCollinear(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); GLM_FUNC_DECL bool areCollinear(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
//! Check whether two vectors are orthogonals. //! Check whether two vectors are orthogonals.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
bool areOrthogonal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); GLM_FUNC_DECL bool areOrthogonal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
//! Check whether a vector is normalized. //! Check whether a vector is normalized.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
bool isNormalized(vecType<T, P> const & v, T const & epsilon); GLM_FUNC_DECL bool isNormalized(vecType<T, P> const & v, T const & epsilon);
//! Check whether a vector is null. //! Check whether a vector is null.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
bool isNull(vecType<T, P> const & v, T const & epsilon); GLM_FUNC_DECL bool isNull(vecType<T, P> const & v, T const & epsilon);
//! Check whether a each component of a vector is null. //! Check whether a each component of a vector is null.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
vecType<bool, P> isCompNull(vecType<T, P> const & v, T const & epsilon); GLM_FUNC_DECL vecType<bool, P> isCompNull(vecType<T, P> const & v, T const & epsilon);
//! Check whether two vectors are orthonormal. //! Check whether two vectors are orthonormal.
/// @see gtx_vector_query extensions. /// @see gtx_vector_query extensions.
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
bool areOrthonormal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon); GLM_FUNC_DECL bool areOrthonormal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
/// @} /// @}
}// namespace glm }// namespace glm

View File

@ -21,7 +21,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_areCollinear<T, P, tvec2> struct compute_areCollinear<T, P, tvec2>
{ {
static bool call(detail::tvec2<T, P> const & v0, detail::tvec2<T, P> const & v1, T const & epsilon) GLM_FUNC_QUALIFIER static bool call(detail::tvec2<T, P> const & v0, detail::tvec2<T, P> const & v1, T const & epsilon)
{ {
return length(cross(detail::tvec3<T, P>(v0, static_cast<T>(0)), detail::tvec3<T, P>(v1, static_cast<T>(0)))) < epsilon; return length(cross(detail::tvec3<T, P>(v0, static_cast<T>(0)), detail::tvec3<T, P>(v1, static_cast<T>(0)))) < epsilon;
} }
@ -30,7 +30,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_areCollinear<T, P, tvec3> struct compute_areCollinear<T, P, tvec3>
{ {
static bool call(detail::tvec3<T, P> const & v0, detail::tvec3<T, P> const & v1, T const & epsilon) GLM_FUNC_QUALIFIER static bool call(detail::tvec3<T, P> const & v0, detail::tvec3<T, P> const & v1, T const & epsilon)
{ {
return length(cross(v0, v1)) < epsilon; return length(cross(v0, v1)) < epsilon;
} }
@ -39,7 +39,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_areCollinear<T, P, tvec4> struct compute_areCollinear<T, P, tvec4>
{ {
static bool call(detail::tvec4<T, P> const & v0, detail::tvec4<T, P> const & v1, T const & epsilon) GLM_FUNC_QUALIFIER static bool call(detail::tvec4<T, P> const & v0, detail::tvec4<T, P> const & v1, T const & epsilon)
{ {
return length(cross(detail::tvec3<T, P>(v0), detail::tvec3<T, P>(v1))) < epsilon; return length(cross(detail::tvec3<T, P>(v0), detail::tvec3<T, P>(v1))) < epsilon;
} }
@ -51,7 +51,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_isCompNull<T, P, tvec2> struct compute_isCompNull<T, P, tvec2>
{ {
static detail::tvec2<bool, P> call(detail::tvec2<T, P> const & v, T const & epsilon) GLM_FUNC_QUALIFIER static detail::tvec2<bool, P> call(detail::tvec2<T, P> const & v, T const & epsilon)
{ {
return detail::tvec2<bool, P>( return detail::tvec2<bool, P>(
(abs(v.x) < epsilon), (abs(v.x) < epsilon),
@ -62,7 +62,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_isCompNull<T, P, tvec3> struct compute_isCompNull<T, P, tvec3>
{ {
static detail::tvec3<bool, P> call(detail::tvec3<T, P> const & v, T const & epsilon) GLM_FUNC_QUALIFIER static detail::tvec3<bool, P> call(detail::tvec3<T, P> const & v, T const & epsilon)
{ {
return detail::tvec3<bool, P>( return detail::tvec3<bool, P>(
(abs(v.x) < epsilon), (abs(v.x) < epsilon),
@ -74,7 +74,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_isCompNull<T, P, tvec4> struct compute_isCompNull<T, P, tvec4>
{ {
static detail::tvec4<bool, P> call(detail::tvec4<T, P> const & v, T const & epsilon) GLM_FUNC_QUALIFIER static detail::tvec4<bool, P> call(detail::tvec4<T, P> const & v, T const & epsilon)
{ {
return detail::tvec4<bool, P>( return detail::tvec4<bool, P>(
(abs(v.x) < epsilon), (abs(v.x) < epsilon),