cleanup : Remove trailing whitespaces.

This commit is contained in:
Philippe Groarke
2018-03-24 20:01:03 -04:00
parent a5072f5ce5
commit fd327cd341
142 changed files with 1603 additions and 1603 deletions

View File

@@ -6,9 +6,9 @@
///
/// @defgroup gtc_bitfield GLM_GTC_bitfield
/// @ingroup gtc
///
///
/// Include <glm/gtc/bitfield.hpp> to use the features of this extension.
///
///
/// Allow to perform bit operations on integer values
#include "../detail/setup.hpp"
@@ -35,7 +35,7 @@ namespace glm
/// @see gtc_bitfield
template<typename genIUType>
GLM_FUNC_DECL genIUType mask(genIUType Bits);
/// Build a mask of 'count' bits
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
@@ -113,112 +113,112 @@ namespace glm
/// Interleaves the bits of x and 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.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
/// 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 other bits are interleaved following the previous sequence.
///
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);

View File

@@ -103,7 +103,7 @@ namespace detail
return REG1 | (REG2 << 1) | (REG3 << 2);
}
template<>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z)
{

View File

@@ -7,7 +7,7 @@
/// @ingroup gtc
///
/// Include <glm/gtc/constants.hpp> to use the features of this extension.
///
///
/// Provide a list of constants and precomputed useful values.
#pragma once

View File

@@ -50,7 +50,7 @@ namespace glm
template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi()
{
return genType(4.71238898038468985769396507491925432);
return genType(4.71238898038468985769396507491925432);
}
template<typename genType>

View File

@@ -1,6 +1,6 @@
/// @ref gtc_epsilon
/// @file glm/gtc/epsilon.hpp
///
///
/// @see core (dependence)
/// @see gtc_quaternion (dependence)
///
@@ -8,7 +8,7 @@
/// @ingroup gtc
///
/// Include <glm/gtc/epsilon.hpp> to use the features of this extension.
///
///
/// Comparison functions for a user defined epsilon values.
#pragma once

View File

@@ -38,10 +38,10 @@ namespace glm
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
/// implementation, presumably the direction that is fastest.
///
///
/// @param x The values of the argument must be greater or equal to zero.
/// @tparam T floating point scalar types.
///
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer
template<length_t L, typename T, qualifier Q>
@@ -50,10 +50,10 @@ namespace glm
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
/// implementation, presumably the direction that is fastest.
///
///
/// @param x The values of the argument must be greater or equal to zero.
/// @tparam T floating point scalar types.
///
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer
template<length_t L, typename T, qualifier Q>

View File

@@ -134,7 +134,7 @@ namespace glm
/// Low-qualifier signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef mat<2, 2, int, lowp> lowp_imat2;
/// Low-qualifier signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef mat<3, 3, int, lowp> lowp_imat3;
@@ -183,7 +183,7 @@ namespace glm
/// High-qualifier unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef mat<2, 2, uint, highp> highp_umat2;
typedef mat<2, 2, uint, highp> highp_umat2;
/// High-qualifier unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
@@ -283,7 +283,7 @@ namespace glm
/// Low-qualifier unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef mat<2, 2, uint, lowp> lowp_umat2;
/// Low-qualifier unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef mat<3, 3, uint, lowp> lowp_umat3;
@@ -433,7 +433,7 @@ namespace glm
typedef lowp_umat4x3 umat4x3;
typedef lowp_umat4x4 umat4x4;
#else //if(defined(GLM_PRECISION_MEDIUMP_UINT))
/// Unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef mediump_umat2 umat2;

View File

@@ -29,15 +29,15 @@ namespace glm
/// @{
/// Fast matrix inverse for affine matrix.
///
///
/// @param m Input matrix to invert.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
/// @see gtc_matrix_inverse
template<typename genType>
template<typename genType>
GLM_FUNC_DECL genType affineInverse(genType const& m);
/// Compute the inverse transpose of a matrix.
///
///
/// @param m Input matrix to invert transpose.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
/// @see gtc_matrix_inverse

View File

@@ -4,7 +4,7 @@
/// @see core (dependence)
/// @see gtx_transform
/// @see gtx_transform2
///
///
/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform
/// @ingroup gtc
///
@@ -14,7 +14,7 @@
///
/// The matrices generated by this extension use standard OpenGL fixed-function
/// conventions. For example, the lookAt function generates a transform from world
/// space into the specific eye space that the projective matrix functions
/// space into the specific eye space that the projective matrix functions
/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility
/// specifications defines the particular layout of this eye space.
@@ -37,7 +37,7 @@ namespace glm
/// @{
/// Builds a translation 4 * 4 matrix created from a vector of 3 components.
///
///
/// @param m Input matrix multiplied by this translation matrix.
/// @param v Coordinates of a translation vector.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
@@ -54,34 +54,34 @@ namespace glm
/// @see gtc_matrix_transform
/// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z)
/// @see - translate(vec<3, T, Q> const& v)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTranslate.xml">glTranslate man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTranslate.xml">glTranslate man page</a>
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> translate(
mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
/// @param m Input matrix multiplied by this rotation matrix.
/// @param angle Rotation angle expressed in radians.
/// @param axis Rotation axis, recommended to be normalized.
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
/// @see gtc_matrix_transform
/// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, Q> const& v)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glRotate.xml">glRotate man page</a>
/// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, Q> const& v)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glRotate.xml">glRotate man page</a>
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> rotate(
mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
/// @param m Input matrix multiplied by this scale matrix.
/// @param v Ratio of scaling for each axis.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
/// @see gtc_matrix_transform
/// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z)
/// @see - scale(vec<3, T, Q> const& v)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glScale.xml">glScale man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glScale.xml">glScale man page</a>
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> scale(
mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v);
@@ -91,7 +91,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluOrtho2D.xml">gluOrtho2D man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluOrtho2D.xml">gluOrtho2D man page</a>
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left, T right, T bottom, T top);
@@ -184,7 +184,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml">glOrtho man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glOrtho.xml">glOrtho man page</a>
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left, T right, T bottom, T top, T zNear, T zFar);
@@ -268,7 +268,7 @@ namespace glm
///
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glFrustum.xml">glFrustum man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glFrustum.xml">glFrustum man page</a>
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum(
T left, T right, T bottom, T top, T near, T far);
@@ -276,7 +276,7 @@ namespace glm
/// Creates a matrix for a right handed, symetric perspective-view frustum.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -289,7 +289,7 @@ namespace glm
/// Creates a matrix for a right handed, symetric perspective-view frustum.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -302,7 +302,7 @@ namespace glm
/// Creates a matrix for a left handed, symetric perspective-view frustum.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -315,7 +315,7 @@ namespace glm
/// Creates a matrix for a left handed, symetric perspective-view frustum.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -328,7 +328,7 @@ namespace glm
/// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -341,7 +341,7 @@ namespace glm
/// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -355,7 +355,7 @@ namespace glm
/// Creates a matrix for a right handed, symetric perspective-view frustum.
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -369,7 +369,7 @@ namespace glm
/// Creates a matrix for a left handed, symetric perspective-view frustum.
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -382,21 +382,21 @@ namespace glm
/// Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition.
/// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE.
///
///
/// @param fovy Specifies the field of view angle in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml">gluPerspective man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml">gluPerspective man page</a>
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective(
T fovy, T aspect, T near, T far);
/// Builds a perspective projection matrix based on a field of view using right-handed coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -410,7 +410,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view using right-handed coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -424,7 +424,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view using left-handed coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -438,7 +438,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view using left-handed coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -452,7 +452,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -466,7 +466,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -481,7 +481,7 @@ namespace glm
/// Builds a right handed perspective projection matrix based on a field of view.
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -496,7 +496,7 @@ namespace glm
/// Builds a left handed perspective projection matrix based on a field of view.
/// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
/// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -510,7 +510,7 @@ namespace glm
/// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition.
/// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE.
///
///
/// @param fov Expressed in radians.
/// @param width Width of the viewport
/// @param height Height of the viewport
@@ -556,7 +556,7 @@ namespace glm
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -567,7 +567,7 @@ namespace glm
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
///
///
/// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians.
/// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
@@ -580,7 +580,7 @@ namespace glm
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition)
///
///
/// @param obj Specify the object coordinates.
/// @param model Specifies the current modelview matrix
/// @param proj Specifies the current projection matrix
@@ -589,14 +589,14 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> projectZO(
vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
/// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition)
///
///
/// @param obj Specify the object coordinates.
/// @param model Specifies the current modelview matrix
/// @param proj Specifies the current projection matrix
@@ -605,14 +605,14 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> projectNO(
vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition.
/// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE.
///
///
/// @param obj Specify the object coordinates.
/// @param model Specifies the current modelview matrix
/// @param proj Specifies the current projection matrix
@@ -621,7 +621,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluProject.xml">gluProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> project(
vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
@@ -637,7 +637,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> unProjectZO(
vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
@@ -653,7 +653,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> unProjectNO(
vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
@@ -669,7 +669,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluUnProject.xml">gluUnProject man page</a>
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> unProject(
vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport);
@@ -682,7 +682,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPickMatrix.xml">gluPickMatrix man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPickMatrix.xml">gluPickMatrix man page</a>
template<typename T, qualifier Q, typename U>
GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix(
vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport);
@@ -716,7 +716,7 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform
/// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml">gluLookAt man page</a>
/// @see <a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml">gluLookAt man page</a>
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> lookAt(
vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up);

View File

@@ -14,7 +14,7 @@ namespace glm
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v)
{
@@ -45,7 +45,7 @@ namespace glm
Result[3] = m[3];
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v)
{
@@ -361,7 +361,7 @@ namespace glm
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
@@ -377,7 +377,7 @@ namespace glm
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
@@ -447,7 +447,7 @@ namespace glm
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
assert(fov > static_cast<T>(0));
T const rad = fov;
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
@@ -467,7 +467,7 @@ namespace glm
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
assert(fov > static_cast<T>(0));
T const rad = fov;
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
@@ -487,7 +487,7 @@ namespace glm
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
assert(fov > static_cast<T>(0));
T const rad = fov;
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
@@ -507,7 +507,7 @@ namespace glm
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
assert(fov > static_cast<T>(0));
T const rad = fov;
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
@@ -625,7 +625,7 @@ namespace glm
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
T const right = range * aspect;
T const bottom = -range;

View File

@@ -8,10 +8,10 @@
///
/// Include <glm/gtc/noise.hpp> to use the features of this extension.
///
/// Defines 2D, 3D and 4D procedural noise functions
/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
/// https://github.com/ashima/webgl-noise
/// Following Stefan Gustavson's paper "Simplex noise demystified":
/// Defines 2D, 3D and 4D procedural noise functions
/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
/// https://github.com/ashima/webgl-noise
/// Following Stefan Gustavson's paper "Simplex noise demystified":
/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
#pragma once
@@ -41,7 +41,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL T perlin(
vec<L, T, Q> const& p);
/// Periodic perlin noise.
/// @see gtc_noise
template<length_t L, typename T, qualifier Q>

View File

@@ -1,9 +1,9 @@
/// @ref gtc_noise
/// @file glm/gtc/noise.inl
///
// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
// https://github.com/ashima/webgl-noise
// Following Stefan Gustavson's paper "Simplex noise demystified":
// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise":
// https://github.com/ashima/webgl-noise
// Following Stefan Gustavson's paper "Simplex noise demystified":
// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
namespace glm{
@@ -15,7 +15,7 @@ namespace gtc
vec<3, T, Q> pXYZ = floor(fract(vec<3, T, Q>(j) * vec<3, T, Q>(ip)) * T(7)) * ip[2] - T(1);
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), vec<3, T, Q>(1));
vec<4, T, Q> s = vec<4, T, Q>(lessThan(vec<4, T, Q>(pXYZ, pW), vec<4, T, Q>(0.0)));
pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w;
pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w;
return vec<4, T, Q>(pXYZ, pW);
}
}//namespace gtc
@@ -128,7 +128,7 @@ namespace gtc
vec<3, T, Q> fade_xyz = detail::fade(Pf0);
vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z);
vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y);
T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
return T(2.2) * n_xyz;
}
/*
@@ -199,9 +199,9 @@ namespace gtc
vec<3, T, Q> fade_xyz = fade(Pf0);
vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z);
vec<2, T, Q> n_yz = mix(
vec<2, T, Q>(n_z.x, n_z.y),
vec<2, T, Q>(n_z.x, n_z.y),
vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y);
T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);
return T(2.2) * n_xyz;
}
*/
@@ -619,7 +619,7 @@ namespace gtc
vec<3, T, Q> m = max(vec<3, T, Q>(0.5) - vec<3, T, Q>(
dot(x0, x0),
dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)),
dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)),
dot(vec<2, T, Q>(x12.z, x12.w), vec<2, T, Q>(x12.z, x12.w))), vec<3, T, Q>(0));
m = m * m ;
m = m * m ;
@@ -770,7 +770,7 @@ namespace gtc
vec<4, T, Q> x4 = x0 + C.w;
// Permutations
i = mod(i, vec<4, T, Q>(289));
i = mod(i, vec<4, T, Q>(289));
T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x);
vec<4, T, Q> j1 = detail::permute(detail::permute(detail::permute(detail::permute(
i.w + vec<4, T, Q>(i1.w, i2.w, i3.w, T(1))) +
@@ -801,8 +801,8 @@ namespace gtc
vec<2, T, Q> m1 = max(T(0.6) - vec<2, T, Q>(dot(x3, x3), dot(x4, x4) ), vec<2, T, Q>(0));
m0 = m0 * m0;
m1 = m1 * m1;
return T(49) *
(dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
return T(49) *
(dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) +
dot(m1 * m1, vec<2, T, Q>(dot(p3, x3), dot(p4, x4))));
}
}//namespace glm

View File

@@ -39,10 +39,10 @@ namespace glm
GLM_FUNC_DECL uint8 packUnorm1x8(float v);
/// Convert a single 8-bit integer to a normalized floating-point value.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackUnorm4x8: f / 255.0
///
///
/// @see gtc_packing
/// @see vec2 unpackUnorm2x8(uint16 p)
/// @see vec4 unpackUnorm4x8(uint32 p)
@@ -66,22 +66,22 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackUnorm4x8: f / 255.0
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see float unpackUnorm1x8(uint8 v)
/// @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/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);
/// 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.
///
@@ -95,19 +95,19 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm1x8: clamp(f / 127.0, -1, +1)
///
///
/// @see gtc_packing
/// @see vec2 unpackSnorm2x8(uint16 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/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);
/// 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.
///
@@ -124,22 +124,22 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm2x8: clamp(f / 127.0, -1, +1)
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see float unpackSnorm1x8(uint8 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/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);
/// 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.
///
@@ -153,12 +153,12 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackUnorm1x16: f / 65535.0
///
/// unpackUnorm1x16: f / 65535.0
///
/// @see gtc_packing
/// @see vec2 unpackUnorm2x16(uint32 p)
/// @see vec4 unpackUnorm4x16(uint64 p)
@@ -182,15 +182,15 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackUnormx4x16: f / 65535.0
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// unpackUnormx4x16: f / 65535.0
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see float unpackUnorm1x16(uint16 p)
/// @see vec2 unpackUnorm2x16(uint32 p)
@@ -211,12 +211,12 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm1x16: clamp(f / 32767.0, -1, +1)
///
///
/// @see gtc_packing
/// @see vec2 unpackSnorm2x16(uint32 p)
/// @see vec4 unpackSnorm4x16(uint64 p)
@@ -240,22 +240,22 @@ namespace glm
/// @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);
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm4x16: clamp(f / 32767.0, -1, +1)
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see float unpackSnorm1x16(uint16 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/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);
/// 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,
/// and then packing this 16-bit value into a 16-bit unsigned integer.
@@ -266,7 +266,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint16 packHalf1x16(float v);
/// 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,
/// and converting it to 32-bit floating-point values.
@@ -278,25 +278,25 @@ namespace glm
/// @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);
/// 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,
/// 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,
/// and then packing these four 16-bit values into a 64-bit unsigned integer.
/// The first vector component specifies the 16 least-significant bits of the result;
/// The first vector component specifies the 16 least-significant bits of the result;
/// the forth component specifies the 16 most-significant bits.
///
///
/// @see gtc_packing
/// @see uint16 packHalf1x16(float const& v)
/// @see uint32 packHalf2x16(vec2 const& v)
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v);
/// 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,
/// and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the forth component is obtained from the 16 most-significant bits of v.
///
///
/// @see gtc_packing
/// @see float unpackHalf1x16(uint16 const& v)
/// @see vec2 unpackHalf2x16(uint32 const& v)
@@ -304,12 +304,12 @@ namespace glm
/// @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);
/// 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,
/// 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,
/// and then packing these four values into a 32-bit unsigned integer.
/// The first vector component specifies the 10 least-significant bits of the result;
/// The first vector component specifies the 10 least-significant bits of the result;
/// the forth component specifies the 2 most-significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packI3x10_1x2(uvec4 const& v)
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
@@ -317,23 +317,23 @@ namespace glm
/// @see ivec4 unpackI3x10_1x2(uint32 const& p)
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v);
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packU3x10_1x2(uvec4 const& v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
/// @see uvec4 unpackI3x10_1x2(uint32 const& p);
GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p);
/// 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,
/// 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,
/// and then packing these four values into a 32-bit unsigned integer.
/// The first vector component specifies the 10 least-significant bits of the result;
/// The first vector component specifies the 10 least-significant bits of the result;
/// the forth component specifies the 2 most-significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packI3x10_1x2(ivec4 const& v)
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
@@ -341,11 +341,11 @@ namespace glm
/// @see ivec4 unpackU3x10_1x2(uint32 const& p)
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v);
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packU3x10_1x2(uvec4 const& v)
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
@@ -360,7 +360,7 @@ namespace glm
/// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0)
/// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0)
///
/// The first vector component specifies the 10 least-significant bits of the result;
/// The first vector component specifies the 10 least-significant bits of the result;
/// the forth component specifies the 2 most-significant bits.
///
/// @see gtc_packing
@@ -370,16 +370,16 @@ namespace glm
/// @see uint32 packI3x10_1x2(ivec4 const& v)
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v);
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1)
/// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1)
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
/// @see vec4 unpackUnorm3x10_1x2(uint32 const& p))
@@ -395,7 +395,7 @@ namespace glm
/// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0)
/// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0)
///
/// The first vector component specifies the 10 least-significant bits of the result;
/// The first vector component specifies the 10 least-significant bits of the result;
/// the forth component specifies the 2 most-significant bits.
///
/// @see gtc_packing
@@ -405,16 +405,16 @@ namespace glm
/// @see uint32 packI3x10_1x2(ivec4 const& v)
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v);
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
/// 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.
///
///
/// The conversion for unpacked fixed-point value f to floating point is done as follows:
/// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1)
/// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1)
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
/// @see vec4 unpackInorm3x10_1x2(uint32 const& p))
@@ -426,19 +426,19 @@ namespace glm
/// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value.
/// Then, the results are packed into the returned 32-bit unsigned integer.
///
/// The first vector component specifies the 11 least-significant bits of the result;
/// The first vector component specifies the 11 least-significant bits of the result;
/// the last component specifies the 10 most-significant bits.
///
/// @see gtc_packing
/// @see vec3 unpackF2x11_1x10(uint32 const& p)
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v);
/// 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.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
///
/// @see gtc_packing
/// @see uint32 packF2x11_1x10(vec3 const& v)
GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p);
@@ -448,7 +448,7 @@ namespace glm
/// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value.
/// Then, the results are packed into the returned 32-bit unsigned integer.
///
/// The first vector component specifies the 11 least-significant bits of the result;
/// The first vector component specifies the 11 least-significant bits of the result;
/// the last component specifies the 10 most-significant bits.
///
/// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format
@@ -457,10 +457,10 @@ namespace glm
/// @see vec3 unpackF3x9_E1x5(uint32 const& p)
GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v);
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
/// 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.
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
///
/// The first component of the returned vector will be extracted from the least significant bits of the input;
/// the last component will be extracted from the most significant bits.
///
/// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data
@@ -471,9 +471,9 @@ namespace glm
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification.
/// The first vector component specifies the 16 least-significant bits of the result;
/// The first vector component specifies the 16 least-significant bits of the result;
/// the forth component specifies the 16 most-significant bits.
///
///
/// @see gtc_packing
/// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
@@ -483,7 +483,7 @@ namespace glm
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the forth component is obtained from the 16 most-significant bits of v.
///
///
/// @see gtc_packing
/// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
@@ -492,9 +492,9 @@ namespace glm
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification.
/// The first vector component specifies the 16 least-significant bits of the result;
/// The first vector component specifies the 16 least-significant bits of the result;
/// the forth component specifies the 16 most-significant bits.
///
///
/// @see gtc_packing
/// @see vec<L, float, Q> unpackHalf(vec<L, uint16, Q> const& p)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
@@ -504,7 +504,7 @@ namespace glm
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the forth component is obtained from the 16 most-significant bits of v.
///
///
/// @see gtc_packing
/// @see vec<L, uint16, Q> packHalf(vec<L, float, Q> const& v)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
@@ -519,7 +519,7 @@ namespace glm
GLM_FUNC_DECL vec<L, uintType, Q> packUnorm(vec<L, floatType, Q> const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see vec<L, intType, Q> packUnorm(vec<L, floatType, Q> const& v)
template<typename floatType, length_t L, typename uintType, qualifier Q>
@@ -533,7 +533,7 @@ namespace glm
GLM_FUNC_DECL vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v)
template<typename floatType, length_t L, typename intType, qualifier Q>
@@ -546,7 +546,7 @@ namespace glm
GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see uint8 packUnorm2x4(vec2 const& v)
GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p);
@@ -558,7 +558,7 @@ namespace glm
GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see uint16 packUnorm4x4(vec4 const& v)
GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p);
@@ -570,7 +570,7 @@ namespace glm
GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v)
GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p);
@@ -582,7 +582,7 @@ namespace glm
GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see uint16 packUnorm3x5_1x1(vec4 const& v)
GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p);
@@ -594,7 +594,7 @@ namespace glm
GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
///
/// @see gtc_packing
/// @see uint8 packUnorm2x3_1x2(vec3 const& v)
GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p);
@@ -608,7 +608,7 @@ namespace glm
GLM_FUNC_DECL int16 packInt2x8(i8vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int16 packInt2x8(i8vec2 const& v)
GLM_FUNC_DECL i8vec2 unpackInt2x8(int16 p);
@@ -620,7 +620,7 @@ namespace glm
GLM_FUNC_DECL uint16 packUint2x8(u8vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see uint16 packInt2x8(u8vec2 const& v)
GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p);
@@ -632,7 +632,7 @@ namespace glm
GLM_FUNC_DECL int32 packInt4x8(i8vec4 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int32 packInt2x8(i8vec4 const& v)
GLM_FUNC_DECL i8vec4 unpackInt4x8(int32 p);
@@ -644,7 +644,7 @@ namespace glm
GLM_FUNC_DECL uint32 packUint4x8(u8vec4 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see uint32 packUint4x8(u8vec2 const& v)
GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p);
@@ -656,7 +656,7 @@ namespace glm
GLM_FUNC_DECL int packInt2x16(i16vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int packInt2x16(i16vec2 const& v)
GLM_FUNC_DECL i16vec2 unpackInt2x16(int p);
@@ -668,7 +668,7 @@ namespace glm
GLM_FUNC_DECL int64 packInt4x16(i16vec4 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int64 packInt4x16(i16vec4 const& v)
GLM_FUNC_DECL i16vec4 unpackInt4x16(int64 p);
@@ -680,7 +680,7 @@ namespace glm
GLM_FUNC_DECL uint packUint2x16(u16vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see uint packUint2x16(u16vec2 const& v)
GLM_FUNC_DECL u16vec2 unpackUint2x16(uint p);
@@ -692,7 +692,7 @@ namespace glm
GLM_FUNC_DECL uint64 packUint4x16(u16vec4 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see uint64 packUint4x16(u16vec4 const& v)
GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p);
@@ -704,7 +704,7 @@ namespace glm
GLM_FUNC_DECL int64 packInt2x32(i32vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int packInt2x16(i32vec2 const& v)
GLM_FUNC_DECL i32vec2 unpackInt2x32(int64 p);
@@ -716,7 +716,7 @@ namespace glm
GLM_FUNC_DECL uint64 packUint2x32(u32vec2 const& v);
/// Convert a packed integer into an integer vector.
///
///
/// @see gtc_packing
/// @see int packUint2x16(u32vec2 const& v)
GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p);

View File

@@ -356,13 +356,13 @@ namespace detail
{
return static_cast<uint8>(round(clamp(v, 0.0f, 1.0f) * 255.0f));
}
GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p)
{
float const Unpack(p);
return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255
}
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v)
{
u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
@@ -371,7 +371,7 @@ namespace detail
memcpy(&Unpack, &Topack, sizeof(Unpack));
return Unpack;
}
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p)
{
u8vec2 Unpack;
@@ -386,7 +386,7 @@ namespace detail
memcpy(&Packed, &Topack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p)
{
int8 Unpack = 0;
@@ -395,7 +395,7 @@ namespace detail
static_cast<float>(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f
-1.0f, 1.0f);
}
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v)
{
i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f));
@@ -403,7 +403,7 @@ namespace detail
memcpy(&Packed, &Topack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p)
{
i8vec2 Unpack;
@@ -452,7 +452,7 @@ namespace detail
int16 Unpack = 0;
memcpy(&Unpack, &p, sizeof(Unpack));
return clamp(
static_cast<float>(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f,
static_cast<float>(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f,
-1.0f, 1.0f);
}
@@ -518,7 +518,7 @@ namespace detail
Result.data.y = v.y;
Result.data.z = v.z;
Result.data.w = v.w;
return Result.pack;
return Result.pack;
}
GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v)
@@ -539,7 +539,7 @@ namespace detail
Result.data.y = v.y;
Result.data.z = v.z;
Result.data.w = v.w;
return Result.pack;
return Result.pack;
}
GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v)

