Add GLM_NOEXCEPT to most gtc functions

This commit is contained in:
Jesse Talavera-Greenberg 2015-09-11 19:32:48 -04:00
parent f7f1239bb7
commit b633ead29f
25 changed files with 527 additions and 526 deletions

View File

@ -62,173 +62,173 @@ namespace glm
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType mask(genIUType Bits);
GLM_FUNC_DECL genIUType mask(genIUType Bits) GLM_NOEXCEPT;
/// Build a mask of 'count' bits /// Build a mask of 'count' bits
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecIUType> template <typename T, precision P, template <typename, precision> class vecIUType>
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v); GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v) GLM_NOEXCEPT;
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift) GLM_NOEXCEPT;
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift); GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift) GLM_NOEXCEPT;
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift) GLM_NOEXCEPT;
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift); GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift) GLM_NOEXCEPT;
/// Set to 1 a range of bits. /// Set to 1 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) GLM_NOEXCEPT;
/// Set to 1 a range of bits. /// Set to 1 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount); GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_NOEXCEPT;
/// Set to 0 a range of bits. /// Set to 0 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) GLM_NOEXCEPT;
/// Set to 0 a range of bits. /// Set to 0 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount); GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y) GLM_NOEXCEPT;
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y and z. /// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z. /// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) GLM_NOEXCEPT;
/// Interleaves the bits of x, y, z and w. /// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) GLM_NOEXCEPT;
/// Interleaves the bits of x, y, z and w. /// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) GLM_NOEXCEPT;
/// Interleaves the bits of x, y, z and w. /// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) GLM_NOEXCEPT;
/// Interleaves the bits of x, y, z and w. /// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence. /// The other bits are interleaved following the previous sequence.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) GLM_NOEXCEPT;
/// @} /// @}
} //namespace glm } //namespace glm

View File

@ -34,16 +34,16 @@ namespace glm{
namespace detail namespace detail
{ {
template <typename PARAM, typename RET> template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y) GLM_NOEXCEPT;
template <typename PARAM, typename RET> template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z) GLM_NOEXCEPT;
template <typename PARAM, typename RET> template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w) GLM_NOEXCEPT;
template <> template <>
GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) GLM_NOEXCEPT
{ {
glm::uint16 REG1(x); glm::uint16 REG1(x);
glm::uint16 REG2(y); glm::uint16 REG2(y);
@ -61,7 +61,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) GLM_NOEXCEPT
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
glm::uint32 REG2(y); glm::uint32 REG2(y);
@ -82,7 +82,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) GLM_NOEXCEPT
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
glm::uint64 REG2(y); glm::uint64 REG2(y);
@ -106,7 +106,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) GLM_NOEXCEPT
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
glm::uint32 REG2(y); glm::uint32 REG2(y);
@ -132,7 +132,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) GLM_NOEXCEPT
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
glm::uint64 REG2(y); glm::uint64 REG2(y);
@ -162,7 +162,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) GLM_NOEXCEPT
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
glm::uint64 REG2(y); glm::uint64 REG2(y);
@ -192,7 +192,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) GLM_NOEXCEPT
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
glm::uint32 REG2(y); glm::uint32 REG2(y);
@ -218,7 +218,7 @@ namespace detail
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) GLM_NOEXCEPT
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
glm::uint64 REG2(y); glm::uint64 REG2(y);
@ -250,7 +250,7 @@ namespace detail
}//namespace detail }//namespace detail
template <typename genIUType> template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values");
@ -258,7 +258,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecIUType> template <typename T, precision P, template <typename, precision> class vecIUType>
GLM_FUNC_QUALIFIER vecIUType<T, P> mask(vecIUType<T, P> const & v) GLM_FUNC_QUALIFIER vecIUType<T, P> mask(vecIUType<T, P> const & v) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
@ -266,7 +266,7 @@ namespace detail
} }
template <typename genIType> template <typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values");
@ -275,7 +275,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift) GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
@ -284,7 +284,7 @@ namespace detail
} }
template <typename genIType> template <typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
@ -293,7 +293,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift) GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
@ -302,30 +302,30 @@ namespace detail
} }
template <typename genIUType> template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) GLM_NOEXCEPT
{ {
return Value | static_cast<genIUType>(mask(BitCount) << FirstBit); return Value | static_cast<genIUType>(mask(BitCount) << FirstBit);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_NOEXCEPT
{ {
return Value | static_cast<T>(mask(BitCount) << FirstBit); return Value | static_cast<T>(mask(BitCount) << FirstBit);
} }
template <typename genIUType> template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) GLM_NOEXCEPT
{ {
return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit)); return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit));
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount) GLM_NOEXCEPT
{ {
return Value & static_cast<T>(~(mask(BitCount) << FirstBit)); return Value & static_cast<T>(~(mask(BitCount) << FirstBit));
} }
GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) GLM_NOEXCEPT
{ {
union sign8 union sign8
{ {
@ -346,12 +346,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint8, uint16>(x, y); return detail::bitfieldInterleave<uint8, uint16>(x, y);
} }
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) GLM_NOEXCEPT
{ {
union sign16 union sign16
{ {
@ -372,12 +372,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint16, uint32>(x, y); return detail::bitfieldInterleave<uint16, uint32>(x, y);
} }
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) GLM_NOEXCEPT
{ {
union sign32 union sign32
{ {
@ -398,12 +398,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint32, uint64>(x, y); return detail::bitfieldInterleave<uint32, uint64>(x, y);
} }
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) GLM_NOEXCEPT
{ {
union sign8 union sign8
{ {
@ -425,12 +425,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint8, uint32>(x, y, z); return detail::bitfieldInterleave<uint8, uint32>(x, y, z);
} }
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) GLM_NOEXCEPT
{ {
union sign16 union sign16
{ {
@ -452,12 +452,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint32, uint64>(x, y, z); return detail::bitfieldInterleave<uint32, uint64>(x, y, z);
} }
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) GLM_NOEXCEPT
{ {
union sign16 union sign16
{ {
@ -479,12 +479,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint32, uint64>(x, y, z); return detail::bitfieldInterleave<uint32, uint64>(x, y, z);
} }
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) GLM_NOEXCEPT
{ {
union sign8 union sign8
{ {
@ -507,12 +507,12 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint8, uint32>(x, y, z, w); return detail::bitfieldInterleave<uint8, uint32>(x, y, z, w);
} }
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) GLM_NOEXCEPT
{ {
union sign16 union sign16
{ {
@ -535,7 +535,7 @@ namespace detail
return result.i; return result.i;
} }
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) GLM_NOEXCEPT
{ {
return detail::bitfieldInterleave<uint16, uint64>(x, y, z, w); return detail::bitfieldInterleave<uint16, uint64>(x, y, z, w);
} }

View File

@ -61,19 +61,19 @@ namespace glm
/// Convert a linear color to sRGB color using a standard gamma correction /// Convert a linear color to sRGB color using a standard gamma correction
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear); GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear) GLM_NOEXCEPT;
/// Convert a linear color to sRGB color using a custom gamma correction /// Convert a linear color to sRGB color using a custom gamma correction
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma); GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma) GLM_NOEXCEPT;
/// Convert a sRGB color to linear color using a standard gamma correction /// Convert a sRGB color to linear color using a standard gamma correction
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB); GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB) GLM_NOEXCEPT;
/// Convert a sRGB color to linear color using a custom gamma correction /// Convert a sRGB color to linear color using a custom gamma correction
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma); GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma) GLM_NOEXCEPT;
/// @} /// @}
} //namespace glm } //namespace glm

View File

@ -36,7 +36,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
struct compute_rgbToSrgb struct compute_rgbToSrgb
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & ColorRGB, T GammaCorrection) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & ColorRGB, T GammaCorrection) GLM_NOEXCEPT
{ {
vecType<T, P> const ClampedColor(clamp(ColorRGB, static_cast<T>(0), static_cast<T>(1))); vecType<T, P> const ClampedColor(clamp(ColorRGB, static_cast<T>(0), static_cast<T>(1)));
@ -50,7 +50,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_rgbToSrgb<T, P, tvec4> struct compute_rgbToSrgb<T, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const & ColorRGB, T GammaCorrection) GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const & ColorRGB, T GammaCorrection) GLM_NOEXCEPT
{ {
return tvec4<T, P>(compute_rgbToSrgb<T, P, tvec3>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a); return tvec4<T, P>(compute_rgbToSrgb<T, P, tvec3>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
} }
@ -59,7 +59,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
struct compute_srgbToRgb struct compute_srgbToRgb
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & ColorSRGB, T Gamma) GLM_NOEXCEPT
{ {
return mix( return mix(
pow((ColorSRGB + static_cast<T>(0.055)) * static_cast<T>(0.94786729857819905213270142180095), vecType<T, P>(Gamma)), pow((ColorSRGB + static_cast<T>(0.055)) * static_cast<T>(0.94786729857819905213270142180095), vecType<T, P>(Gamma)),
@ -71,7 +71,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_srgbToRgb<T, P, tvec4> struct compute_srgbToRgb<T, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const & ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const & ColorSRGB, T Gamma) GLM_NOEXCEPT
{ {
return tvec4<T, P>(compute_srgbToRgb<T, P, tvec3>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a); return tvec4<T, P>(compute_srgbToRgb<T, P, tvec3>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a);
} }
@ -79,25 +79,25 @@ namespace detail
}//namespace detail }//namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear) GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear) GLM_NOEXCEPT
{ {
return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(0.41666)); return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(0.41666));
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma) GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma) GLM_NOEXCEPT
{ {
return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(1) / Gamma); return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(1) / Gamma);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB) GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB) GLM_NOEXCEPT
{ {
return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, static_cast<T>(2.4)); return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, static_cast<T>(2.4));
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma) GLM_NOEXCEPT
{ {
return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, Gamma); return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, Gamma);
} }

View File

@ -57,147 +57,147 @@ namespace glm
/// Return the epsilon constant for floating point types. /// Return the epsilon constant for floating point types.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon() GLM_NOEXCEPT;
/// Return 0. /// Return 0.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); GLM_FUNC_DECL GLM_CONSTEXPR genType zero() GLM_NOEXCEPT;
/// Return 1. /// Return 1.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one(); GLM_FUNC_DECL GLM_CONSTEXPR genType one() GLM_NOEXCEPT;
/// Return the pi constant. /// Return the pi constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType pi() GLM_NOEXCEPT;
/// Return pi * 2. /// Return pi * 2.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi() GLM_NOEXCEPT;
/// Return square root of pi. /// Return square root of pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi() GLM_NOEXCEPT;
/// Return pi / 2. /// Return pi / 2.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi() GLM_NOEXCEPT;
/// Return pi / 2 * 3. /// Return pi / 2 * 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi() GLM_NOEXCEPT;
/// Return pi / 4. /// Return pi / 4.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi() GLM_NOEXCEPT;
/// Return 1 / pi. /// Return 1 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi() GLM_NOEXCEPT;
/// Return 1 / (pi * 2). /// Return 1 / (pi * 2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi() GLM_NOEXCEPT;
/// Return 2 / pi. /// Return 2 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi() GLM_NOEXCEPT;
/// Return 4 / pi. /// Return 4 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi() GLM_NOEXCEPT;
/// Return 2 / sqrt(pi). /// Return 2 / sqrt(pi).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi() GLM_NOEXCEPT;
/// Return 1 / sqrt(2). /// Return 1 / sqrt(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two() GLM_NOEXCEPT;
/// Return sqrt(pi / 2). /// Return sqrt(pi / 2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi() GLM_NOEXCEPT;
/// Return sqrt(2 * pi). /// Return sqrt(2 * pi).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi() GLM_NOEXCEPT;
/// Return sqrt(ln(4)). /// Return sqrt(ln(4)).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four() GLM_NOEXCEPT;
/// Return e constant. /// Return e constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType e(); GLM_FUNC_DECL GLM_CONSTEXPR genType e() GLM_NOEXCEPT;
/// Return Euler's constant. /// Return Euler's constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); GLM_FUNC_DECL GLM_CONSTEXPR genType euler() GLM_NOEXCEPT;
/// Return sqrt(2). /// Return sqrt(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_two() GLM_NOEXCEPT;
/// Return sqrt(3). /// Return sqrt(3).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_three() GLM_NOEXCEPT;
/// Return sqrt(5). /// Return sqrt(5).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_five() GLM_NOEXCEPT;
/// Return ln(2). /// Return ln(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two() GLM_NOEXCEPT;
/// Return ln(10). /// Return ln(10).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten() GLM_NOEXCEPT;
/// Return ln(ln(2)). /// Return ln(ln(2)).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two() GLM_NOEXCEPT;
/// Return 1 / 3. /// Return 1 / 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType third(); GLM_FUNC_DECL GLM_CONSTEXPR genType third() GLM_NOEXCEPT;
/// Return 2 / 3. /// Return 2 / 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds() GLM_NOEXCEPT;
/// Return the golden ratio constant. /// Return the golden ratio constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template <typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio() GLM_NOEXCEPT;
/// @} /// @}
} //namespace glm } //namespace glm

