remove template alias for more compiler support and simplified swizzle expression implementation #584

This commit is contained in:
Christophe Riccio
2016-12-30 01:23:29 +01:00
parent 4dd748f380
commit 947b07cbc4
132 changed files with 3462 additions and 3473 deletions

View File

@@ -21,9 +21,9 @@ namespace detail
template <typename T, precision P>
struct compute_rgbToSrgb<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorRGB, T GammaCorrection)
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorRGB, T GammaCorrection)
{
return tvec4<T, P>(compute_rgbToSrgb<3, T, P, vec>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
return vec<4, T, P>(compute_rgbToSrgb<3, T, P, vec>::call(vec<3, T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
}
};
@@ -42,9 +42,9 @@ namespace detail
template <typename T, precision P>
struct compute_srgbToRgb<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorSRGB, T Gamma)
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorSRGB, T Gamma)
{
return tvec4<T, P>(compute_srgbToRgb<3, T, P, vec>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a);
return vec<4, T, P>(compute_srgbToRgb<3, T, P, vec>::call(vec<3, T, P>(ColorSRGB), Gamma), ColorSRGB.a);
}
};
}//namespace detail
@@ -57,11 +57,11 @@ namespace detail
// Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html
template <>
GLM_FUNC_QUALIFIER tvec3<float, lowp> convertLinearToSRGB(tvec3<float, lowp> const& ColorLinear)
GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear)
{
tvec3<float, lowp> S1 = sqrt(ColorLinear);
tvec3<float, lowp> S2 = sqrt(S1);
tvec3<float, lowp> S3 = sqrt(S2);
vec<3, float, lowp> S1 = sqrt(ColorLinear);
vec<3, float, lowp> S2 = sqrt(S1);
vec<3, float, lowp> S3 = sqrt(S2);
return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear;
}

View File

@@ -100,26 +100,26 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> epsilonEqual
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & epsilon
)
{
tvec4<T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return lessThan(abs(v), tvec4<T, P>(epsilon));
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return lessThan(abs(v), vec<4, T, P>(epsilon));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> epsilonNotEqual
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonNotEqual
(
tquat<T, P> const & x,
tquat<T, P> const & y,
T const & epsilon
)
{
tvec4<T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return greaterThanEqual(abs(v), tvec4<T, P>(epsilon));
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return greaterThanEqual(abs(v), vec<4, T, P>(epsilon));
}
}//namespace glm

View File

@@ -41,9 +41,9 @@ namespace glm
/// @see gtc_epsilon
template <typename T, precision P>
GLM_FUNC_DECL T gauss(
tvec2<T, P> const& Coord,
tvec2<T, P> const& ExpectedValue,
tvec2<T, P> const& StandardDeviation);
vec<2, T, P> const& Coord,
vec<2, T, P> const& ExpectedValue,
vec<2, T, P> const& StandardDeviation);
/// @}
}//namespace glm

View File

@@ -19,12 +19,12 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_QUALIFIER T gauss
(
tvec2<T, P> const& Coord,
tvec2<T, P> const& ExpectedValue,
tvec2<T, P> const& StandardDeviation
vec<2, T, P> const& Coord,
vec<2, T, P> const& ExpectedValue,
vec<2, T, P> const& StandardDeviation
)
{
tvec2<T, P> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation);
vec<2, T, P> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation);
return exp(-(Squared.x + Squared.y));
}
}//namespace glm

View File

@@ -19,14 +19,14 @@ namespace detail
template <precision P, bool Aligned>
struct compute_log2<4, int, P, vec, false, Aligned>
{
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec)
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v)
{
tvec4<int, P> Result(glm::uninitialize);
vec<4, int, P> Result(glm::uninitialize);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), vec.x);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), vec.y);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), vec.z);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.w), vec.w);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), v.x);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), v.y);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), v.z);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.w), v.w);
return Result;
}

View File

@@ -9,9 +9,9 @@ namespace glm
tmat2x2<T, P> const Inv(inverse(tmat2x2<T, P>(m)));
return tmat3x3<T, P>(
tvec3<T, P>(Inv[0], static_cast<T>(0)),
tvec3<T, P>(Inv[1], static_cast<T>(0)),
tvec3<T, P>(-Inv * tvec2<T, P>(m[2]), static_cast<T>(1)));
vec<3, T, P>(Inv[0], static_cast<T>(0)),
vec<3, T, P>(Inv[1], static_cast<T>(0)),
vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast<T>(1)));
}
template <typename T, precision P>
@@ -20,10 +20,10 @@ namespace glm
tmat3x3<T, P> const Inv(inverse(tmat3x3<T, P>(m)));
return tmat4x4<T, P>(
tvec4<T, P>(Inv[0], static_cast<T>(0)),
tvec4<T, P>(Inv[1], static_cast<T>(0)),
tvec4<T, P>(Inv[2], static_cast<T>(0)),
tvec4<T, P>(-Inv * tvec3<T, P>(m[3]), static_cast<T>(1)));
vec<4, T, P>(Inv[0], static_cast<T>(0)),
vec<4, T, P>(Inv[1], static_cast<T>(0)),
vec<4, T, P>(Inv[2], static_cast<T>(0)),
vec<4, T, P>(-Inv * vec<3, T, P>(m[3]), static_cast<T>(1)));
}
template <typename T, precision P>