View File

@@ -49,13 +49,13 @@ namespace glm
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
# endif
union
{
struct { T x, y, z, w;};
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<Q>::value>::type data;
};
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
# endif
@@ -178,7 +178,7 @@ namespace glm
GLM_FUNC_DECL bool operator!=(tquat<T, Q> const& q1, tquat<T, Q> const& q2);
/// Returns the length of the quaternion.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -186,15 +186,15 @@ namespace glm
GLM_FUNC_DECL T length(tquat<T, Q> const& q);
/// Returns the normalized quaternion.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> normalize(tquat<T, Q> const& q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -204,7 +204,7 @@ namespace glm
/// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed.
/// For short path spherical linear interpolation, use the slerp function.
///
///
/// @param x A quaternion
/// @param y A quaternion
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
@@ -217,7 +217,7 @@ namespace glm
/// Linear interpolation of two quaternions.
/// The interpolation is oriented.
///
///
/// @param x A quaternion
/// @param y A quaternion
/// @param a Interpolation factor. The interpolation is defined in the range [0, 1].
@@ -229,7 +229,7 @@ namespace glm
/// Spherical linear interpolation of two quaternions.
/// The interpolation always take the short path and the rotation is performed at constant speed.
///
///
/// @param x A quaternion
/// @param y A quaternion
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
@@ -240,7 +240,7 @@ namespace glm
GLM_FUNC_DECL tquat<T, Q> slerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T a);
/// Returns the q conjugate.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -248,7 +248,7 @@ namespace glm
GLM_FUNC_DECL tquat<T, Q> conjugate(tquat<T, Q> const& q);
/// Returns the q inverse.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -256,7 +256,7 @@ namespace glm
GLM_FUNC_DECL tquat<T, Q> inverse(tquat<T, Q> const& q);
/// Rotates a quaternion from a vector of 3 components axis and an angle.
///
///
/// @param q Source orientation
/// @param angle Angle expressed in radians.
/// @param axis Axis of the rotation
@@ -300,7 +300,7 @@ namespace glm
GLM_FUNC_DECL T yaw(tquat<T, Q> const& x);
/// Converts a quaternion to a 3 * 3 matrix.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -308,7 +308,7 @@ namespace glm
GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(tquat<T, Q> const& x);
/// Converts a quaternion to a 4 * 4 matrix.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -316,7 +316,7 @@ namespace glm
GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(tquat<T, Q> const& x);
/// Converts a 3 * 3 matrix to a quaternion.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -324,7 +324,7 @@ namespace glm
GLM_FUNC_DECL tquat<T, Q> quat_cast(mat<3, 3, T, Q> const& x);
/// Converts a 4 * 4 matrix to a quaternion.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -358,7 +358,7 @@ namespace glm
GLM_FUNC_DECL tquat<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
/// Returns the component-wise comparison result of x < y.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -398,7 +398,7 @@ namespace glm
GLM_FUNC_DECL vec<4, bool, Q> equal(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x != y.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -410,9 +410,9 @@ namespace glm
/// floating point representations. Returns false otherwise,
/// including for implementations with no NaN
/// representations.
///
///
/// /!\ When using compiler fast math, this function may fail.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
@@ -424,7 +424,7 @@ namespace glm
/// set of floating point representations. Returns false
/// otherwise, including for implementations with no infinity
/// representations.
///
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion

View File

@@ -127,7 +127,7 @@ namespace detail
, w(static_cast<T>(q.w))
{}
//template<typename valType>
//template<typename valType>
//GLM_FUNC_QUALIFIER tquat<valType>::tquat
//(
// valType const& pitch,
@@ -138,7 +138,7 @@ namespace detail
// vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5));
// vec<3, valType> c = glm::cos(eulerAngle * valType(0.5));
// vec<3, valType> s = glm::sin(eulerAngle * valType(0.5));
//
//
// this->w = c.x * c.y * c.z + s.x * s.y * s.z;
// this->x = s.x * c.y * c.z - c.x * s.y * s.z;
// this->y = c.x * s.y * c.z + s.x * c.y * s.z;
@@ -174,7 +174,7 @@ namespace detail
{
vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5));
vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5));
this->w = c.x * c.y * c.z + s.x * s.y * s.z;
this->x = s.x * c.y * c.z - c.x * s.y * s.z;
this->y = c.x * s.y * c.z + s.x * c.y * s.z;
@@ -199,7 +199,7 @@ namespace detail
{
return mat3_cast(*this);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::operator mat<4, 4, T, Q>()
{
@@ -458,8 +458,8 @@ namespace detail
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> mix2
(
tquat<T, Q> const& x,
tquat<T, Q> const& y,
tquat<T, Q> const& x,
tquat<T, Q> const& y,
T const& a
)
{
@@ -488,7 +488,7 @@ namespace detail
if(flip)
alpha = -alpha;
return normalize(beta * x + alpha * y);
}
*/
@@ -533,7 +533,7 @@ namespace detail
T cosTheta = dot(x, y);
// If cosTheta < 0, the interpolation will take the long way around the sphere.
// If cosTheta < 0, the interpolation will take the long way around the sphere.
// To fix this, one quat must be negated.
if (cosTheta < T(0))
{

View File

@@ -176,7 +176,7 @@ namespace detail
__m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2));
__m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1));
__m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2));
__m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0));
__m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1));
__m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2));