View File

@ -35,175 +35,175 @@
namespace glm namespace glm
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() GLM_NOEXCEPT
{ {
return std::numeric_limits<genType>::epsilon(); return std::numeric_limits<genType>::epsilon();
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() GLM_NOEXCEPT
{ {
return genType(0); return genType(0);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() GLM_NOEXCEPT
{ {
return genType(1); return genType(1);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() GLM_NOEXCEPT
{ {
return genType(3.14159265358979323846264338327950288); return genType(3.14159265358979323846264338327950288);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() GLM_NOEXCEPT
{ {
return genType(6.28318530717958647692528676655900576); return genType(6.28318530717958647692528676655900576);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() GLM_NOEXCEPT
{ {
return genType(1.772453850905516027); return genType(1.772453850905516027);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() GLM_NOEXCEPT
{ {
return genType(1.57079632679489661923132169163975144); return genType(1.57079632679489661923132169163975144);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() GLM_NOEXCEPT
{ {
return genType(4.71238898038468985769396507491925432); return genType(4.71238898038468985769396507491925432);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() GLM_NOEXCEPT
{ {
return genType(0.785398163397448309615660845819875721); return genType(0.785398163397448309615660845819875721);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() GLM_NOEXCEPT
{ {
return genType(0.318309886183790671537767526745028724); return genType(0.318309886183790671537767526745028724);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() GLM_NOEXCEPT
{ {
return genType(0.159154943091895335768883763372514362); return genType(0.159154943091895335768883763372514362);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() GLM_NOEXCEPT
{ {
return genType(0.636619772367581343075535053490057448); return genType(0.636619772367581343075535053490057448);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() GLM_NOEXCEPT
{ {
return genType(1.273239544735162686151070106980114898); return genType(1.273239544735162686151070106980114898);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() GLM_NOEXCEPT
{ {
return genType(1.12837916709551257389615890312154517); return genType(1.12837916709551257389615890312154517);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() GLM_NOEXCEPT
{ {
return genType(0.707106781186547524400844362104849039); return genType(0.707106781186547524400844362104849039);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() GLM_NOEXCEPT
{ {
return genType(1.253314137315500251); return genType(1.253314137315500251);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() GLM_NOEXCEPT
{ {
return genType(2.506628274631000502); return genType(2.506628274631000502);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() GLM_NOEXCEPT
{ {
return genType(1.17741002251547469); return genType(1.17741002251547469);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() GLM_NOEXCEPT
{ {
return genType(2.71828182845904523536); return genType(2.71828182845904523536);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() GLM_NOEXCEPT
{ {
return genType(0.577215664901532860606); return genType(0.577215664901532860606);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() GLM_NOEXCEPT
{ {
return genType(1.41421356237309504880168872420969808); return genType(1.41421356237309504880168872420969808);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() GLM_NOEXCEPT
{ {
return genType(1.73205080756887729352744634150587236); return genType(1.73205080756887729352744634150587236);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() GLM_NOEXCEPT
{ {
return genType(2.23606797749978969640917366873127623); return genType(2.23606797749978969640917366873127623);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() GLM_NOEXCEPT
{ {
return genType(0.693147180559945309417232121458176568); return genType(0.693147180559945309417232121458176568);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() GLM_NOEXCEPT
{ {
return genType(2.30258509299404568401799145468436421); return genType(2.30258509299404568401799145468436421);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() GLM_NOEXCEPT
{ {
return genType(-0.3665129205816643); return genType(-0.3665129205816643);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() GLM_NOEXCEPT
{ {
return genType(0.3333333333333333333333333333333333333333); return genType(0.3333333333333333333333333333333333333333);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() GLM_NOEXCEPT
{ {
return genType(0.666666666666666666666666666666666666667); return genType(0.666666666666666666666666666666666666667);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() GLM_NOEXCEPT
{ {
return genType(1.61803398874989484820458683436563811); return genType(1.61803398874989484820458683436563811);
} }

View File

@ -62,7 +62,7 @@ namespace glm
/// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size. /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size.
/// @see gtc_integer /// @see gtc_integer
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType log2(genIUType x); GLM_FUNC_DECL genIUType log2(genIUType x) GLM_NOEXCEPT;
/// Modulus. Returns x % y /// Modulus. Returns x % y
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@ -73,7 +73,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y); GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y) GLM_NOEXCEPT;
/// Modulus. Returns x % y /// Modulus. Returns x % y
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@ -85,7 +85,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y); GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y) GLM_NOEXCEPT;
/// Modulus. Returns x % y /// Modulus. Returns x % y
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@ -97,7 +97,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y); GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT;
/// @} /// @}
} //namespace glm } //namespace glm

View File

@ -36,7 +36,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_log2<T, P, vecType, false> struct compute_log2<T, P, vecType, false>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) GLM_NOEXCEPT
{ {
//Equivalent to return findMSB(vec); but save one function call in ASM with VC //Equivalent to return findMSB(vec); but save one function call in ASM with VC
//return findMSB(vec); //return findMSB(vec);
@ -48,7 +48,7 @@ namespace detail
template <precision P> template <precision P>
struct compute_log2<int, P, tvec4, false> struct compute_log2<int, P, tvec4, false>
{ {
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec) GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec) GLM_NOEXCEPT
{ {
tvec4<int, P> Result(glm::uninitialize); tvec4<int, P> Result(glm::uninitialize);

View File

@ -62,7 +62,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_DECL genType affineInverse(genType const & m); GLM_FUNC_DECL genType affineInverse(genType const & m) GLM_NOEXCEPT;
/// Compute the inverse transpose of a matrix. /// Compute the inverse transpose of a matrix.
/// ///
@ -70,7 +70,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_DECL genType inverseTranspose(genType const & m); GLM_FUNC_DECL genType inverseTranspose(genType const & m) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -33,7 +33,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x3<T, P> affineInverse(tmat3x3<T, P> const & m) GLM_NOEXCEPT
{ {
tmat3x3<T, P> Result(m); tmat3x3<T, P> Result(m);
Result[2] = tvec3<T, P>(0, 0, 1); Result[2] = tvec3<T, P>(0, 0, 1);
@ -44,7 +44,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x4<T, P> affineInverse(tmat4x4<T, P> const & m) GLM_NOEXCEPT
{ {
tmat4x4<T, P> Result(m); tmat4x4<T, P> Result(m);
Result[3] = tvec4<T, P>(0, 0, 0, 1); Result[3] = tvec4<T, P>(0, 0, 0, 1);
@ -55,7 +55,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x2<T, P> inverseTranspose(tmat2x2<T, P> const & m) GLM_NOEXCEPT
{ {
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
@ -69,7 +69,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER tmat3x3<T, P> inverseTranspose(tmat3x3<T, P> const & m) GLM_NOEXCEPT
{ {
T Determinant = T Determinant =
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
@ -92,7 +92,7 @@ namespace glm
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER tmat4x4<T, P> inverseTranspose(tmat4x4<T, P> const & m) GLM_NOEXCEPT
{ {
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];

View File

@ -68,20 +68,20 @@ namespace glm
/// @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>
GLM_FUNC_DECL T perlin( GLM_FUNC_DECL T perlin(
vecType<T, P> const & p);
vecType<T, P> const & p) GLM_NOEXCEPT;
/// 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>
GLM_FUNC_DECL 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) GLM_NOEXCEPT;
/// 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>
GLM_FUNC_DECL T simplex( GLM_FUNC_DECL T simplex(
vecType<T, P> const & p); vecType<T, P> const & p) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -39,7 +39,7 @@ namespace glm{
namespace gtc namespace gtc
{ {
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) GLM_NOEXCEPT
{ {
tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1); tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1)); T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1));
@ -51,7 +51,7 @@ namespace gtc
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position) GLM_NOEXCEPT
{ {
tvec4<T, P> Pi = glm::floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0); tvec4<T, P> Pi = glm::floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0);
tvec4<T, P> Pf = glm::fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0); tvec4<T, P> Pf = glm::fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0);
@ -92,7 +92,7 @@ namespace gtc
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position) GLM_NOEXCEPT
{ {
tvec3<T, P> Pi0 = floor(Position); // Integer part for indexing tvec3<T, P> Pi0 = floor(Position); // Integer part for indexing
tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1
@ -163,7 +163,7 @@ namespace gtc
/* /*
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & P) GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & P) GLM_NOEXCEPT
{ {
tvec3<T, P> Pi0 = floor(P); // Integer part for indexing tvec3<T, P> Pi0 = floor(P); // Integer part for indexing
tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 tvec3<T, P> Pi1 = Pi0 + T(1); // Integer part + 1
@ -236,7 +236,7 @@ namespace gtc
*/ */
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position) GLM_NOEXCEPT
{ {
tvec4<T, P> Pi0 = floor(Position); // Integer part for indexing tvec4<T, P> Pi0 = floor(Position); // Integer part for indexing
tvec4<T, P> Pi1 = Pi0 + T(1); // Integer part + 1 tvec4<T, P> Pi1 = Pi0 + T(1); // Integer part + 1
@ -372,7 +372,7 @@ namespace gtc
// Classic Perlin noise, periodic variant // Classic Perlin noise, periodic variant
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position, tvec2<T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(tvec2<T, P> const & Position, tvec2<T, P> const & rep) GLM_NOEXCEPT
{ {
tvec4<T, P> Pi = floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0); tvec4<T, P> Pi = floor(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) + tvec4<T, P>(0.0, 0.0, 1.0, 1.0);
tvec4<T, P> Pf = fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0); tvec4<T, P> Pf = fract(tvec4<T, P>(Position.x, Position.y, Position.x, Position.y)) - tvec4<T, P>(0.0, 0.0, 1.0, 1.0);
@ -414,7 +414,7 @@ namespace gtc
// Classic Perlin noise, periodic variant // Classic Perlin noise, periodic variant
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position, tvec3<T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(tvec3<T, P> const & Position, tvec3<T, P> const & rep) GLM_NOEXCEPT
{ {
tvec3<T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period tvec3<T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period
tvec3<T, P> Pi1 = mod(Pi0 + tvec3<T, P>(T(1)), rep); // Integer part + 1, mod period tvec3<T, P> Pi1 = mod(Pi0 + tvec3<T, P>(T(1)), rep); // Integer part + 1, mod period
@ -485,7 +485,7 @@ namespace gtc
// Classic Perlin noise, periodic version // Classic Perlin noise, periodic version
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position, tvec4<T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(tvec4<T, P> const & Position, tvec4<T, P> const & rep) GLM_NOEXCEPT
{ {
tvec4<T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep tvec4<T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep
tvec4<T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep tvec4<T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep
@ -618,7 +618,7 @@ namespace gtc
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(glm::tvec2<T, P> const & v) GLM_FUNC_QUALIFIER T simplex(glm::tvec2<T, P> const & v) GLM_NOEXCEPT
{ {
tvec4<T, P> const C = tvec4<T, P>( tvec4<T, P> const C = tvec4<T, P>(
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
@ -675,7 +675,7 @@ namespace gtc
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(tvec3<T, P> const & v) GLM_FUNC_QUALIFIER T simplex(tvec3<T, P> const & v) GLM_NOEXCEPT
{ {
tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0); tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0); tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
@ -750,7 +750,7 @@ namespace gtc
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(tvec4<T, P> const & v) GLM_FUNC_QUALIFIER T simplex(tvec4<T, P> const & v) GLM_NOEXCEPT
{ {
tvec4<T, P> const C( tvec4<T, P> const C(
0.138196601125011, // (5 - sqrt(5))/20 G4 0.138196601125011, // (5 - sqrt(5))/20 G4

View File

@ -65,7 +65,7 @@ namespace glm
/// @see uint32 packUnorm4x8(vec4 const & v) /// @see uint32 packUnorm4x8(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint8 packUnorm1x8(float v); GLM_FUNC_DECL uint8 packUnorm1x8(float v) GLM_NOEXCEPT;
/// Convert a single 8-bit integer to a normalized floating-point value. /// Convert a single 8-bit integer to a normalized floating-point value.
/// ///
@ -77,7 +77,7 @@ namespace glm
/// @see vec4 unpackUnorm4x8(uint32 p) /// @see vec4 unpackUnorm4x8(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); GLM_FUNC_DECL float unpackUnorm1x8(uint8 p) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 8-bit integer values. /// First, converts each component of the normalized floating-point value v into 8-bit integer values.
/// Then, the results are packed into the returned 16-bit unsigned integer. /// Then, the results are packed into the returned 16-bit unsigned integer.
@ -93,7 +93,7 @@ namespace glm
/// @see uint32 packUnorm4x8(vec4 const & v) /// @see uint32 packUnorm4x8(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const & v); GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
@ -109,8 +109,8 @@ namespace glm
/// @see vec4 unpackUnorm4x8(uint32 p) /// @see vec4 unpackUnorm4x8(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p);
GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p) GLM_NOEXCEPT;
/// First, converts the normalized floating-point value v into 8-bit integer value. /// First, converts the normalized floating-point value v into 8-bit integer value.
/// Then, the results are packed into the returned 8-bit unsigned integer. /// Then, the results are packed into the returned 8-bit unsigned integer.
/// ///
@ -122,7 +122,7 @@ namespace glm
/// @see uint32 packSnorm4x8(vec4 const & v) /// @see uint32 packSnorm4x8(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint8 packSnorm1x8(float s); GLM_FUNC_DECL uint8 packSnorm1x8(float s) GLM_NOEXCEPT;
/// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers.
/// Then, the value is converted to a normalized floating-point value to generate the returned scalar. /// Then, the value is converted to a normalized floating-point value to generate the returned scalar.
@ -135,7 +135,7 @@ namespace glm
/// @see vec4 unpackSnorm4x8(uint32 p) /// @see vec4 unpackSnorm4x8(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); GLM_FUNC_DECL float unpackSnorm1x8(uint8 p) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 8-bit integer values. /// First, converts each component of the normalized floating-point value v into 8-bit integer values.
/// Then, the results are packed into the returned 16-bit unsigned integer. /// Then, the results are packed into the returned 16-bit unsigned integer.
@ -151,7 +151,7 @@ namespace glm
/// @see uint32 packSnorm4x8(vec4 const & v) /// @see uint32 packSnorm4x8(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const & v); GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
@ -167,7 +167,7 @@ namespace glm
/// @see vec4 unpackSnorm4x8(uint32 p) /// @see vec4 unpackSnorm4x8(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p) GLM_NOEXCEPT;
/// First, converts the normalized floating-point value v into a 16-bit integer value. /// First, converts the normalized floating-point value v into a 16-bit integer value.
/// Then, the results are packed into the returned 16-bit unsigned integer. /// Then, the results are packed into the returned 16-bit unsigned integer.
@ -180,7 +180,7 @@ namespace glm
/// @see uint64 packSnorm4x16(vec4 const & v) /// @see uint64 packSnorm4x16(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packUnorm1x16(float v); GLM_FUNC_DECL uint16 packUnorm1x16(float v) GLM_NOEXCEPT;
/// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers.
/// Then, the value is converted to a normalized floating-point value to generate the returned scalar. /// Then, the value is converted to a normalized floating-point value to generate the returned scalar.
@ -193,7 +193,7 @@ namespace glm
/// @see vec4 unpackUnorm4x16(uint64 p) /// @see vec4 unpackUnorm4x16(uint64 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); GLM_FUNC_DECL float unpackUnorm1x16(uint16 p) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 16-bit integer values. /// First, converts each component of the normalized floating-point value v into 16-bit integer values.
/// Then, the results are packed into the returned 64-bit unsigned integer. /// Then, the results are packed into the returned 64-bit unsigned integer.
@ -209,7 +209,7 @@ namespace glm
/// @see uint32 packUnorm2x16(vec2 const & v) /// @see uint32 packUnorm2x16(vec2 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const & v); GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
@ -225,7 +225,7 @@ namespace glm
/// @see vec2 unpackUnorm2x16(uint32 p) /// @see vec2 unpackUnorm2x16(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p) GLM_NOEXCEPT;
/// First, converts the normalized floating-point value v into 16-bit integer value. /// First, converts the normalized floating-point value v into 16-bit integer value.
/// Then, the results are packed into the returned 16-bit unsigned integer. /// Then, the results are packed into the returned 16-bit unsigned integer.
@ -238,7 +238,7 @@ namespace glm
/// @see uint64 packSnorm4x16(vec4 const & v) /// @see uint64 packSnorm4x16(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packSnorm1x16(float v); GLM_FUNC_DECL uint16 packSnorm1x16(float v) GLM_NOEXCEPT;
/// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned scalar. /// Then, each component is converted to a normalized floating-point value to generate the returned scalar.
@ -251,7 +251,7 @@ namespace glm
/// @see vec4 unpackSnorm4x16(uint64 p) /// @see vec4 unpackSnorm4x16(uint64 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm1x16.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm1x16.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); GLM_FUNC_DECL float unpackSnorm1x16(uint16 p) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 16-bit integer values. /// First, converts each component of the normalized floating-point value v into 16-bit integer values.
/// Then, the results are packed into the returned 64-bit unsigned integer. /// Then, the results are packed into the returned 64-bit unsigned integer.
@ -267,7 +267,7 @@ namespace glm
/// @see uint32 packSnorm2x16(vec2 const & v) /// @see uint32 packSnorm2x16(vec2 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const & v); GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
@ -283,7 +283,7 @@ namespace glm
/// @see vec2 unpackSnorm2x16(uint32 p) /// @see vec2 unpackSnorm2x16(uint32 p)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p) GLM_NOEXCEPT;
/// Returns an unsigned integer obtained by converting the components of a floating-point scalar /// Returns an unsigned integer obtained by converting the components of a floating-point scalar
/// to the 16-bit floating-point representation found in the OpenGL Specification, /// to the 16-bit floating-point representation found in the OpenGL Specification,
@ -294,7 +294,7 @@ namespace glm
/// @see uint64 packHalf4x16(vec4 const & v) /// @see uint64 packHalf4x16(vec4 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packHalf1x16(float v); GLM_FUNC_DECL uint16 packHalf1x16(float v) GLM_NOEXCEPT;
/// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value,
/// interpreted as a 16-bit floating-point number according to the OpenGL Specification, /// interpreted as a 16-bit floating-point number according to the OpenGL Specification,
@ -305,7 +305,7 @@ namespace glm
/// @see vec4 unpackHalf4x16(uint64 const & v) /// @see vec4 unpackHalf4x16(uint64 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL float unpackHalf1x16(uint16 v); GLM_FUNC_DECL float unpackHalf1x16(uint16 v) GLM_NOEXCEPT;
/// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification, /// to the 16-bit floating-point representation found in the OpenGL Specification,
@ -318,7 +318,7 @@ namespace glm
/// @see uint32 packHalf2x16(vec2 const & v) /// @see uint32 packHalf2x16(vec2 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const & v); GLM_FUNC_DECL uint64 packHalf4x16(vec4 const & v) GLM_NOEXCEPT;
/// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values,
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
@ -331,7 +331,7 @@ namespace glm
/// @see vec2 unpackHalf2x16(uint32 const & v) /// @see vec2 unpackHalf2x16(uint32 const & v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p) GLM_NOEXCEPT;
/// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector
/// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification,
@ -344,7 +344,7 @@ namespace glm
/// @see uint32 packSnorm3x10_1x2(vec4 const & v) /// @see uint32 packSnorm3x10_1x2(vec4 const & v)
/// @see uint32 packUnorm3x10_1x2(vec4 const & v) /// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see ivec4 unpackI3x10_1x2(uint32 const & p) /// @see ivec4 unpackI3x10_1x2(uint32 const & p)
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v); GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v) GLM_NOEXCEPT;
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
/// ///
@ -355,7 +355,7 @@ namespace glm
/// @see uint32 packU3x10_1x2(uvec4 const & v) /// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p); /// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
/// @see uvec4 unpackI3x10_1x2(uint32 const & p); /// @see uvec4 unpackI3x10_1x2(uint32 const & p);
GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p) GLM_NOEXCEPT;
/// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector
/// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification,
@ -368,7 +368,7 @@ namespace glm
/// @see uint32 packSnorm3x10_1x2(vec4 const & v) /// @see uint32 packSnorm3x10_1x2(vec4 const & v)
/// @see uint32 packUnorm3x10_1x2(vec4 const & v) /// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see ivec4 unpackU3x10_1x2(uint32 const & p) /// @see ivec4 unpackU3x10_1x2(uint32 const & p)
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v); GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v) GLM_NOEXCEPT;
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
/// ///
@ -379,7 +379,7 @@ namespace glm
/// @see uint32 packU3x10_1x2(uvec4 const & v) /// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p); /// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
/// @see uvec4 unpackI3x10_1x2(uint32 const & p); /// @see uvec4 unpackI3x10_1x2(uint32 const & p);
GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p) GLM_NOEXCEPT;
/// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values.
/// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values.
@ -397,7 +397,7 @@ namespace glm
/// @see uint32 packUnorm3x10_1x2(vec4 const & v) /// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see uint32 packU3x10_1x2(uvec4 const & v) /// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see uint32 packI3x10_1x2(ivec4 const & v) /// @see uint32 packI3x10_1x2(ivec4 const & v)
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const & v); GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
@ -414,7 +414,7 @@ namespace glm
/// @see vec4 unpackUnorm3x10_1x2(uint32 const & p)) /// @see vec4 unpackUnorm3x10_1x2(uint32 const & p))
/// @see uvec4 unpackI3x10_1x2(uint32 const & p) /// @see uvec4 unpackI3x10_1x2(uint32 const & p)
/// @see uvec4 unpackU3x10_1x2(uint32 const & p) /// @see uvec4 unpackU3x10_1x2(uint32 const & p)
GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p) GLM_NOEXCEPT;
/// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values.
/// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values.
@ -432,7 +432,7 @@ namespace glm
/// @see uint32 packUnorm3x10_1x2(vec4 const & v) /// @see uint32 packUnorm3x10_1x2(vec4 const & v)
/// @see uint32 packU3x10_1x2(uvec4 const & v) /// @see uint32 packU3x10_1x2(uvec4 const & v)
/// @see uint32 packI3x10_1x2(ivec4 const & v) /// @see uint32 packI3x10_1x2(ivec4 const & v)
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const & v); GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
@ -449,7 +449,7 @@ namespace glm
/// @see vec4 unpackInorm3x10_1x2(uint32 const & p)) /// @see vec4 unpackInorm3x10_1x2(uint32 const & p))
/// @see uvec4 unpackI3x10_1x2(uint32 const & p) /// @see uvec4 unpackI3x10_1x2(uint32 const & p)
/// @see uvec4 unpackU3x10_1x2(uint32 const & p) /// @see uvec4 unpackU3x10_1x2(uint32 const & p)
GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p) GLM_NOEXCEPT;
/// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values.
/// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value.
@ -460,7 +460,7 @@ namespace glm
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vec3 unpackF2x11_1x10(uint32 const & p) /// @see vec3 unpackF2x11_1x10(uint32 const & p)
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const & v); GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
/// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector.
@ -470,7 +470,7 @@ namespace glm
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see uint32 packF2x11_1x10(vec3 const & v) /// @see uint32 packF2x11_1x10(vec3 const & v)
GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p) GLM_NOEXCEPT;
/// @} /// @}
}// namespace glm }// namespace glm

View File

@ -40,7 +40,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) GLM_NOEXCEPT
{ {
// 10 bits => EE EEEFFFFF // 10 bits => EE EEEFFFFF
// 11 bits => EEE EEFFFFFF // 11 bits => EEE EEFFFFFF
@ -58,7 +58,7 @@ namespace detail
((f >> 13) & 0x03ff); // Mantissa ((f >> 13) & 0x03ff); // Mantissa
} }
GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) GLM_NOEXCEPT
{ {
// 10 bits => EE EEEFFFFF // 10 bits => EE EEEFFFFF
// 11 bits => EEE EEFFFFFF // 11 bits => EEE EEFFFFFF
@ -76,7 +76,7 @@ namespace detail
((f >> 17) & 0x003f); // Mantissa ((f >> 17) & 0x003f); // Mantissa
} }
GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) GLM_NOEXCEPT
{ {
// 10 bits => EE EEEFFFFF // 10 bits => EE EEEFFFFF
// 11 bits => EEE EEFFFFFF // 11 bits => EEE EEFFFFFF
@ -94,7 +94,7 @@ namespace detail
((p & 0x003f) << 17); // Mantissa ((p & 0x003f) << 17); // Mantissa
} }
GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) GLM_NOEXCEPT
{ {
// 10 bits => EE EEEFFFFF // 10 bits => EE EEEFFFFF
// 11 bits => EEE EEFFFFFF // 11 bits => EEE EEFFFFFF
@ -115,7 +115,7 @@ namespace detail
((f >> 18) & 0x001f); // Mantissa ((f >> 18) & 0x001f); // Mantissa
} }
GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) GLM_NOEXCEPT
{ {
// 10 bits => EE EEEFFFFF // 10 bits => EE EEEFFFFF
// 11 bits => EEE EEFFFFFF // 11 bits => EEE EEFFFFFF
@ -136,12 +136,12 @@ namespace detail
((p & 0x001f) << 18); // Mantissa ((p & 0x001f) << 18); // Mantissa
} }
GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) GLM_NOEXCEPT
{ {
return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13);
} }
GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) GLM_NOEXCEPT
{ {
if(x == 0.0f) if(x == 0.0f)
return 0u; return 0u;
@ -160,7 +160,7 @@ namespace detail
return float2packed11(Pack); return float2packed11(Pack);
} }
GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) GLM_NOEXCEPT
{ {
if(x == 0) if(x == 0)
return 0.0f; return 0.0f;
@ -180,7 +180,7 @@ namespace detail
# endif # endif
} }
GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) GLM_NOEXCEPT
{ {
if(x == 0.0f) if(x == 0.0f)
return 0u; return 0u;
@ -199,7 +199,7 @@ namespace detail
return float2packed10(Pack); return float2packed10(Pack);
} }
GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) GLM_NOEXCEPT
{ {
if(x == 0) if(x == 0)
return 0.0f; return 0.0f;
@ -219,7 +219,7 @@ namespace detail
# endif # endif
} }
// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) // GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) GLM_NOEXCEPT
// { // {
// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); // return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22);
// } // }
@ -250,36 +250,36 @@ namespace detail
}//namespace detail }//namespace detail
GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) GLM_NOEXCEPT
{ {
return static_cast<uint8>(round(clamp(v, 0.0f, 1.0f) * 255.0f)); return static_cast<uint8>(round(clamp(v, 0.0f, 1.0f) * 255.0f));
} }
GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) GLM_NOEXCEPT
{ {
float const Unpack(p); float const Unpack(p);
return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255 return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255
} }
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v) GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v) GLM_NOEXCEPT
{ {
u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
return reinterpret_cast<uint16 const &>(Topack); return reinterpret_cast<uint16 const &>(Topack);
} }
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) GLM_NOEXCEPT
{ {
vec2 const Unpack(reinterpret_cast<u8vec2 const &>(p)); vec2 const Unpack(reinterpret_cast<u8vec2 const &>(p));
return Unpack * float(0.0039215686274509803921568627451); // 1 / 255 return Unpack * float(0.0039215686274509803921568627451); // 1 / 255
} }
GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) GLM_NOEXCEPT
{ {
int8 const Topack(static_cast<int8>(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); int8 const Topack(static_cast<int8>(round(clamp(v ,-1.0f, 1.0f) * 127.0f)));
return reinterpret_cast<uint8 const &>(Topack); return reinterpret_cast<uint8 const &>(Topack);
} }
GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) GLM_NOEXCEPT
{ {
float const Unpack(reinterpret_cast<int8 const &>(p)); float const Unpack(reinterpret_cast<int8 const &>(p));
return clamp( return clamp(
@ -287,13 +287,13 @@ namespace detail
-1.0f, 1.0f); -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v) GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v) GLM_NOEXCEPT
{ {
i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f));
return reinterpret_cast<uint16 const &>(Topack); return reinterpret_cast<uint16 const &>(Topack);
} }
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) GLM_NOEXCEPT
{ {
vec2 const Unpack(reinterpret_cast<i8vec2 const &>(p)); vec2 const Unpack(reinterpret_cast<i8vec2 const &>(p));
return clamp( return clamp(
@ -301,36 +301,36 @@ namespace detail
-1.0f, 1.0f); -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) GLM_NOEXCEPT
{ {
return static_cast<uint16>(round(clamp(s, 0.0f, 1.0f) * 65535.0f)); return static_cast<uint16>(round(clamp(s, 0.0f, 1.0f) * 65535.0f));
} }
GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) GLM_NOEXCEPT
{ {
float const Unpack(p); float const Unpack(p);
return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0
} }
GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v) GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v) GLM_NOEXCEPT
{ {
u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f));
return reinterpret_cast<uint64 const &>(Topack); return reinterpret_cast<uint64 const &>(Topack);
} }
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) GLM_NOEXCEPT
{ {
vec4 const Unpack(reinterpret_cast<u16vec4 const &>(p)); vec4 const Unpack(reinterpret_cast<u16vec4 const &>(p));
return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0
} }
GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) GLM_NOEXCEPT
{ {
int16 const Topack = static_cast<int16>(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); int16 const Topack = static_cast<int16>(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
return reinterpret_cast<uint16 const &>(Topack); return reinterpret_cast<uint16 const &>(Topack);
} }
GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) GLM_NOEXCEPT
{ {
float const Unpack(reinterpret_cast<int16 const &>(p)); float const Unpack(reinterpret_cast<int16 const &>(p));
return clamp( return clamp(
@ -338,13 +338,13 @@ namespace detail
-1.0f, 1.0f); -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v) GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v) GLM_NOEXCEPT
{ {
i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
return reinterpret_cast<uint64 const &>(Topack); return reinterpret_cast<uint64 const &>(Topack);
} }
GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) GLM_NOEXCEPT
{ {
vec4 const Unpack(reinterpret_cast<i16vec4 const &>(p)); vec4 const Unpack(reinterpret_cast<i16vec4 const &>(p));
return clamp( return clamp(
@ -352,18 +352,18 @@ namespace detail
-1.0f, 1.0f); -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) GLM_NOEXCEPT
{ {
int16 const Topack(detail::toFloat16(v)); int16 const Topack(detail::toFloat16(v));
return reinterpret_cast<uint16 const &>(Topack); return reinterpret_cast<uint16 const &>(Topack);
} }
GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) GLM_NOEXCEPT
{ {
return detail::toFloat32(reinterpret_cast<int16 const &>(v)); return detail::toFloat32(reinterpret_cast<int16 const &>(v));
} }
GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v) GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v) GLM_NOEXCEPT
{ {
i16vec4 Unpack( i16vec4 Unpack(
detail::toFloat16(v.x), detail::toFloat16(v.x),
@ -374,7 +374,7 @@ namespace detail
return reinterpret_cast<uint64 const &>(Unpack); return reinterpret_cast<uint64 const &>(Unpack);
} }
GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) GLM_NOEXCEPT
{ {
i16vec4 Unpack(reinterpret_cast<i16vec4 const &>(v)); i16vec4 Unpack(reinterpret_cast<i16vec4 const &>(v));
@ -385,7 +385,7 @@ namespace detail
detail::toFloat32(Unpack.w)); detail::toFloat32(Unpack.w));
} }
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v) GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Result; detail::i10i10i10i2 Result;
Result.data.x = v.x; Result.data.x = v.x;
@ -395,7 +395,7 @@ namespace detail
return Result.pack; return Result.pack;
} }
GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Unpack; detail::i10i10i10i2 Unpack;
Unpack.pack = v; Unpack.pack = v;
@ -406,7 +406,7 @@ namespace detail
Unpack.data.w); Unpack.data.w);
} }
GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const & v) GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const & v) GLM_NOEXCEPT
{ {
detail::u10u10u10u2 Result; detail::u10u10u10u2 Result;
Result.data.x = v.x; Result.data.x = v.x;
@ -416,7 +416,7 @@ namespace detail
return Result.pack; return Result.pack;
} }
GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) GLM_NOEXCEPT
{ {
detail::u10u10u10u2 Unpack; detail::u10u10u10u2 Unpack;
Unpack.pack = v; Unpack.pack = v;
@ -427,7 +427,7 @@ namespace detail
Unpack.data.w); Unpack.data.w);
} }
GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const & v) GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const & v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Result; detail::i10i10i10i2 Result;
Result.data.x = int(round(clamp(v.x,-1.0f, 1.0f) * 511.f)); Result.data.x = int(round(clamp(v.x,-1.0f, 1.0f) * 511.f));
@ -437,7 +437,7 @@ namespace detail
return Result.pack; return Result.pack;
} }
GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Unpack; detail::i10i10i10i2 Unpack;
Unpack.pack = v; Unpack.pack = v;
@ -449,7 +449,7 @@ namespace detail
return Result; return Result;
} }
GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v) GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Result; detail::i10i10i10i2 Result;
Result.data.x = int(round(clamp(v.x, 0.0f, 1.0f) * 1023.f)); Result.data.x = int(round(clamp(v.x, 0.0f, 1.0f) * 1023.f));
@ -459,7 +459,7 @@ namespace detail
return Result.pack; return Result.pack;
} }
GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) GLM_NOEXCEPT
{ {
detail::i10i10i10i2 Unpack; detail::i10i10i10i2 Unpack;
Unpack.pack = v; Unpack.pack = v;
@ -471,7 +471,7 @@ namespace detail
return Result; return Result;
} }
GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v) GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v) GLM_NOEXCEPT
{ {
return return
((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) |
@ -479,7 +479,7 @@ namespace detail
((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22);
} }
GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) GLM_NOEXCEPT
{ {
return vec3( return vec3(
detail::packed11bitToFloat(v >> 0), detail::packed11bitToFloat(v >> 0),

View File

@ -197,7 +197,7 @@ namespace glm
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P, template <typename, precision> class quatType> template <typename T, precision P, template <typename, precision> class quatType>
GLM_FUNC_DECL T dot(quatType<T, P> const & x, quatType<T, P> const & y); GLM_FUNC_DECL T dot(quatType<T, P> const & x, quatType<T, P> const & y) GLM_NOEXCEPT;
/// Spherical linear interpolation of two quaternions. /// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed. /// The interpolation is oriented and the rotation is performed at constant speed.

View File

@ -65,12 +65,12 @@ namespace glm
template <typename genTYpe> template <typename genTYpe>
GLM_FUNC_DECL genTYpe linearRand( GLM_FUNC_DECL genTYpe linearRand(
genTYpe Min, genTYpe Min,
genTYpe Max); genTYpe Max) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> linearRand( GLM_FUNC_DECL vecType<T, P> linearRand(
vecType<T, P> const & Min, vecType<T, P> const & Min,
vecType<T, P> const & Max); vecType<T, P> const & Max) GLM_NOEXCEPT;
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution /// Generate random numbers in the interval [Min, Max], according a gaussian distribution
/// ///
@ -80,7 +80,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType gaussRand( GLM_FUNC_DECL genType gaussRand(
genType Mean, genType Mean,
genType Deviation); genType Deviation) GLM_NOEXCEPT;
/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
/// ///
@ -88,7 +88,7 @@ namespace glm
/// @see gtc_random /// @see gtc_random
template <typename T> template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> circularRand( GLM_FUNC_DECL tvec2<T, defaultp> circularRand(
T Radius); T Radius) GLM_NOEXCEPT;
/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
/// ///
@ -96,7 +96,7 @@ namespace glm
/// @see gtc_random /// @see gtc_random
template <typename T> template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand( GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand(
T Radius); T Radius) GLM_NOEXCEPT;
/// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
/// ///
@ -104,7 +104,7 @@ namespace glm
/// @see gtc_random /// @see gtc_random
template <typename T> template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> diskRand( GLM_FUNC_DECL tvec2<T, defaultp> diskRand(
T Radius); T Radius) GLM_NOEXCEPT;
/// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
/// ///
@ -112,7 +112,7 @@ namespace glm
/// @see gtc_random /// @see gtc_random
template <typename T> template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> ballRand( GLM_FUNC_DECL tvec3<T, defaultp> ballRand(
T Radius); T Radius) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -42,13 +42,13 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_rand struct compute_rand
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(); GLM_FUNC_QUALIFIER static vecType<T, P> call() GLM_NOEXCEPT;
}; };
template <precision P> template <precision P>
struct compute_rand<uint8, P, tvec1> struct compute_rand<uint8, P, tvec1>
{ {
GLM_FUNC_QUALIFIER static tvec1<uint8, P> call() GLM_FUNC_QUALIFIER static tvec1<uint8, P> call() GLM_NOEXCEPT
{ {
return tvec1<uint8, P>( return tvec1<uint8, P>(
std::rand() % std::numeric_limits<uint8>::max()); std::rand() % std::numeric_limits<uint8>::max());
@ -58,7 +58,7 @@ namespace detail
template <precision P> template <precision P>
struct compute_rand<uint8, P, tvec2> struct compute_rand<uint8, P, tvec2>
{ {
GLM_FUNC_QUALIFIER static tvec2<uint8, P> call() GLM_FUNC_QUALIFIER static tvec2<uint8, P> call() GLM_NOEXCEPT
{ {
return tvec2<uint8, P>( return tvec2<uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(), std::rand() % std::numeric_limits<uint8>::max(),
@ -69,7 +69,7 @@ namespace detail
template <precision P> template <precision P>
struct compute_rand<uint8, P, tvec3> struct compute_rand<uint8, P, tvec3>
{ {
GLM_FUNC_QUALIFIER static tvec3<uint8, P> call() GLM_FUNC_QUALIFIER static tvec3<uint8, P> call() GLM_NOEXCEPT
{ {
return tvec3<uint8, P>( return tvec3<uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(), std::rand() % std::numeric_limits<uint8>::max(),
@ -81,7 +81,7 @@ namespace detail
template <precision P> template <precision P>
struct compute_rand<uint8, P, tvec4> struct compute_rand<uint8, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<uint8, P> call() GLM_FUNC_QUALIFIER static tvec4<uint8, P> call() GLM_NOEXCEPT
{ {
return tvec4<uint8, P>( return tvec4<uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(), std::rand() % std::numeric_limits<uint8>::max(),
@ -94,7 +94,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_rand<uint16, P, vecType> struct compute_rand<uint16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint16, P> call() GLM_FUNC_QUALIFIER static vecType<uint16, P> call() GLM_NOEXCEPT
{ {
return return
(vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(8)) | (vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(8)) |
@ -105,7 +105,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_rand<uint32, P, vecType> struct compute_rand<uint32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint32, P> call() GLM_FUNC_QUALIFIER static vecType<uint32, P> call() GLM_NOEXCEPT
{ {
return return
(vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(16)) | (vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(16)) |
@ -116,7 +116,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_rand<uint64, P, vecType> struct compute_rand<uint64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint64, P> call() GLM_FUNC_QUALIFIER static vecType<uint64, P> call() GLM_NOEXCEPT
{ {
return return
(vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(32)) | (vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(32)) |
@ -127,13 +127,13 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_linearRand struct compute_linearRand
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & Min, vecType<T, P> const & Max); GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & Min, vecType<T, P> const & Max) GLM_NOEXCEPT;
}; };
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int8, P, vecType> struct compute_linearRand<int8, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<int8, P> call(vecType<int8, P> const & Min, vecType<int8, P> const & Max) GLM_FUNC_QUALIFIER static vecType<int8, P> call(vecType<int8, P> const & Min, vecType<int8, P> const & Max) GLM_NOEXCEPT
{ {
return (vecType<int8, P>(compute_rand<uint8, P, vecType>::call() % vecType<uint8, P>(Max + static_cast<int8>(1) - Min))) + Min; return (vecType<int8, P>(compute_rand<uint8, P, vecType>::call() % vecType<uint8, P>(Max + static_cast<int8>(1) - Min))) + Min;
} }
@ -142,7 +142,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint8, P, vecType> struct compute_linearRand<uint8, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint8, P> call(vecType<uint8, P> const & Min, vecType<uint8, P> const & Max) GLM_FUNC_QUALIFIER static vecType<uint8, P> call(vecType<uint8, P> const & Min, vecType<uint8, P> const & Max) GLM_NOEXCEPT
{ {
return (compute_rand<uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min; return (compute_rand<uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
} }
@ -151,7 +151,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int16, P, vecType> struct compute_linearRand<int16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<int16, P> call(vecType<int16, P> const & Min, vecType<int16, P> const & Max) GLM_FUNC_QUALIFIER static vecType<int16, P> call(vecType<int16, P> const & Min, vecType<int16, P> const & Max) GLM_NOEXCEPT
{ {
return (vecType<int16, P>(compute_rand<uint16, P, vecType>::call() % vecType<uint16, P>(Max + static_cast<int16>(1) - Min))) + Min; return (vecType<int16, P>(compute_rand<uint16, P, vecType>::call() % vecType<uint16, P>(Max + static_cast<int16>(1) - Min))) + Min;
} }
@ -160,7 +160,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint16, P, vecType> struct compute_linearRand<uint16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint16, P> call(vecType<uint16, P> const & Min, vecType<uint16, P> const & Max) GLM_FUNC_QUALIFIER static vecType<uint16, P> call(vecType<uint16, P> const & Min, vecType<uint16, P> const & Max) GLM_NOEXCEPT
{ {
return (compute_rand<uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min; return (compute_rand<uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
} }
@ -169,7 +169,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int32, P, vecType> struct compute_linearRand<int32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<int32, P> call(vecType<int32, P> const & Min, vecType<int32, P> const & Max) GLM_FUNC_QUALIFIER static vecType<int32, P> call(vecType<int32, P> const & Min, vecType<int32, P> const & Max) GLM_NOEXCEPT
{ {
return (vecType<int32, P>(compute_rand<uint32, P, vecType>::call() % vecType<uint32, P>(Max + static_cast<int32>(1) - Min))) + Min; return (vecType<int32, P>(compute_rand<uint32, P, vecType>::call() % vecType<uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
} }
@ -178,7 +178,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint32, P, vecType> struct compute_linearRand<uint32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint32, P> call(vecType<uint32, P> const & Min, vecType<uint32, P> const & Max) GLM_FUNC_QUALIFIER static vecType<uint32, P> call(vecType<uint32, P> const & Min, vecType<uint32, P> const & Max) GLM_NOEXCEPT
{ {
return (compute_rand<uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min; return (compute_rand<uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
} }
@ -187,7 +187,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int64, P, vecType> struct compute_linearRand<int64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<int64, P> call(vecType<int64, P> const & Min, vecType<int64, P> const & Max) GLM_FUNC_QUALIFIER static vecType<int64, P> call(vecType<int64, P> const & Min, vecType<int64, P> const & Max) GLM_NOEXCEPT
{ {
return (vecType<int64, P>(compute_rand<uint64, P, vecType>::call() % vecType<uint64, P>(Max + static_cast<int64>(1) - Min))) + Min; return (vecType<int64, P>(compute_rand<uint64, P, vecType>::call() % vecType<uint64, P>(Max + static_cast<int64>(1) - Min))) + Min;
} }
@ -196,7 +196,7 @@ namespace detail
template <precision P, template <class, precision> class vecType> template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint64, P, vecType> struct compute_linearRand<uint64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<uint64, P> call(vecType<uint64, P> const & Min, vecType<uint64, P> const & Max) GLM_FUNC_QUALIFIER static vecType<uint64, P> call(vecType<uint64, P> const & Min, vecType<uint64, P> const & Max) GLM_NOEXCEPT
{ {
return (compute_rand<uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min; return (compute_rand<uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
} }
@ -205,7 +205,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<float, lowp, vecType> struct compute_linearRand<float, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & Min, vecType<float, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & Min, vecType<float, lowp> const & Max) GLM_NOEXCEPT
{ {
return vecType<float, lowp>(compute_rand<uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min; return vecType<float, lowp>(compute_rand<uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min;
} }
@ -214,7 +214,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<float, mediump, vecType> struct compute_linearRand<float, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<float, mediump> call(vecType<float, mediump> const & Min, vecType<float, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<float, mediump> call(vecType<float, mediump> const & Min, vecType<float, mediump> const & Max) GLM_NOEXCEPT
{ {
return vecType<float, mediump>(compute_rand<uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; return vecType<float, mediump>(compute_rand<uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
} }
@ -223,7 +223,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<float, highp, vecType> struct compute_linearRand<float, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<float, highp> call(vecType<float, highp> const & Min, vecType<float, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<float, highp> call(vecType<float, highp> const & Min, vecType<float, highp> const & Max) GLM_NOEXCEPT
{ {
return vecType<float, highp>(compute_rand<uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<float, highp>(compute_rand<uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
@ -232,7 +232,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<double, lowp, vecType> struct compute_linearRand<double, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<double, lowp> call(vecType<double, lowp> const & Min, vecType<double, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<double, lowp> call(vecType<double, lowp> const & Min, vecType<double, lowp> const & Max) GLM_NOEXCEPT
{ {
return vecType<double, lowp>(compute_rand<uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; return vecType<double, lowp>(compute_rand<uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
} }
@ -241,7 +241,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<double, mediump, vecType> struct compute_linearRand<double, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<double, mediump> call(vecType<double, mediump> const & Min, vecType<double, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<double, mediump> call(vecType<double, mediump> const & Min, vecType<double, mediump> const & Max) GLM_NOEXCEPT
{ {
return vecType<double, mediump>(compute_rand<uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<double, mediump>(compute_rand<uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
@ -250,7 +250,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<double, highp, vecType> struct compute_linearRand<double, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<double, highp> call(vecType<double, highp> const & Min, vecType<double, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<double, highp> call(vecType<double, highp> const & Min, vecType<double, highp> const & Max) GLM_NOEXCEPT
{ {
return vecType<double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
@ -259,7 +259,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<long double, lowp, vecType> struct compute_linearRand<long double, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<long double, lowp> call(vecType<long double, lowp> const & Min, vecType<long double, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<long double, lowp> call(vecType<long double, lowp> const & Min, vecType<long double, lowp> const & Max) GLM_NOEXCEPT
{ {
return vecType<long double, lowp>(compute_rand<uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<long double, lowp>(compute_rand<uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
@ -268,7 +268,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<long double, mediump, vecType> struct compute_linearRand<long double, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<long double, mediump> call(vecType<long double, mediump> const & Min, vecType<long double, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<long double, mediump> call(vecType<long double, mediump> const & Min, vecType<long double, mediump> const & Max) GLM_NOEXCEPT
{ {
return vecType<long double, mediump>(compute_rand<uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<long double, mediump>(compute_rand<uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
@ -277,7 +277,7 @@ namespace detail
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_linearRand<long double, highp, vecType> struct compute_linearRand<long double, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<long double, highp> call(vecType<long double, highp> const & Min, vecType<long double, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<long double, highp> call(vecType<long double, highp> const & Min, vecType<long double, highp> const & Max) GLM_NOEXCEPT
{ {
return vecType<long double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<long double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
@ -285,7 +285,7 @@ namespace detail
}//namespace detail }//namespace detail
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) GLM_NOEXCEPT
{ {
return detail::compute_linearRand<genType, highp, tvec1>::call( return detail::compute_linearRand<genType, highp, tvec1>::call(
tvec1<genType, highp>(Min), tvec1<genType, highp>(Min),
@ -293,13 +293,13 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> linearRand(vecType<T, P> const & Min, vecType<T, P> const & Max) GLM_FUNC_QUALIFIER vecType<T, P> linearRand(vecType<T, P> const & Min, vecType<T, P> const & Max) GLM_NOEXCEPT
{ {
return detail::compute_linearRand<T, P, vecType>::call(Min, Max); return detail::compute_linearRand<T, P, vecType>::call(Min, Max);
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) GLM_NOEXCEPT
{ {
genType w, x1, x2; genType w, x1, x2;
@ -315,13 +315,13 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation) GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(gaussRand, Mean, Deviation); return detail::functor2<T, P, vecType>::call(gaussRand, Mean, Deviation);
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> diskRand(T Radius) GLM_FUNC_QUALIFIER tvec2<T, defaultp> diskRand(T Radius) GLM_NOEXCEPT
{ {
tvec2<T, defaultp> Result(T(0)); tvec2<T, defaultp> Result(T(0));
T LenRadius(T(0)); T LenRadius(T(0));
@ -339,7 +339,7 @@ namespace detail
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> ballRand(T Radius) GLM_FUNC_QUALIFIER tvec3<T, defaultp> ballRand(T Radius) GLM_NOEXCEPT
{ {
tvec3<T, defaultp> Result(T(0)); tvec3<T, defaultp> Result(T(0));
T LenRadius(T(0)); T LenRadius(T(0));
@ -356,15 +356,16 @@ namespace detail
return Result; return Result;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> circularRand(T Radius) GLM_FUNC_QUALIFIER tvec2<T, defaultp> circularRand(T Radius) GLM_NOEXCEPT
{ {
T a = linearRand(T(0), T(6.283185307179586476925286766559f)); T a = linearRand(T(0), T(6.283185307179586476925286766559f));
return tvec2<T, defaultp>(cos(a), sin(a)) * Radius; return tvec2<T, defaultp>(cos(a), sin(a)) * Radius;
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> sphericalRand(T Radius) GLM_FUNC_QUALIFIER tvec3<T, defaultp> sphericalRand(T Radius) GLM_NOEXCEPT
{ {
T z = linearRand(T(-1), T(1)); T z = linearRand(T(-1), T(1));
T a = linearRand(T(0), T(6.283185307179586476925286766559f)); T a = linearRand(T(0), T(6.283185307179586476925286766559f));

View File

@ -58,75 +58,75 @@ namespace glm
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType sec(genType const & angle); GLM_FUNC_DECL genType sec(genType const & angle) GLM_NOEXCEPT;
/// Cosecant function. /// Cosecant function.
/// hypotenuse / opposite or 1 / sin(x) /// hypotenuse / opposite or 1 / sin(x)
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType csc(genType const & angle); GLM_FUNC_DECL genType csc(genType const & angle) GLM_NOEXCEPT;
/// Cotangent function. /// Cotangent function.
/// adjacent / opposite or 1 / tan(x) /// adjacent / opposite or 1 / tan(x)
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType cot(genType const & angle); GLM_FUNC_DECL genType cot(genType const & angle) GLM_NOEXCEPT;
/// Inverse secant function. /// Inverse secant function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType asec(genType const & x); GLM_FUNC_DECL genType asec(genType const & x) GLM_NOEXCEPT;
/// Inverse cosecant function. /// Inverse cosecant function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType acsc(genType const & x); GLM_FUNC_DECL genType acsc(genType const & x) GLM_NOEXCEPT;
/// Inverse cotangent function. /// Inverse cotangent function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType acot(genType const & x); GLM_FUNC_DECL genType acot(genType const & x) GLM_NOEXCEPT;
/// Secant hyperbolic function. /// Secant hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType sech(genType const & angle); GLM_FUNC_DECL genType sech(genType const & angle) GLM_NOEXCEPT;
/// Cosecant hyperbolic function. /// Cosecant hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType csch(genType const & angle); GLM_FUNC_DECL genType csch(genType const & angle) GLM_NOEXCEPT;
/// Cotangent hyperbolic function. /// Cotangent hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType coth(genType const & angle); GLM_FUNC_DECL genType coth(genType const & angle) GLM_NOEXCEPT;
/// Inverse secant hyperbolic function. /// Inverse secant hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType asech(genType const & x); GLM_FUNC_DECL genType asech(genType const & x) GLM_NOEXCEPT;
/// Inverse cosecant hyperbolic function. /// Inverse cosecant hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType acsch(genType const & x); GLM_FUNC_DECL genType acsch(genType const & x) GLM_NOEXCEPT;
/// Inverse cotangent hyperbolic function. /// Inverse cotangent hyperbolic function.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType acoth(genType const & x); GLM_FUNC_DECL genType acoth(genType const & x) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -37,14 +37,14 @@ namespace glm
{ {
// sec // sec
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType sec(genType angle) GLM_FUNC_QUALIFIER genType sec(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sec' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sec' only accept floating-point values");
return genType(1) / glm::cos(angle); return genType(1) / glm::cos(angle);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sec(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> sec(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(sec, x); return detail::functor1<T, T, P, vecType>::call(sec, x);
@ -52,14 +52,14 @@ namespace glm
// csc // csc
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType csc(genType angle) GLM_FUNC_QUALIFIER genType csc(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csc' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csc' only accept floating-point values");
return genType(1) / glm::sin(angle); return genType(1) / glm::sin(angle);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> csc(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> csc(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(csc, x); return detail::functor1<T, T, P, vecType>::call(csc, x);
@ -67,7 +67,7 @@ namespace glm
// cot // cot
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType cot(genType angle) GLM_FUNC_QUALIFIER genType cot(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values");
@ -76,7 +76,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> cot(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> cot(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(cot, x); return detail::functor1<T, T, P, vecType>::call(cot, x);
@ -84,14 +84,14 @@ namespace glm
// asec // asec
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType asec(genType x) GLM_FUNC_QUALIFIER genType asec(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asec' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asec' only accept floating-point values");
return acos(genType(1) / x); return acos(genType(1) / x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asec(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> asec(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(asec, x); return detail::functor1<T, T, P, vecType>::call(asec, x);
@ -99,14 +99,14 @@ namespace glm
// acsc // acsc
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType acsc(genType x) GLM_FUNC_QUALIFIER genType acsc(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsc' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsc' only accept floating-point values");
return asin(genType(1) / x); return asin(genType(1) / x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acsc(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> acsc(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(acsc, x); return detail::functor1<T, T, P, vecType>::call(acsc, x);
@ -114,7 +114,7 @@ namespace glm
// acot // acot
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType acot(genType x) GLM_FUNC_QUALIFIER genType acot(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acot' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acot' only accept floating-point values");
@ -123,7 +123,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acot(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> acot(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(acot, x); return detail::functor1<T, T, P, vecType>::call(acot, x);
@ -131,14 +131,14 @@ namespace glm
// sech // sech
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType sech(genType angle) GLM_FUNC_QUALIFIER genType sech(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sech' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sech' only accept floating-point values");
return genType(1) / glm::cosh(angle); return genType(1) / glm::cosh(angle);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sech(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> sech(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(sech, x); return detail::functor1<T, T, P, vecType>::call(sech, x);
@ -146,14 +146,14 @@ namespace glm
// csch // csch
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType csch(genType angle) GLM_FUNC_QUALIFIER genType csch(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csch' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csch' only accept floating-point values");
return genType(1) / glm::sinh(angle); return genType(1) / glm::sinh(angle);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> csch(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> csch(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(csch, x); return detail::functor1<T, T, P, vecType>::call(csch, x);
@ -161,14 +161,14 @@ namespace glm
// coth // coth
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType coth(genType angle) GLM_FUNC_QUALIFIER genType coth(genType angle) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'coth' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'coth' only accept floating-point values");
return glm::cosh(angle) / glm::sinh(angle); return glm::cosh(angle) / glm::sinh(angle);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> coth(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> coth(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(coth, x); return detail::functor1<T, T, P, vecType>::call(coth, x);
@ -176,14 +176,14 @@ namespace glm
// asech // asech
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType asech(genType x) GLM_FUNC_QUALIFIER genType asech(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asech' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asech' only accept floating-point values");
return acosh(genType(1) / x); return acosh(genType(1) / x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asech(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> asech(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(asech, x); return detail::functor1<T, T, P, vecType>::call(asech, x);
@ -191,14 +191,14 @@ namespace glm
// acsch // acsch
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType acsch(genType x) GLM_FUNC_QUALIFIER genType acsch(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsch' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsch' only accept floating-point values");
return acsch(genType(1) / x); return acsch(genType(1) / x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acsch(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> acsch(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(acsch, x); return detail::functor1<T, T, P, vecType>::call(acsch, x);
@ -206,14 +206,14 @@ namespace glm
// acoth // acoth
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType acoth(genType x) GLM_FUNC_QUALIFIER genType acoth(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acoth' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acoth' only accept floating-point values");
return atanh(genType(1) / x); return atanh(genType(1) / x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acoth(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> acoth(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(acoth, x); return detail::functor1<T, T, P, vecType>::call(acoth, x);

View File

@ -63,71 +63,71 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value); GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value) GLM_NOEXCEPT;
/// Return true if the value is a power of two number. /// Return true if the value is a power of two number.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value); GLM_FUNC_DECL vecType<bool, P> isPowerOfTwo(vecType<T, P> const & value) GLM_NOEXCEPT;
/// Return the power of two number which value is just higher the input value, /// Return the power of two number which value is just higher the input value,
/// round up to a power of two. /// round up to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value) GLM_NOEXCEPT;
/// Return the power of two number which value is just higher the input value, /// Return the power of two number which value is just higher the input value,
/// round up to a power of two. /// round up to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value); GLM_FUNC_DECL vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & value) GLM_NOEXCEPT;
/// Return the power of two number which value is just lower the input value, /// Return the power of two number which value is just lower the input value,
/// round down to a power of two. /// round down to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value) GLM_NOEXCEPT;
/// Return the power of two number which value is just lower the input value, /// Return the power of two number which value is just lower the input value,
/// round down to a power of two. /// round down to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value); GLM_FUNC_DECL vecType<T, P> floorPowerOfTwo(vecType<T, P> const & value) GLM_NOEXCEPT;
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value) GLM_NOEXCEPT;
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value); GLM_FUNC_DECL vecType<T, P> roundPowerOfTwo(vecType<T, P> const & value) GLM_NOEXCEPT;
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template <typename genIUType>
GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple); GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple) GLM_NOEXCEPT;
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple); GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple) GLM_NOEXCEPT;
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple); GLM_FUNC_DECL vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple) GLM_NOEXCEPT;
/// Higher multiple number of Source. /// Higher multiple number of Source.
/// ///
@ -137,7 +137,7 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple); GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple) GLM_NOEXCEPT;
/// Higher multiple number of Source. /// Higher multiple number of Source.
/// ///
@ -147,7 +147,7 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple); GLM_FUNC_DECL vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_NOEXCEPT;
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@ -159,7 +159,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType floorMultiple( GLM_FUNC_DECL genType floorMultiple(
genType Source, genType Source,
genType Multiple); genType Multiple) GLM_NOEXCEPT;
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@ -171,7 +171,7 @@ namespace glm
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floorMultiple( GLM_FUNC_DECL vecType<T, P> floorMultiple(
vecType<T, P> const & Source, vecType<T, P> const & Source,
vecType<T, P> const & Multiple); vecType<T, P> const & Multiple) GLM_NOEXCEPT;
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@ -183,7 +183,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType roundMultiple( GLM_FUNC_DECL genType roundMultiple(
genType Source, genType Source,
genType Multiple); genType Multiple) GLM_NOEXCEPT;
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@ -195,7 +195,7 @@ namespace glm
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundMultiple( GLM_FUNC_DECL vecType<T, P> roundMultiple(
vecType<T, P> const & Source, vecType<T, P> const & Source,
vecType<T, P> const & Multiple); vecType<T, P> const & Multiple) GLM_NOEXCEPT;
/// @} /// @}
} //namespace glm } //namespace glm

View File

@ -37,7 +37,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType, bool compute = false> template <typename T, precision P, template <typename, precision> class vecType, bool compute = false>
struct compute_ceilShift struct compute_ceilShift
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T) GLM_NOEXCEPT
{ {
return v; return v;
} }
@ -46,7 +46,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
struct compute_ceilShift<T, P, vecType, true> struct compute_ceilShift<T, P, vecType, true>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Shift) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & v, T Shift) GLM_NOEXCEPT
{ {
return v | (v >> Shift); return v | (v >> Shift);
} }
@ -55,7 +55,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType, bool isSigned = true> template <typename T, precision P, template <typename, precision> class vecType, bool isSigned = true>
struct compute_ceilPowerOfTwo struct compute_ceilPowerOfTwo
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
@ -77,7 +77,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
struct compute_ceilPowerOfTwo<T, P, vecType, false> struct compute_ceilPowerOfTwo<T, P, vecType, false>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
@ -101,7 +101,7 @@ namespace detail
struct compute_ceilMultiple<true, true> struct compute_ceilMultiple<true, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source > genType(0)) if(Source > genType(0))
{ {
@ -117,7 +117,7 @@ namespace detail
struct compute_ceilMultiple<false, false> struct compute_ceilMultiple<false, false>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
genType Tmp = Source - genType(1); genType Tmp = Source - genType(1);
return Tmp + (Multiple - (Tmp % Multiple)); return Tmp + (Multiple - (Tmp % Multiple));
@ -128,7 +128,7 @@ namespace detail
struct compute_ceilMultiple<false, true> struct compute_ceilMultiple<false, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source > genType(0)) if(Source > genType(0))
{ {
@ -147,7 +147,7 @@ namespace detail
struct compute_floorMultiple<true, true> struct compute_floorMultiple<true, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - std::fmod(Source, Multiple); return Source - std::fmod(Source, Multiple);
@ -163,7 +163,7 @@ namespace detail
struct compute_floorMultiple<false, false> struct compute_floorMultiple<false, false>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - Source % Multiple; return Source - Source % Multiple;
@ -179,7 +179,7 @@ namespace detail
struct compute_floorMultiple<false, true> struct compute_floorMultiple<false, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - Source % Multiple; return Source - Source % Multiple;
@ -198,7 +198,7 @@ namespace detail
struct compute_roundMultiple<true, true> struct compute_roundMultiple<true, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - std::fmod(Source, Multiple); return Source - std::fmod(Source, Multiple);
@ -214,7 +214,7 @@ namespace detail
struct compute_roundMultiple<false, false> struct compute_roundMultiple<false, false>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - Source % Multiple; return Source - Source % Multiple;
@ -230,7 +230,7 @@ namespace detail
struct compute_roundMultiple<false, true> struct compute_roundMultiple<false, true>
{ {
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
if(Source >= genType(0)) if(Source >= genType(0))
return Source - Source % Multiple; return Source - Source % Multiple;
@ -247,14 +247,14 @@ namespace detail
// isPowerOfTwo // isPowerOfTwo
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value) GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value) GLM_NOEXCEPT
{ {
genType const Result = glm::abs(Value); genType const Result = glm::abs(Value);
return !(Result & (Result - 1)); return !(Result & (Result - 1));
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> isPowerOfTwo(vecType<T, P> const & Value) GLM_FUNC_QUALIFIER vecType<bool, P> isPowerOfTwo(vecType<T, P> const & Value) GLM_NOEXCEPT
{ {
vecType<T, P> const Result(abs(Value)); vecType<T, P> const Result(abs(Value));
return equal(Result & (Result - 1), vecType<T, P>(0)); return equal(Result & (Result - 1), vecType<T, P>(0));
@ -264,13 +264,13 @@ namespace detail
// ceilPowerOfTwo // ceilPowerOfTwo
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) GLM_NOEXCEPT
{ {
return detail::compute_ceilPowerOfTwo<genType, defaultp, tvec1, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x; return detail::compute_ceilPowerOfTwo<genType, defaultp, tvec1, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> ceilPowerOfTwo(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::compute_ceilPowerOfTwo<T, P, vecType, std::numeric_limits<T>::is_signed>::call(v); return detail::compute_ceilPowerOfTwo<T, P, vecType, std::numeric_limits<T>::is_signed>::call(v);
} }
@ -279,13 +279,13 @@ namespace detail
// floorPowerOfTwo // floorPowerOfTwo
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) GLM_NOEXCEPT
{ {
return isPowerOfTwo(value) ? value : highestBitValue(value); return isPowerOfTwo(value) ? value : highestBitValue(value);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> floorPowerOfTwo(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> floorPowerOfTwo(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(floorPowerOfTwo, v); return detail::functor1<T, T, P, vecType>::call(floorPowerOfTwo, v);
} }
@ -294,7 +294,7 @@ namespace detail
// roundPowerOfTwo // roundPowerOfTwo
template <typename genIUType> template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) GLM_NOEXCEPT
{ {
if(isPowerOfTwo(value)) if(isPowerOfTwo(value))
return value; return value;
@ -305,7 +305,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> roundPowerOfTwo(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> roundPowerOfTwo(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(roundPowerOfTwo, v); return detail::functor1<T, T, P, vecType>::call(roundPowerOfTwo, v);
} }
@ -314,19 +314,19 @@ namespace detail
// isMultiple // isMultiple
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple) GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple) GLM_NOEXCEPT
{ {
return isMultiple(tvec1<genType>(Value), tvec1<genType>(Multiple)).x; return isMultiple(tvec1<genType>(Value), tvec1<genType>(Multiple)).x;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple) GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, T Multiple) GLM_NOEXCEPT
{ {
return (Value % Multiple) == vecType<T, P>(0); return (Value % Multiple) == vecType<T, P>(0);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<bool, P> isMultiple(vecType<T, P> const & Value, vecType<T, P> const & Multiple) GLM_NOEXCEPT
{ {
return (Value % Multiple) == vecType<T, P>(0); return (Value % Multiple) == vecType<T, P>(0);
} }
@ -335,13 +335,13 @@ namespace detail
// ceilMultiple // ceilMultiple
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<T, P> ceilMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(ceilMultiple, Source, Multiple); return detail::functor2<T, P, vecType>::call(ceilMultiple, Source, Multiple);
} }
@ -350,13 +350,13 @@ namespace detail
// floorMultiple // floorMultiple
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> floorMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<T, P> floorMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(floorMultiple, Source, Multiple); return detail::functor2<T, P, vecType>::call(floorMultiple, Source, Multiple);
} }
@ -365,13 +365,13 @@ namespace detail
// roundMultiple // roundMultiple
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) GLM_NOEXCEPT
{ {
return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> roundMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<T, P> roundMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(roundMultiple, Source, Multiple); return detail::functor2<T, P, vecType>::call(roundMultiple, Source, Multiple);
} }

View File

@ -90,87 +90,87 @@ namespace glm
/// Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename genType> template<typename genType>
GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const & vec); GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const & vec) GLM_NOEXCEPT;
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tvec2<T, defaultp> make_vec2(T const * const ptr); GLM_FUNC_DECL tvec2<T, defaultp> make_vec2(T const * const ptr) GLM_NOEXCEPT;
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tvec3<T, defaultp> make_vec3(T const * const ptr); GLM_FUNC_DECL tvec3<T, defaultp> make_vec3(T const * const ptr) GLM_NOEXCEPT;
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tvec4<T, defaultp> make_vec4(T const * const ptr); GLM_FUNC_DECL tvec4<T, defaultp> make_vec4(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2x2(T const * const ptr); GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2x2(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat2x3<T, defaultp> make_mat2x3(T const * const ptr); GLM_FUNC_DECL tmat2x3<T, defaultp> make_mat2x3(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat2x4<T, defaultp> make_mat2x4(T const * const ptr); GLM_FUNC_DECL tmat2x4<T, defaultp> make_mat2x4(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat3x2<T, defaultp> make_mat3x2(T const * const ptr); GLM_FUNC_DECL tmat3x2<T, defaultp> make_mat3x2(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3x3(T const * const ptr); GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3x3(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat3x4<T, defaultp> make_mat3x4(T const * const ptr); GLM_FUNC_DECL tmat3x4<T, defaultp> make_mat3x4(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat4x2<T, defaultp> make_mat4x2(T const * const ptr); GLM_FUNC_DECL tmat4x2<T, defaultp> make_mat4x2(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat4x3<T, defaultp> make_mat4x3(T const * const ptr); GLM_FUNC_DECL tmat4x3<T, defaultp> make_mat4x3(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4x4(T const * const ptr); GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4x4(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2(T const * const ptr); GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3(T const * const ptr); GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3(T const * const ptr) GLM_NOEXCEPT;
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4(T const * const ptr); GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4(T const * const ptr) GLM_NOEXCEPT;
/// Build a quaternion from a pointer. /// Build a quaternion from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_DECL tquat<T, defaultp> make_quat(T const * const ptr); GLM_FUNC_DECL tquat<T, defaultp> make_quat(T const * const ptr) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -43,7 +43,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tvec2<T, P> const & vec tvec2<T, P> const & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -54,7 +54,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tvec2<T, P> & vec tvec2<T, P> & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -65,7 +65,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tvec3<T, P> const & vec tvec3<T, P> const & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -76,7 +76,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tvec3<T, P> & vec tvec3<T, P> & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -87,7 +87,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tvec4<T, P> const & vec tvec4<T, P> const & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -98,7 +98,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tvec4<T, P> & vec tvec4<T, P> & vec
) ) GLM_NOEXCEPT
{ {
return &(vec.x); return &(vec.x);
} }
@ -109,7 +109,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat2x2<T, P> const & mat tmat2x2<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -120,7 +120,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat2x2<T, P> & mat tmat2x2<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -131,7 +131,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat3x3<T, P> const & mat tmat3x3<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -142,7 +142,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat3x3<T, P> & mat tmat3x3<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -153,7 +153,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat4x4<T, P> const & mat tmat4x4<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -164,7 +164,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat4x4<T, P> & mat tmat4x4<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -175,7 +175,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat2x3<T, P> const & mat tmat2x3<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -186,7 +186,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat2x3<T, P> & mat tmat2x3<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -197,7 +197,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat3x2<T, P> const & mat tmat3x2<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -208,7 +208,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat3x2<T, P> & mat tmat3x2<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -219,7 +219,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat2x4<T, P> const & mat tmat2x4<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -230,7 +230,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat2x4<T, P> & mat tmat2x4<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -241,7 +241,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat4x2<T, P> const & mat tmat4x2<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -252,7 +252,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat4x2<T, P> & mat tmat4x2<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -263,7 +263,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat3x4<T, P> const & mat tmat3x4<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -274,7 +274,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tmat3x4<T, P> & mat tmat3x4<T, P> & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -285,7 +285,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tmat4x3<T, P> const & mat tmat4x3<T, P> const & mat
) ) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -293,7 +293,7 @@ namespace glm
/// Return the address to the data of the matrix input. /// Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr(tmat4x3<T, P> & mat) GLM_FUNC_QUALIFIER T * value_ptr(tmat4x3<T, P> & mat) GLM_NOEXCEPT
{ {
return &(mat[0].x); return &(mat[0].x);
} }
@ -304,7 +304,7 @@ namespace glm
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
tquat<T, P> const & q tquat<T, P> const & q
) ) GLM_NOEXCEPT
{ {
return &(q[0]); return &(q[0]);
} }
@ -315,7 +315,7 @@ namespace glm
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T * value_ptr
( (
tquat<T, P> & q tquat<T, P> & q
) ) GLM_NOEXCEPT
{ {
return &(q[0]); return &(q[0]);
} }
@ -323,7 +323,7 @@ namespace glm
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> make_vec2(T const * const ptr) GLM_FUNC_QUALIFIER tvec2<T, defaultp> make_vec2(T const * const ptr) GLM_NOEXCEPT
{ {
tvec2<T, defaultp> Result; tvec2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec2<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tvec2<T, defaultp>));
@ -333,7 +333,7 @@ namespace glm
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> make_vec3(T const * const ptr) GLM_FUNC_QUALIFIER tvec3<T, defaultp> make_vec3(T const * const ptr) GLM_NOEXCEPT
{ {
tvec3<T, defaultp> Result; tvec3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec3<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tvec3<T, defaultp>));
@ -343,7 +343,7 @@ namespace glm
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec4<T, defaultp> make_vec4(T const * const ptr) GLM_FUNC_QUALIFIER tvec4<T, defaultp> make_vec4(T const * const ptr) GLM_NOEXCEPT
{ {
tvec4<T, defaultp> Result; tvec4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec4<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tvec4<T, defaultp>));
@ -353,7 +353,7 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2x2(T const * const ptr) GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2x2(T const * const ptr) GLM_NOEXCEPT
{ {
tmat2x2<T, defaultp> Result; tmat2x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x2<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat2x2<T, defaultp>));
@ -363,7 +363,7 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat2x3<T, defaultp> make_mat2x3(T const * const ptr) GLM_FUNC_QUALIFIER tmat2x3<T, defaultp> make_mat2x3(T const * const ptr) GLM_NOEXCEPT
{ {
tmat2x3<T, defaultp> Result; tmat2x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x3<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat2x3<T, defaultp>));
@ -373,7 +373,7 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat2x4<T, defaultp> make_mat2x4(T const * const ptr) GLM_FUNC_QUALIFIER tmat2x4<T, defaultp> make_mat2x4(T const * const ptr) GLM_NOEXCEPT
{ {
tmat2x4<T, defaultp> Result; tmat2x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x4<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat2x4<T, defaultp>));
@ -383,7 +383,7 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat3x2<T, defaultp> make_mat3x2(T const * const ptr) GLM_FUNC_QUALIFIER tmat3x2<T, defaultp> make_mat3x2(T const * const ptr) GLM_NOEXCEPT
{ {
tmat3x2<T, defaultp> Result; tmat3x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x2<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat3x2<T, defaultp>));
@ -393,7 +393,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3x3(T const * const ptr) GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3x3(T const * const ptr) GLM_NOEXCEPT
{ {
tmat3x3<T, defaultp> Result; tmat3x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x3<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat3x3<T, defaultp>));
@ -403,7 +403,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat3x4<T, defaultp> make_mat3x4(T const * const ptr) GLM_FUNC_QUALIFIER tmat3x4<T, defaultp> make_mat3x4(T const * const ptr) GLM_NOEXCEPT
{ {
tmat3x4<T, defaultp> Result; tmat3x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x4<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat3x4<T, defaultp>));
@ -413,7 +413,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat4x2<T, defaultp> make_mat4x2(T const * const ptr) GLM_FUNC_QUALIFIER tmat4x2<T, defaultp> make_mat4x2(T const * const ptr) GLM_NOEXCEPT
{ {
tmat4x2<T, defaultp> Result; tmat4x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x2<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat4x2<T, defaultp>));
@ -423,7 +423,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat4x3<T, defaultp> make_mat4x3(T const * const ptr) GLM_FUNC_QUALIFIER tmat4x3<T, defaultp> make_mat4x3(T const * const ptr) GLM_NOEXCEPT
{ {
tmat4x3<T, defaultp> Result; tmat4x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x3<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat4x3<T, defaultp>));
@ -433,7 +433,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4x4(T const * const ptr) GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4x4(T const * const ptr) GLM_NOEXCEPT
{ {
tmat4x4<T, defaultp> Result; tmat4x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x4<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tmat4x4<T, defaultp>));
@ -443,7 +443,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2(T const * const ptr) GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2(T const * const ptr) GLM_NOEXCEPT
{ {
return make_mat2x2(ptr); return make_mat2x2(ptr);
} }
@ -451,7 +451,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3(T const * const ptr) GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3(T const * const ptr) GLM_NOEXCEPT
{ {
return make_mat3x3(ptr); return make_mat3x3(ptr);
} }
@ -459,7 +459,7 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4(T const * const ptr) GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4(T const * const ptr) GLM_NOEXCEPT
{ {
return make_mat4x4(ptr); return make_mat4x4(ptr);
} }
@ -467,7 +467,7 @@ namespace glm
//! Build a quaternion from a pointer. //! Build a quaternion from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const * const ptr) GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const * const ptr) GLM_NOEXCEPT
{ {
tquat<T, defaultp> Result; tquat<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>));

View File

@ -59,32 +59,32 @@ namespace glm
/// Return the next ULP value(s) after the input value(s). /// Return the next ULP value(s) after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType next_float(genType const & x); GLM_FUNC_DECL genType next_float(genType const & x) GLM_NOEXCEPT;
/// Return the previous ULP value(s) before the input value(s). /// Return the previous ULP value(s) before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType prev_float(genType const & x); GLM_FUNC_DECL genType prev_float(genType const & x) GLM_NOEXCEPT;
/// Return the value(s) ULP distance after the input value(s). /// Return the value(s) ULP distance after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance); GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance) GLM_NOEXCEPT;
/// Return the value(s) ULP distance before the input value(s). /// Return the value(s) ULP distance before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance); GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance) GLM_NOEXCEPT;
/// Return the distance in the number of ULP between 2 scalars. /// Return the distance in the number of ULP between 2 scalars.
/// @see gtc_ulp /// @see gtc_ulp
template <typename T> template <typename T>
GLM_FUNC_DECL uint float_distance(T const & x, T const & y); GLM_FUNC_DECL uint float_distance(T const & x, T const & y) GLM_NOEXCEPT;
/// Return the distance in the number of ULP between 2 vectors. /// Return the distance in the number of ULP between 2 vectors.
/// @see gtc_ulp /// @see gtc_ulp
template<typename T, template<typename> class vecType> template<typename T, template<typename> class vecType>
GLM_FUNC_DECL vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y); GLM_FUNC_DECL vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y) GLM_NOEXCEPT;
/// @} /// @}
}// namespace glm }// namespace glm

View File

@ -97,7 +97,7 @@ typedef union
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
GLM_FUNC_QUALIFIER float nextafterf(float x, float y) GLM_FUNC_QUALIFIER float nextafterf(float x, float y) GLM_NOEXCEPT
{ {
volatile float t; volatile float t;
glm::detail::int32 hx, hy, ix, iy; glm::detail::int32 hx, hy, ix, iy;
@ -142,7 +142,7 @@ namespace detail
return x; return x;
} }
GLM_FUNC_QUALIFIER double nextafter(double x, double y) GLM_FUNC_QUALIFIER double nextafter(double x, double y) GLM_NOEXCEPT
{ {
volatile double t; volatile double t;
glm::detail::int32 hx, hy, ix, iy; glm::detail::int32 hx, hy, ix, iy;
@ -201,7 +201,7 @@ namespace detail
namespace glm namespace glm
{ {
template <> template <>
GLM_FUNC_QUALIFIER float next_float(float const & x) GLM_FUNC_QUALIFIER float next_float(float const & x) GLM_NOEXCEPT
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::nextafter(x, std::numeric_limits<float>::max()); return std::nextafter(x, std::numeric_limits<float>::max());
@ -215,7 +215,7 @@ namespace glm
} }
template <> template <>
GLM_FUNC_QUALIFIER double next_float(double const & x) GLM_FUNC_QUALIFIER double next_float(double const & x) GLM_NOEXCEPT
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::nextafter(x, std::numeric_limits<double>::max()); return std::nextafter(x, std::numeric_limits<double>::max());
@ -229,7 +229,7 @@ namespace glm
} }
template<typename T, precision P, template<typename, precision> class vecType> template<typename T, precision P, template<typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
vecType<T, P> Result(uninitialize); vecType<T, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i)
@ -237,7 +237,7 @@ namespace glm
return Result; return Result;
} }
GLM_FUNC_QUALIFIER float prev_float(float const & x) GLM_FUNC_QUALIFIER float prev_float(float const & x) GLM_NOEXCEPT
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::nextafter(x, std::numeric_limits<float>::min()); return std::nextafter(x, std::numeric_limits<float>::min());
@ -250,7 +250,7 @@ namespace glm
# endif # endif
} }
GLM_FUNC_QUALIFIER double prev_float(double const & x) GLM_FUNC_QUALIFIER double prev_float(double const & x) GLM_NOEXCEPT
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::nextafter(x, std::numeric_limits<double>::min()); return std::nextafter(x, std::numeric_limits<double>::min());
@ -264,7 +264,7 @@ namespace glm
} }
template<typename T, precision P, template<typename, precision> class vecType> template<typename T, precision P, template<typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
vecType<T, P> Result(uninitialize); vecType<T, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i)
@ -273,7 +273,7 @@ namespace glm
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps) GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps) GLM_NOEXCEPT
{ {
T temp = x; T temp = x;
for(uint i = 0; i < ulps; ++i) for(uint i = 0; i < ulps; ++i)
@ -282,7 +282,7 @@ namespace glm
} }
template<typename T, precision P, template<typename, precision> class vecType> template<typename T, precision P, template<typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) GLM_FUNC_QUALIFIER vecType<T, P> next_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) GLM_NOEXCEPT
{ {
vecType<T, P> Result(uninitialize); vecType<T, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i)
@ -291,7 +291,7 @@ namespace glm
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps) GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps) GLM_NOEXCEPT
{ {
T temp = x; T temp = x;
for(uint i = 0; i < ulps; ++i) for(uint i = 0; i < ulps; ++i)
@ -300,7 +300,7 @@ namespace glm
} }
template<typename T, precision P, template<typename, precision> class vecType> template<typename T, precision P, template<typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) GLM_FUNC_QUALIFIER vecType<T, P> prev_float(vecType<T, P> const & x, vecType<uint, P> const & ulps) GLM_NOEXCEPT
{ {
vecType<T, P> Result(uninitialize); vecType<T, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i)
@ -309,7 +309,7 @@ namespace glm
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y) GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y) GLM_NOEXCEPT
{ {
uint ulp = 0; uint ulp = 0;
@ -340,7 +340,7 @@ namespace glm
} }
template<typename T, precision P, template<typename, precision> class vecType> template<typename T, precision P, template<typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<uint, P> float_distance(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<uint, P> float_distance(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
vecType<uint, P> Result(uninitialize); vecType<uint, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i) for(detail::component_count_t i = 0; i < detail::component_count(Result); ++i)