View File

@@ -53,11 +53,11 @@ namespace glm
/// @endcode
/// @see gtc_matrix_transform
/// @see - translate(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - translate(tvec3<T, P> const & v)
/// @see - translate(vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> translate(
tmat4x4<T, P> const & m,
tvec3<T, P> const & v);
vec<3, T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
@@ -67,12 +67,12 @@ namespace glm
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
/// @see gtc_matrix_transform
/// @see - rotate(tmat4x4<T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, tvec3<T, P> const & v)
/// @see - rotate(T angle, vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> rotate(
tmat4x4<T, P> const & m,
T angle,
tvec3<T, P> const & axis);
vec<3, T, P> const & axis);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
@@ -81,11 +81,11 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
/// @see gtc_matrix_transform
/// @see - scale(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - scale(tvec3<T, P> const & v)
/// @see - scale(vec<3, T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> scale(
tmat4x4<T, P> const & m,
tvec3<T, P> const & v);
vec<3, T, P> const & v);
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
///
@@ -383,11 +383,11 @@ namespace glm
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U, precision P>
GLM_FUNC_DECL tvec3<T, P> project(
tvec3<T, P> const & obj,
GLM_FUNC_DECL vec<3, T, P> project(
vec<3, T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport);
vec<4, U, P> const & viewport);
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
///
@@ -400,11 +400,11 @@ namespace glm
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U, precision P>
GLM_FUNC_DECL tvec3<T, P> unProject(
tvec3<T, P> const & win,
GLM_FUNC_DECL vec<3, T, P> unProject(
vec<3, T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport);
vec<4, U, P> const & viewport);
/// Define a picking region
///
@@ -416,9 +416,9 @@ namespace glm
/// @see gtc_matrix_transform
template <typename T, precision P, typename U>
GLM_FUNC_DECL tmat4x4<T, P> pickMatrix(
tvec2<T, P> const & center,
tvec2<T, P> const & delta,
tvec4<U, P> const & viewport);
vec<2, T, P> const & center,
vec<2, T, P> const & delta,
vec<4, U, P> const & viewport);
/// Build a look at view matrix based on the default handedness.
///
@@ -429,9 +429,9 @@ namespace glm
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAt(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// Build a right handed look at view matrix.
///
@@ -442,9 +442,9 @@ namespace glm
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtRH(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// Build a left handed look at view matrix.
///
@@ -455,9 +455,9 @@ namespace glm
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtLH(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// @}
}//namespace glm

View File

@@ -8,7 +8,7 @@
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> translate(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tmat4x4<T, P> translate(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
@@ -16,14 +16,14 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate(tmat4x4<T, P> const & m, T angle, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate(tmat4x4<T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tvec3<T, P> axis(normalize(v));
tvec3<T, P> temp((T(1) - c) * axis);
vec<3, T, P> axis(normalize(v));
vec<3, T, P> temp((T(1) - c) * axis);
tmat4x4<T, P> Rotate(uninitialize);
Rotate[0][0] = c + temp[0] * axis[0];
@@ -47,14 +47,14 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate_slow(tmat4x4<T, P> const & m, T angle, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate_slow(tmat4x4<T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tmat4x4<T, P> Result;
tvec3<T, P> axis = normalize(v);
vec<3, T, P> axis = normalize(v);
Result[0][0] = c + (static_cast<T>(1) - c) * axis.x * axis.x;
Result[0][1] = (static_cast<T>(1) - c) * axis.x * axis.y + s * axis.z;
@@ -71,12 +71,12 @@ namespace glm
Result[2][2] = c + (static_cast<T>(1) - c) * axis.z * axis.z;
Result[2][3] = static_cast<T>(0);
Result[3] = tvec4<T, P>(0, 0, 0, 1);
Result[3] = vec<4, T, P>(0, 0, 0, 1);
return m * Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(uninitialize);
Result[0] = m[0] * v[0];
@@ -87,7 +87,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale_slow(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale_slow(tmat4x4<T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(T(1));
Result[0][0] = v.x;
@@ -436,15 +436,15 @@ namespace glm
}
template <typename T, typename U, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> project
GLM_FUNC_QUALIFIER vec<3, T, P> project
(
tvec3<T, P> const & obj,
vec<3, T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport
vec<4, U, P> const & viewport
)
{
tvec4<T, P> tmp = tvec4<T, P>(obj, static_cast<T>(1));
vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast<T>(1));
tmp = model * tmp;
tmp = proj * tmp;
@@ -458,21 +458,21 @@ namespace glm
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
return tvec3<T, P>(tmp);
return vec<3, T, P>(tmp);
}
template <typename T, typename U, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> unProject
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
(
tvec3<T, P> const & win,
vec<3, T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport
vec<4, U, P> const & viewport
)
{
tmat4x4<T, P> Inverse = inverse(proj * model);
tvec4<T, P> tmp = tvec4<T, P>(win, T(1));
vec<4, T, P> tmp = vec<4, T, P>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE
@@ -482,14 +482,14 @@ namespace glm
tmp = tmp * static_cast<T>(2) - static_cast<T>(1);
# endif
tvec4<T, P> obj = Inverse * tmp;
vec<4, T, P> obj = Inverse * tmp;
obj /= obj.w;
return tvec3<T, P>(obj);
return vec<3, T, P>(obj);
}
template <typename T, precision P, typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> pickMatrix(tvec2<T, P> const & center, tvec2<T, P> const & delta, tvec4<U, P> const & viewport)
GLM_FUNC_QUALIFIER tmat4x4<T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
{
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
tmat4x4<T, P> Result(static_cast<T>(1));
@@ -497,18 +497,18 @@ namespace glm
if(!(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0)))
return Result; // Error
tvec3<T, P> Temp(
vec<3, T, P> Temp(
(static_cast<T>(viewport[2]) - static_cast<T>(2) * (center.x - static_cast<T>(viewport[0]))) / delta.x,
(static_cast<T>(viewport[3]) - static_cast<T>(2) * (center.y - static_cast<T>(viewport[1]))) / delta.y,
static_cast<T>(0));
// Translate and scale the picked region to the entire window
Result = translate(Result, Temp);
return scale(Result, tvec3<T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
return scale(Result, vec<3, T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAt(tvec3<T, P> const & eye, tvec3<T, P> const & center, tvec3<T, P> const & up)
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return lookAtLH(eye, center, up);
@@ -520,14 +520,14 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtRH
(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up
)
{
tvec3<T, P> const f(normalize(center - eye));
tvec3<T, P> const s(normalize(cross(f, up)));
tvec3<T, P> const u(cross(s, f));
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(f, up)));
vec<3, T, P> const u(cross(s, f));
tmat4x4<T, P> Result(1);
Result[0][0] = s.x;
@@ -548,14 +548,14 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtLH
(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up
)
{
tvec3<T, P> const f(normalize(center - eye));
tvec3<T, P> const s(normalize(cross(up, f)));
tvec3<T, P> const u(cross(f, s));
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(up, f)));
vec<3, T, P> const u(cross(f, s));
tmat4x4<T, P> Result(1);
Result[0][0] = s.x;

File diff suppressed because it is too large Load Diff

View File

@@ -475,20 +475,20 @@ namespace glm
/// the forth component specifies the 16 most-significant bits.
///
/// @see gtc_packing
/// @see tvec3<T, P> unpackRGBM(tvec4<T, P> const & p)
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const & p)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> packRGBM(tvec3<T, P> const & rgb);
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const & rgb);
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the forth component is obtained from the 16 most-significant bits of v.
///
/// @see gtc_packing
/// @see tvec4<T, P> packRGBM(tvec3<float, P> const & v)
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const & v)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> unpackRGBM(tvec4<T, P> const & rgbm);
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm);
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification.

View File

@@ -85,7 +85,7 @@ namespace glm
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tquat(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & s, tvec3<T, P> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & s, vec<3, T, P> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & w, T const & x, T const & y, T const & z);
// -- Conversion constructors --
@@ -105,10 +105,10 @@ namespace glm
/// @param v A second normalized axis
/// @see gtc_quaternion
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
GLM_FUNC_DECL tquat(tvec3<T, P> const & u, tvec3<T, P> const & v);
GLM_FUNC_DECL tquat(vec<3, T, P> const & u, vec<3, T, P> const & v);
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_EXPLICIT tquat(tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat4x4<T, P> const & m);
@@ -147,16 +147,16 @@ namespace glm
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q);
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q);
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
@@ -248,14 +248,14 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & axis);
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis);
/// Returns euler angles, pitch as x, yaw as y, roll as z.
/// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> eulerAngles(tquat<T, P> const & x);
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x);
/// Returns roll value of euler angles expressed in radians.
///
@@ -309,7 +309,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> axis(tquat<T, P> const & x);
GLM_FUNC_DECL vec<3, T, P> axis(tquat<T, P> const & x);
/// Build a quaternion from an angle and a normalized axis.
///
@@ -318,7 +318,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & axis);
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & axis);
/// Returns the component-wise comparison result of x < y.
///
@@ -326,7 +326,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x <= y.
///
@@ -334,7 +334,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x > y.
///
@@ -342,7 +342,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x >= y.
///
@@ -350,7 +350,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x == y.
///
@@ -358,7 +358,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x != y.
///
@@ -366,7 +366,7 @@ namespace glm
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
@@ -378,7 +378,7 @@ namespace glm
///
/// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> isnan(tquat<T, P> const & x);
GLM_FUNC_DECL vec<4, bool, P> isnan(tquat<T, P> const & x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@@ -388,7 +388,7 @@ namespace glm
///
/// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> isinf(tquat<T, P> const & x);
GLM_FUNC_DECL vec<4, bool, P> isinf(tquat<T, P> const & x);
/// @}
} //namespace glm