View File

@@ -25,52 +25,52 @@ namespace glm
{
/// @addtogroup gtc_random
/// @{
/// Generate random numbers in the interval [Min, Max], according a linear distribution
///
/// @param Min Minimum value included in the sampling
/// @param Max Maximum value included in the sampling
/// Generate random numbers in the interval [Min, Max], according a linear distribution
///
/// @param Min Minimum value included in the sampling
/// @param Max Maximum value included in the sampling
/// @tparam genType Value type. Currently supported: float or double scalars.
/// @see gtc_random
template<typename genType>
GLM_FUNC_DECL genType linearRand(genType Min, genType Max);
/// Generate random numbers in the interval [Min, Max], according a linear distribution
///
/// @param Min Minimum value included in the sampling
/// @param Max Maximum value included in the sampling
/// Generate random numbers in the interval [Min, Max], according a linear distribution
///
/// @param Min Minimum value included in the sampling
/// @param Max Maximum value included in the sampling
/// @tparam T Value type. Currently supported: float or double.
///
/// @see gtc_random
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> linearRand(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
///
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
///
/// @see gtc_random
template<typename genType>
GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation);
/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
///
///
/// @see gtc_random
template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius);
/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
///
///
/// @see gtc_random
template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius);
/// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
///
///
/// @see gtc_random
template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius);
/// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
///
///
/// @see gtc_random
template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius);