View File

@@ -14,7 +14,7 @@ namespace detail
{
static GLM_FUNC_QUALIFIER T call(tquat<T, P> const& a, tquat<T, P> const& b)
{
tvec4<T, P> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
vec<4, T, P> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
@@ -58,9 +58,9 @@ namespace detail
template <typename T, precision P, bool Aligned>
struct compute_quat_mul_vec4
{
static tvec4<T, P> call(tquat<T, P> const & q, tvec4<T, P> const & v)
static vec<4, T, P> call(tquat<T, P> const & q, vec<4, T, P> const & v)
{
return tvec4<T, P>(q * tvec3<T, P>(v), v.w);
return vec<4, T, P>(q * vec<3, T, P>(v), v.w);
}
};
}//namespace detail
@@ -112,7 +112,7 @@ namespace detail
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & s, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & s, vec<3, T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(s)
{}
@@ -140,9 +140,9 @@ namespace detail
// valType const & roll
//)
//{
// tvec3<valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5));
// tvec3<valType> c = glm::cos(eulerAngle * valType(0.5));
// tvec3<valType> s = glm::sin(eulerAngle * valType(0.5));
// 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;
@@ -151,9 +151,9 @@ namespace detail
//}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & u, vec<3, T, P> const & v)
{
tvec3<T, P> const LocalW(cross(u, v));
vec<3, T, P> const LocalW(cross(u, v));
T Dot = detail::compute_dot<vec<3, T, P>, T, detail::is_aligned<P>::value>::call(u, v);
tquat<T, P> q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z);
@@ -161,10 +161,10 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & eulerAngle)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & eulerAngle)
{
tvec3<T, P> c = glm::cos(eulerAngle * T(0.5));
tvec3<T, P> s = glm::sin(eulerAngle * T(0.5));
vec<3, T, P> c = glm::cos(eulerAngle * T(0.5));
vec<3, T, P> 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;
@@ -306,29 +306,29 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v)
{
tvec3<T, P> const QuatVector(q.x, q.y, q.z);
tvec3<T, P> const uv(glm::cross(QuatVector, v));
tvec3<T, P> const uuv(glm::cross(QuatVector, uv));
vec<3, T, P> const QuatVector(q.x, q.y, q.z);
vec<3, T, P> const uv(glm::cross(QuatVector, v));
vec<3, T, P> const uuv(glm::cross(QuatVector, uv));
return v + ((uv * q.w) + uuv) * static_cast<T>(2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q)
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q)
{
return glm::inverse(q) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tquat<T, P> const& q, tvec4<T, P> const& v)
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v)
{
return detail::compute_quat_mul_vec4<T, P, detail::is_aligned<P>::value>::call(q, v);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q)
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q)
{
return glm::inverse(q) * v;
}
@@ -538,9 +538,9 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & v)
{
tvec3<T, P> Tmp = v;
vec<3, T, P> Tmp = v;
// Axis of rotation must be normalised
T len = glm::length(Tmp);
@@ -560,9 +560,9 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> eulerAngles(tquat<T, P> const & x)
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const & x)
{
return tvec3<T, P>(pitch(x), yaw(x), roll(x));
return vec<3, T, P>(pitch(x), yaw(x), roll(x));
}
template <typename T, precision P>
@@ -694,17 +694,17 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> axis(tquat<T, P> const & x)
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const & x)
{
T tmp1 = static_cast<T>(1) - x.w * x.w;
if(tmp1 <= static_cast<T>(0))
return tvec3<T, P>(0, 0, 1);
return vec<3, T, P>(0, 0, 1);
T tmp2 = static_cast<T>(1) / sqrt(tmp1);
return tvec3<T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
return vec<3, T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & v)
{
tquat<T, P> Result(uninitialize);
@@ -719,73 +719,73 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] < y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] <= y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] > y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] >= y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] == y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y)
GLM_FUNC_QUALIFIER vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{
tvec4<bool, P> Result(uninitialize);
vec<4, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] != y[i];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> isnan(tquat<T, P> const& q)
GLM_FUNC_QUALIFIER vec<4, bool, P> isnan(tquat<T, P> const& q)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return tvec4<bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
return vec<4, bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<bool, P> isinf(tquat<T, P> const& q)
GLM_FUNC_QUALIFIER vec<4, bool, P> isinf(tquat<T, P> const& q)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
return tvec4<bool, P>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w));
return vec<4, bool, P>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w));
}
}//namespace glm

View File

@@ -99,7 +99,7 @@ namespace detail
{
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_sub_ps(q.data, p.data);
return Result;
}
@@ -123,7 +123,7 @@ namespace detail
{
static tquat<float, P> call(tquat<float, P> const& q, float s)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s));
return Result;
}
@@ -147,7 +147,7 @@ namespace detail
{
static tquat<float, P> call(tquat<float, P> const& q, float s)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_div_ps(q.data, _mm_set_ps1(s));
return Result;
}
@@ -169,7 +169,7 @@ namespace detail
template <precision P>
struct compute_quat_mul_vec4<float, P, true>
{
static tvec4<float, P> call(tquat<float, P> const& q, tvec4<float, P> const& v)
static vec<4, float, P> call(tquat<float, P> const& q, vec<4, float, P> const& v)
{
__m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1));
@@ -186,7 +186,7 @@ namespace detail
uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two));
uuv = _mm_mul_ps(uuv, two);
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv));
return Result;
}

View File

@@ -64,7 +64,7 @@ namespace glm
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> circularRand(
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
@@ -72,7 +72,7 @@ namespace glm
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand(
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
@@ -80,7 +80,7 @@ namespace glm
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> diskRand(
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
@@ -88,7 +88,7 @@ namespace glm
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> ballRand(
GLM_FUNC_DECL vec<3, T, defaultp> ballRand(
T Radius);
/// @}

View File

@@ -19,9 +19,9 @@ namespace detail
template <precision P>
struct compute_rand<1, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec1<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
{
return tvec1<uint8, P>(
return vec<1, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max());
}
};
@@ -29,9 +29,9 @@ namespace detail
template <precision P>
struct compute_rand<2, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec2<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<2, uint8, P> call()
{
return tvec2<uint8, P>(
return vec<2, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max());
}
@@ -40,9 +40,9 @@ namespace detail
template <precision P>
struct compute_rand<3, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec3<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<3, uint8, P> call()
{
return tvec3<uint8, P>(
return vec<3, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max());
@@ -52,9 +52,9 @@ namespace detail
template <precision P>
struct compute_rand<4, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<4, uint8, P> call()
{
return tvec4<uint8, P>(
return vec<4, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
@@ -259,8 +259,8 @@ namespace detail
GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max)
{
return detail::compute_linearRand<1, genType, highp, vec>::call(
tvec1<genType, highp>(Min),
tvec1<genType, highp>(Max)).x;
vec<1, genType, highp>(Min),
vec<1, genType, highp>(Max)).x;
}
template <int D, typename T, precision P, template <int, typename, precision> class vecType>
@@ -292,16 +292,16 @@ namespace detail
}
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> diskRand(T Radius)
GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius)
{
tvec2<T, defaultp> Result(T(0));
vec<2, T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(
tvec2<T, defaultp>(-Radius),
tvec2<T, defaultp>(Radius));
vec<2, T, defaultp>(-Radius),
vec<2, T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -310,16 +310,16 @@ namespace detail
}
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> ballRand(T Radius)
GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius)
{
tvec3<T, defaultp> Result(T(0));
vec<3, T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(
tvec3<T, defaultp>(-Radius),
tvec3<T, defaultp>(Radius));
vec<3, T, defaultp>(-Radius),
vec<3, T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -328,14 +328,14 @@ namespace detail
}
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> circularRand(T Radius)
GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius)
{
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
return tvec2<T, defaultp>(cos(a), sin(a)) * Radius;
return vec<2, T, defaultp>(cos(a), sin(a)) * Radius;
}
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> sphericalRand(T Radius)
GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius)
{
T z = linearRand(T(-1), T(1));
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
@@ -345,6 +345,6 @@ namespace detail
T x = r * cos(a);
T y = r * sin(a);
return tvec3<T, defaultp>(x, y, z) * Radius;
return vec<3, T, defaultp>(x, y, z) * Radius;
}
}//namespace glm