View File

@@ -157,7 +157,7 @@ namespace detail
return (compute_rand<L, uint32, Q>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
}
};
template<length_t L, qualifier Q>
struct compute_linearRand<L, int64, Q>
{
@@ -281,7 +281,7 @@ namespace detail
{
x1 = linearRand(genType(-1), genType(1));
x2 = linearRand(genType(-1), genType(1));
w = x1 * x1 + x2 * x2;
} while(w > genType(1));
@@ -296,7 +296,7 @@ namespace detail
template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius)
{
{
vec<2, T, defaultp> Result(T(0));
T LenRadius(T(0));
@@ -317,7 +317,7 @@ namespace detail
{
vec<3, T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(
@@ -326,7 +326,7 @@ namespace detail
LenRadius = length(Result);
}
while(LenRadius > Radius);
return Result;
}

View File

@@ -26,105 +26,105 @@ namespace glm
/// Secant function.
/// hypotenuse / adjacent or 1 / cos(x)
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType sec(genType angle);
/// Cosecant function.
/// hypotenuse / opposite or 1 / sin(x)
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
template<typename genType>
GLM_FUNC_DECL genType csc(genType angle);
/// Cotangent function.
/// adjacent / opposite or 1 / tan(x)
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType cot(genType angle);
/// Inverse secant function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType asec(genType x);
/// Inverse cosecant function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType acsc(genType x);
/// Inverse cotangent function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType acot(genType x);
/// Secant hyperbolic function.
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType sech(genType angle);
/// Cosecant hyperbolic function.
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType csch(genType angle);
/// Cotangent hyperbolic function.
///
///
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType coth(genType angle);
/// Inverse secant hyperbolic function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType asech(genType x);
/// Inverse cosecant hyperbolic function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType acsch(genType x);
/// Inverse cotangent hyperbolic function.
///
///
/// @return Return an angle expressed in radians.
/// @tparam genType Floating-point scalar or vector types.
///
///
/// @see gtc_reciprocal
template<typename genType>
GLM_FUNC_DECL genType acoth(genType x);

View File

@@ -41,7 +41,7 @@ namespace glm
GLM_FUNC_QUALIFIER genType cot(genType angle)
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values");
genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0);
return glm::tan(pi_over_2 - angle);
}