View File

@@ -232,7 +232,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value)
{
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, vec, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x;
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, vec, std::numeric_limits<genType>::is_signed>::call(vec<1, genType, defaultp>(value)).x;
}
template <int D, typename T, precision P, template <int, typename, precision> class vecType>
@@ -282,7 +282,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple)
{
return isMultiple(tvec1<genType>(Value), tvec1<genType>(Multiple)).x;
return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x;
}
template <int D, typename T, precision P, template <int, typename, precision> class vecType>

View File

@@ -30,205 +30,205 @@ namespace glm
// -- *vec1 --
typedef tvec1<float, aligned_highp> aligned_highp_vec1;
typedef tvec1<float, aligned_mediump> aligned_mediump_vec1;
typedef tvec1<float, aligned_lowp> aligned_lowp_vec1;
typedef tvec1<double, aligned_highp> aligned_highp_dvec1;
typedef tvec1<double, aligned_mediump> aligned_mediump_dvec1;
typedef tvec1<double, aligned_lowp> aligned_lowp_dvec1;
typedef tvec1<int, aligned_highp> aligned_highp_ivec1;
typedef tvec1<int, aligned_mediump> aligned_mediump_ivec1;
typedef tvec1<int, aligned_lowp> aligned_lowp_ivec1;
typedef tvec1<uint, aligned_highp> aligned_highp_uvec1;
typedef tvec1<uint, aligned_mediump> aligned_mediump_uvec1;
typedef tvec1<uint, aligned_lowp> aligned_lowp_uvec1;
typedef tvec1<bool, aligned_highp> aligned_highp_bvec1;
typedef tvec1<bool, aligned_mediump> aligned_mediump_bvec1;
typedef tvec1<bool, aligned_lowp> aligned_lowp_bvec1;
typedef vec<1, float, aligned_highp> aligned_highp_vec1;
typedef vec<1, float, aligned_mediump> aligned_mediump_vec1;
typedef vec<1, float, aligned_lowp> aligned_lowp_vec1;
typedef vec<1, double, aligned_highp> aligned_highp_dvec1;
typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1;
typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1;
typedef vec<1, int, aligned_highp> aligned_highp_ivec1;
typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1;
typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1;
typedef vec<1, uint, aligned_highp> aligned_highp_uvec1;
typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1;
typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1;
typedef vec<1, bool, aligned_highp> aligned_highp_bvec1;
typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1;
typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1;
typedef tvec1<float, packed_highp> packed_highp_vec1;
typedef tvec1<float, packed_mediump> packed_mediump_vec1;
typedef tvec1<float, packed_lowp> packed_lowp_vec1;
typedef tvec1<double, packed_highp> packed_highp_dvec1;
typedef tvec1<double, packed_mediump> packed_mediump_dvec1;
typedef tvec1<double, packed_lowp> packed_lowp_dvec1;
typedef tvec1<int, packed_highp> packed_highp_ivec1;
typedef tvec1<int, packed_mediump> packed_mediump_ivec1;
typedef tvec1<int, packed_lowp> packed_lowp_ivec1;
typedef tvec1<uint, packed_highp> packed_highp_uvec1;
typedef tvec1<uint, packed_mediump> packed_mediump_uvec1;
typedef tvec1<uint, packed_lowp> packed_lowp_uvec1;
typedef tvec1<bool, packed_highp> packed_highp_bvec1;
typedef tvec1<bool, packed_mediump> packed_mediump_bvec1;
typedef tvec1<bool, packed_lowp> packed_lowp_bvec1;
typedef vec<1, float, packed_highp> packed_highp_vec1;
typedef vec<1, float, packed_mediump> packed_mediump_vec1;
typedef vec<1, float, packed_lowp> packed_lowp_vec1;
typedef vec<1, double, packed_highp> packed_highp_dvec1;
typedef vec<1, double, packed_mediump> packed_mediump_dvec1;
typedef vec<1, double, packed_lowp> packed_lowp_dvec1;
typedef vec<1, int, packed_highp> packed_highp_ivec1;
typedef vec<1, int, packed_mediump> packed_mediump_ivec1;
typedef vec<1, int, packed_lowp> packed_lowp_ivec1;
typedef vec<1, uint, packed_highp> packed_highp_uvec1;
typedef vec<1, uint, packed_mediump> packed_mediump_uvec1;
typedef vec<1, uint, packed_lowp> packed_lowp_uvec1;
typedef vec<1, bool, packed_highp> packed_highp_bvec1;
typedef vec<1, bool, packed_mediump> packed_mediump_bvec1;
typedef vec<1, bool, packed_lowp> packed_lowp_bvec1;
// -- *vec2 --
/// 2 components vector of high single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_highp> aligned_highp_vec2;
typedef vec<2, float, aligned_highp> aligned_highp_vec2;
/// 2 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_mediump> aligned_mediump_vec2;
typedef vec<2, float, aligned_mediump> aligned_mediump_vec2;
/// 2 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_lowp> aligned_lowp_vec2;
typedef vec<2, float, aligned_lowp> aligned_lowp_vec2;
/// 2 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_highp> aligned_highp_dvec2;
typedef vec<2double, aligned_highp> aligned_highp_dvec2;
/// 2 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_mediump> aligned_mediump_dvec2;
typedef vec<2double, aligned_mediump> aligned_mediump_dvec2;
/// 2 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_lowp> aligned_lowp_dvec2;
typedef vec<2double, aligned_lowp> aligned_lowp_dvec2;
/// 2 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_highp> aligned_highp_ivec2;
typedef vec<2, int, aligned_highp> aligned_highp_ivec2;
/// 2 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_mediump> aligned_mediump_ivec2;
typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2;
/// 2 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_lowp> aligned_lowp_ivec2;
typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2;
/// 2 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_highp> aligned_highp_uvec2;
typedef vec<2, uint, aligned_highp> aligned_highp_uvec2;
/// 2 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_mediump> aligned_mediump_uvec2;
typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2;
/// 2 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_lowp> aligned_lowp_uvec2;
typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2;
/// 2 components vector of high precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_highp> aligned_highp_bvec2;
typedef vec<2bool, aligned_highp> aligned_highp_bvec2;
/// 2 components vector of medium precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_mediump> aligned_mediump_bvec2;
typedef vec<2bool, aligned_mediump> aligned_mediump_bvec2;
/// 2 components vector of low precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_lowp> aligned_lowp_bvec2;
typedef vec<2bool, aligned_lowp> aligned_lowp_bvec2;
// -- *vec3 --
/// 3 components vector of high single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_highp> aligned_highp_vec3;
typedef vec<3, float, aligned_highp> aligned_highp_vec3;
/// 3 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_mediump> aligned_mediump_vec3;
typedef vec<3, float, aligned_mediump> aligned_mediump_vec3;
/// 3 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_lowp> aligned_lowp_vec3;
typedef vec<3, float, aligned_lowp> aligned_lowp_vec3;
/// 3 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_highp> aligned_highp_dvec3;
typedef vec<3, double, aligned_highp> aligned_highp_dvec3;
/// 3 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_mediump> aligned_mediump_dvec3;
typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3;
/// 3 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_lowp> aligned_lowp_dvec3;
typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3;
/// 3 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_highp> aligned_highp_ivec3;
typedef vec<3, int, aligned_highp> aligned_highp_ivec3;
/// 3 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_mediump> aligned_mediump_ivec3;
typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3;
/// 3 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_lowp> aligned_lowp_ivec3;
typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3;
/// 3 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_highp> aligned_highp_uvec3;
typedef vec<3, uint, aligned_highp> aligned_highp_uvec3;
/// 3 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_mediump> aligned_mediump_uvec3;
typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3;
/// 3 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_lowp> aligned_lowp_uvec3;
typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3;
/// 3 components vector of high precision bool numbers.
typedef tvec3<bool, aligned_highp> aligned_highp_bvec3;
typedef vec<3, bool, aligned_highp> aligned_highp_bvec3;
/// 3 components vector of medium precision bool numbers.
typedef tvec3<bool, aligned_mediump> aligned_mediump_bvec3;
typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3;
/// 3 components vector of low precision bool numbers.
typedef tvec3<bool, aligned_lowp> aligned_lowp_bvec3;
typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3;
// -- *vec4 --
/// 4 components vector of high single-precision floating-point numbers.
typedef tvec4<float, aligned_highp> aligned_highp_vec4;
typedef vec<4, float, aligned_highp> aligned_highp_vec4;
/// 4 components vector of medium single-precision floating-point numbers.
typedef tvec4<float, aligned_mediump> aligned_mediump_vec4;
typedef vec<4, float, aligned_mediump> aligned_mediump_vec4;
/// 4 components vector of low single-precision floating-point numbers.
typedef tvec4<float, aligned_lowp> aligned_lowp_vec4;
typedef vec<4, float, aligned_lowp> aligned_lowp_vec4;
/// 4 components vector of high double-precision floating-point numbers.
typedef tvec4<double, aligned_highp> aligned_highp_dvec4;
typedef vec<4, double, aligned_highp> aligned_highp_dvec4;
/// 4 components vector of medium double-precision floating-point numbers.
typedef tvec4<double, aligned_mediump> aligned_mediump_dvec4;
typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4;
/// 4 components vector of low double-precision floating-point numbers.
typedef tvec4<double, aligned_lowp> aligned_lowp_dvec4;
typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4;
/// 4 components vector of high precision signed integer numbers.
typedef tvec4<int, aligned_highp> aligned_highp_ivec4;
typedef vec<4, int, aligned_highp> aligned_highp_ivec4;
/// 4 components vector of medium precision signed integer numbers.
typedef tvec4<int, aligned_mediump> aligned_mediump_ivec4;
typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4;
/// 4 components vector of low precision signed integer numbers.
typedef tvec4<int, aligned_lowp> aligned_lowp_ivec4;
typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4;
/// 4 components vector of high precision unsigned integer numbers.
typedef tvec4<uint, aligned_highp> aligned_highp_uvec4;
typedef vec<4, uint, aligned_highp> aligned_highp_uvec4;
/// 4 components vector of medium precision unsigned integer numbers.
typedef tvec4<uint, aligned_mediump> aligned_mediump_uvec4;
typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4;
/// 4 components vector of low precision unsigned integer numbers.
typedef tvec4<uint, aligned_lowp> aligned_lowp_uvec4;
typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4;
/// 4 components vector of high precision bool numbers.
typedef tvec4<bool, aligned_highp> aligned_highp_bvec4;
typedef vec<4, bool, aligned_highp> aligned_highp_bvec4;
/// 4 components vector of medium precision bool numbers.
typedef tvec4<bool, aligned_mediump> aligned_mediump_bvec4;
typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4;
/// 4 components vector of low precision bool numbers.
typedef tvec4<bool, aligned_lowp> aligned_lowp_bvec4;
typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4;
// -- default --