View File

@@ -10,7 +10,7 @@
/// Include <glm/gtc/type_precision.hpp> to use the features of this extension.
///
/// Defines specific C++-based qualifier types.
///
///
/// @ref core_precision defines types based on GLSL's qualifier qualifiers. This
/// extension defines types based on explicitly-sized C++ data types.
@@ -39,7 +39,7 @@
namespace glm
{
///////////////////////////
// Signed int vector types
// Signed int vector types
/// @addtogroup gtc_type_precision
/// @{
@@ -47,7 +47,7 @@ namespace glm
/// Low qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_int8;
/// Low qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_int16;
@@ -63,7 +63,7 @@ namespace glm
/// Low qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_int8_t;
/// Low qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_int16_t;
@@ -79,7 +79,7 @@ namespace glm
/// Low qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_i8;
/// Low qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_i16;
@@ -95,7 +95,7 @@ namespace glm
/// Medium qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_int8;
/// Medium qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_int16;
@@ -111,7 +111,7 @@ namespace glm
/// Medium qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_int8_t;
/// Medium qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_int16_t;
@@ -127,7 +127,7 @@ namespace glm
/// Medium qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_i8;
/// Medium qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_i16;
@@ -143,7 +143,7 @@ namespace glm
/// High qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_int8;
/// High qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_int16;
@@ -159,7 +159,7 @@ namespace glm
/// High qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_int8_t;
/// High qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_int16_t;
@@ -175,7 +175,7 @@ namespace glm
/// High qualifier 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_i8;
/// High qualifier 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_i16;
@@ -187,12 +187,12 @@ namespace glm
/// High qualifier 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 highp_i64;
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16;
@@ -214,7 +214,7 @@ namespace glm
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8_t;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16_t;
@@ -231,7 +231,7 @@ namespace glm
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 i8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 i16;
@@ -248,7 +248,7 @@ namespace glm
/// 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef vec<1, i8, defaultp> i8vec1;
/// 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, i8, defaultp> i8vec2;
@@ -265,7 +265,7 @@ namespace glm
/// 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef vec<1, i16, defaultp> i16vec1;
/// 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, i16, defaultp> i16vec2;
@@ -282,7 +282,7 @@ namespace glm
/// 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef vec<1, i32, defaultp> i32vec1;
/// 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, i32, defaultp> i32vec2;
@@ -299,7 +299,7 @@ namespace glm
/// 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef vec<1, i64, defaultp> i64vec1;
/// 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, i64, defaultp> i64vec2;
@@ -319,7 +319,7 @@ namespace glm
/// Low qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_uint8;
/// Low qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_uint16;
@@ -335,7 +335,7 @@ namespace glm
/// Low qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_uint8_t;
/// Low qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_uint16_t;
@@ -351,7 +351,7 @@ namespace glm
/// Low qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_u8;
/// Low qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_u16;
@@ -363,11 +363,11 @@ namespace glm
/// Low qualifier 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 lowp_u64;
/// Medium qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_uint8;
/// Medium qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_uint16;
@@ -383,7 +383,7 @@ namespace glm
/// Medium qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_uint8_t;
/// Medium qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_uint16_t;
@@ -399,7 +399,7 @@ namespace glm
/// Medium qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_u8;
/// Medium qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_u16;
@@ -411,11 +411,11 @@ namespace glm
/// Medium qualifier 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 mediump_u64;
/// High qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_uint8;
/// High qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_uint16;
@@ -431,7 +431,7 @@ namespace glm
/// High qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_uint8_t;
/// High qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_uint16_t;
@@ -447,7 +447,7 @@ namespace glm
/// High qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_u8;
/// High qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_u16;
@@ -463,7 +463,7 @@ namespace glm
/// Default qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8;
/// Default qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16;
@@ -485,7 +485,7 @@ namespace glm
/// Default qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8_t;
/// Default qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16_t;
@@ -502,7 +502,7 @@ namespace glm
/// Default qualifier 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 u8;
/// Default qualifier 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 u16;
@@ -520,7 +520,7 @@ namespace glm
/// Default qualifier 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef vec<1, u8, defaultp> u8vec1;
/// Default qualifier 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, u8, defaultp> u8vec2;
@@ -537,7 +537,7 @@ namespace glm
/// Default qualifier 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef vec<1, u16, defaultp> u16vec1;
/// Default qualifier 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, u16, defaultp> u16vec2;
@@ -554,7 +554,7 @@ namespace glm
/// Default qualifier 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef vec<1, u32, defaultp> u32vec1;
/// Default qualifier 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, u32, defaultp> u32vec2;
@@ -571,7 +571,7 @@ namespace glm
/// Default qualifier 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef vec<1, u64, defaultp> u64vec1;
/// Default qualifier 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef vec<2, u64, defaultp> u64vec2;
@@ -630,7 +630,7 @@ namespace glm
/// @see gtc_type_precision
typedef vec<4, float, defaultp> fvec4;
/// Single-qualifier floating-point vector of 1 component.
/// @see gtc_type_precision
typedef vec<1, f32, defaultp> f32vec1;
@@ -667,7 +667,7 @@ namespace glm
//////////////////////
// Float matrix types
// Float matrix types
/// Single-qualifier floating-point 1x1 matrix.
/// @see gtc_type_precision

View File

@@ -15,7 +15,7 @@
/// takes any of the \ref core_template "core template types". It returns
/// a pointer to the memory layout of the object. Matrix types store their values
/// in column-major order.
///
///
/// This is useful for uploading data to matrices or copying data to buffer objects.
///
/// Example:
@@ -204,7 +204,7 @@ namespace glm
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
@@ -214,7 +214,7 @@ namespace glm
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>

View File

@@ -8,8 +8,8 @@
///
/// Include <glm/gtc/ulp.hpp> to use the features of this extension.
///
/// Allow the measurement of the accuracy of a function against a reference
/// implementation. This extension works on floating-point data and provide results
/// Allow the measurement of the accuracy of a function against a reference
/// implementation. This extension works on floating-point data and provide results
/// in ULP.
#pragma once
@@ -48,7 +48,7 @@ namespace glm
/// @see gtc_ulp
template<typename genType>
GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance);
/// Return the distance in the number of ULP between 2 scalars.
/// @see gtc_ulp
template<typename T>
@@ -58,7 +58,7 @@ namespace glm
/// @see gtc_ulp
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y);
/// @}
}// namespace glm