View File

@@ -247,70 +247,70 @@ namespace glm
/// 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i8, defaultp> i8vec1;
typedef vec<1, i8, defaultp> i8vec1;
/// 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i8, defaultp> i8vec2;
typedef vec<2, i8, defaultp> i8vec2;
/// 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i8, defaultp> i8vec3;
typedef vec<3, i8, defaultp> i8vec3;
/// 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i8, defaultp> i8vec4;
typedef vec<4, i8, defaultp> i8vec4;
/// 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i16, defaultp> i16vec1;
typedef vec<1, i16, defaultp> i16vec1;
/// 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i16, defaultp> i16vec2;
typedef vec<2, i16, defaultp> i16vec2;
/// 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i16, defaultp> i16vec3;
typedef vec<3, i16, defaultp> i16vec3;
/// 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i16, defaultp> i16vec4;
typedef vec<4, i16, defaultp> i16vec4;
/// 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, defaultp> i32vec1;
typedef vec<1, i32, defaultp> i32vec1;
/// 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, defaultp> i32vec2;
typedef vec<2, i32, defaultp> i32vec2;
/// 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, defaultp> i32vec3;
typedef vec<3, i32, defaultp> i32vec3;
/// 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, defaultp> i32vec4;
typedef vec<4, i32, defaultp> i32vec4;
/// 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i64, defaultp> i64vec1;
typedef vec<1, i64, defaultp> i64vec1;
/// 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i64, defaultp> i64vec2;
typedef vec<2, i64, defaultp> i64vec2;
/// 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i64, defaultp> i64vec3;
typedef vec<3, i64, defaultp> i64vec3;
/// 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i64, defaultp> i64vec4;
typedef vec<4, i64, defaultp> i64vec4;
/////////////////////////////
@@ -519,70 +519,70 @@ namespace glm
/// Default precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u8, defaultp> u8vec1;
typedef vec<1, u8, defaultp> u8vec1;
/// Default precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u8, defaultp> u8vec2;
typedef vec<2, u8, defaultp> u8vec2;
/// Default precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u8, defaultp> u8vec3;
typedef vec<3, u8, defaultp> u8vec3;
/// Default precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u8, defaultp> u8vec4;
typedef vec<4, u8, defaultp> u8vec4;
/// Default precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u16, defaultp> u16vec1;
typedef vec<1, u16, defaultp> u16vec1;
/// Default precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u16, defaultp> u16vec2;
typedef vec<2, u16, defaultp> u16vec2;
/// Default precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u16, defaultp> u16vec3;
typedef vec<3, u16, defaultp> u16vec3;
/// Default precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u16, defaultp> u16vec4;
typedef vec<4, u16, defaultp> u16vec4;
/// Default precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, defaultp> u32vec1;
typedef vec<1, u32, defaultp> u32vec1;
/// Default precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, defaultp> u32vec2;
typedef vec<2, u32, defaultp> u32vec2;
/// Default precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, defaultp> u32vec3;
typedef vec<3, u32, defaultp> u32vec3;
/// Default precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, defaultp> u32vec4;
typedef vec<4, u32, defaultp> u32vec4;
/// Default precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u64, defaultp> u64vec1;
typedef vec<1, u64, defaultp> u64vec1;
/// Default precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u64, defaultp> u64vec2;
typedef vec<2, u64, defaultp> u64vec2;
/// Default precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u64, defaultp> u64vec3;
typedef vec<3, u64, defaultp> u64vec3;
/// Default precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u64, defaultp> u64vec4;
typedef vec<4, u64, defaultp> u64vec4;
//////////////////////
@@ -617,53 +617,53 @@ namespace glm
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, defaultp> fvec1;
typedef vec<1, float, defaultp> fvec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, defaultp> fvec2;
typedef vec<2, float, defaultp> fvec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, defaultp> fvec3;
typedef vec<3, float, defaultp> fvec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, defaultp> fvec4;
typedef vec<4, float, defaultp> fvec4;
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f32, defaultp> f32vec1;
typedef vec<1, f32, defaultp> f32vec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f32, defaultp> f32vec2;
typedef vec<2, f32, defaultp> f32vec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f32, defaultp> f32vec3;
typedef vec<3, f32, defaultp> f32vec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f32, defaultp> f32vec4;
typedef vec<4, f32, defaultp> f32vec4;
/// Double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f64, defaultp> f64vec1;
typedef vec<1, f64, defaultp> f64vec1;
/// Double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f64, defaultp> f64vec2;
typedef vec<2, f64, defaultp> f64vec2;
/// Double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f64, defaultp> f64vec3;
typedef vec<3, f64, defaultp> f64vec3;
/// Double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f64, defaultp> f64vec4;
typedef vec<4, f64, defaultp> f64vec4;
//////////////////////