View File

@@ -79,8 +79,8 @@ namespace detail
ix = hx&0x7fffffff; // |x|
iy = hy&0x7fffffff; // |y|
if((ix>0x7f800000) || // x is nan
(iy>0x7f800000)) // y is nan
if((ix>0x7f800000) || // x is nan
(iy>0x7f800000)) // y is nan
return x+y;
if(compute_equal<float>::call(x, y))
return y; // x=y, return y
@@ -94,7 +94,7 @@ namespace detail
return x; // raise underflow flag
}
if(hx>=0)
{ // x > 0
{ // x > 0
if(hx>hy) // x > y, x -= ulp
hx -= 1;
else // x < y, x += ulp
@@ -131,8 +131,8 @@ namespace detail
GLM_EXTRACT_WORDS(hx, lx, x);
GLM_EXTRACT_WORDS(hy, ly, y);
ix = hx & 0x7fffffff; // |x|
iy = hy & 0x7fffffff; // |y|
ix = hx & 0x7fffffff; // |x|
iy = hy & 0x7fffffff; // |y|
if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || // x is nan
((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) // y is nan
@@ -140,23 +140,23 @@ namespace detail
if(detail::compute_equal<double>::call(x, y))
return y; // x=y, return y
if((ix|lx)==0)
{ // x == 0
{ // x == 0
GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal
t = x*x;
if(detail::compute_equal<double>::call(t, x))
return t;
else
return x; // raise underflow flag
return x; // raise underflow flag
}
if(hx>=0) { // x > 0
if(hx>hy||((hx==hy)&&(lx>ly))) { // x > y, x -= ulp
if(hx>=0) { // x > 0
if(hx>hy||((hx==hy)&&(lx>ly))) { // x > y, x -= ulp
if(lx==0) hx -= 1;
lx -= 1;
} else { // x < y, x += ulp
lx += 1;
if(lx==0) hx += 1;
}
} else { // x < 0
} else { // x < 0
if(hy>=0||hx>hy||((hx==hy)&&(lx>ly))){// x < y, x -= ulp
if(lx==0) hx -= 1;
lx -= 1;

View File

@@ -7,7 +7,7 @@
/// @ingroup gtc
///
/// Include <glm/gtc/vec1.hpp> to use the features of this extension.
///
///
/// Add vec1, ivec1, uvec1 and bvec1 types.
#pragma once
@@ -67,7 +67,7 @@ namespace glm
#elif(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_ivec1 ivec1;
#else
/// 1 component vector of signed integer numbers.
/// 1 component vector of signed integer numbers.
/// @see gtc_vec1 extension.
typedef highp_ivec1 ivec1;
#endif//GLM_PRECISION
@@ -79,7 +79,7 @@ namespace glm
#elif(defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_uvec1 uvec1;
#else
/// 1 component vector of unsigned integer numbers.
/// 1 component vector of unsigned integer numbers.
/// @see gtc_vec1 extension.
typedef highp_uvec1 uvec1;
#endif//GLM_PRECISION