View File

@@ -65,17 +65,17 @@ namespace glm
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec2<T, defaultp> make_vec2(T const * const ptr);
GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec3<T, defaultp> make_vec3(T const * const ptr);
GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec4<T, defaultp> make_vec4(T const * const ptr);
GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr

View File

@@ -13,7 +13,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec2<T, P> const & vec
vec<2, T, P> const & vec
)
{
return &(vec.x);
@@ -24,7 +24,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec2<T, P> & vec
vec<2, T, P> & vec
)
{
return &(vec.x);
@@ -35,7 +35,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec3<T, P> const & vec
vec<3, T, P> const & vec
)
{
return &(vec.x);
@@ -46,7 +46,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec3<T, P> & vec
vec<3, T, P> & vec
)
{
return &(vec.x);
@@ -57,7 +57,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec4<T, P> const & vec
vec<4, T, P> const & vec
)
{
return &(vec.x);
@@ -68,7 +68,7 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec4<T, P> & vec
vec<4, T, P> & vec
)
{
return &(vec.x);
@@ -294,30 +294,30 @@ namespace glm
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> make_vec2(T const * const ptr)
GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const * const ptr)
{
tvec2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec2<T, defaultp>));
vec<2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>));
return Result;
}
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> make_vec3(T const * const ptr)
GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const * const ptr)
{
tvec3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec3<T, defaultp>));
vec<3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>));
return Result;
}
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec4<T, defaultp> make_vec4(T const * const ptr)
GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const * const ptr)
{
tvec4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec4<T, defaultp>));
vec<4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>));
return Result;
}