mirror of
https://github.com/g-truc/glm.git
synced 2026-09-10 12:38:07 +00:00
Reliable aligned types
This commit is contained in:
@@ -34,7 +34,7 @@ namespace glm
|
||||
|
||||
template<length_t L, typename T, qualifier Q = defaultp> struct vec;
|
||||
template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat;
|
||||
template<typename T, qualifier Q = defaultp> struct qua;
|
||||
template<typename T, qualifier Q = defaultp, std::size_t N = alignof(T)> struct qua;
|
||||
|
||||
template <typename T, qualifier Q = defaultp> using tvec1 = vec<1, T, Q>;
|
||||
template <typename T, qualifier Q = defaultp> using tvec2 = vec<2, T, Q>;
|
||||
|
||||
@@ -19,18 +19,21 @@ namespace glm
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# pragma GCC diagnostic ignored "-Wattributes" // for alignas(1), packed types
|
||||
# elif GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# pragma clang diagnostic ignored "-Wpadded"
|
||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
|
||||
# pragma warning(disable: 4324) // nonstandard extension used : nameless struct/union
|
||||
# endif
|
||||
# endif
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
struct qua
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
struct alignas(N) qua
|
||||
{
|
||||
// -- Implementation detail --
|
||||
|
||||
@@ -71,9 +74,9 @@ namespace glm
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR qua() GLM_DEFAULT_CTOR;
|
||||
GLM_CTOR_DECL qua(qua<T, Q> const& q) = default;
|
||||
GLM_CTOR_DECL qua(qua<T, Q, N> const& q) = default;
|
||||
template<qualifier P>
|
||||
GLM_CTOR_DECL qua(qua<T, P> const& q);
|
||||
GLM_CTOR_DECL qua(qua<T, P, N> const& q);
|
||||
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
@@ -85,12 +88,12 @@ namespace glm
|
||||
GLM_CTOR_DECL qua(T w, T x, T y, T z);
|
||||
# endif
|
||||
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR qua<T, Q> wxyz(T w, T x, T y, T z);
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR qua<T, Q, N> wxyz(T w, T x, T y, T z);
|
||||
|
||||
// -- Conversion constructors --
|
||||
|
||||
template<typename U, qualifier P>
|
||||
GLM_CTOR_DECL GLM_EXPLICIT qua(qua<U, P> const& q);
|
||||
template<typename U, qualifier P, std::size_t M>
|
||||
GLM_CTOR_DECL GLM_EXPLICIT qua(qua<U, P, M> const& q);
|
||||
|
||||
GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const;
|
||||
GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const;
|
||||
@@ -110,20 +113,20 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator=(qua<T, Q> const& q) = default;
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator=(qua<T, Q, N> const& q) = default;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator=(qua<U, Q> const& q);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator=(qua<U, Q, N> const& q);
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator+=(qua<U, Q> const& q);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator+=(qua<U, Q, N> const& q);
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator-=(qua<U, Q> const& q);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator-=(qua<U, Q, N> const& q);
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator*=(qua<U, Q> const& q);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator*=(qua<U, Q, N> const& q);
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator*=(U s);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator*=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q>& operator/=(U s);
|
||||
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua<T, Q, N>& operator/=(U s);
|
||||
};
|
||||
|
||||
# if GLM_SILENT_WARNINGS == GLM_ENABLE
|
||||
@@ -138,51 +141,51 @@ namespace glm
|
||||
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator+(qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator+(qua<T, Q, N> const& q);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator-(qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator-(qua<T, Q, N> const& q);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator+(qua<T, Q> const& q, qua<T, Q> const& p);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator+(qua<T, Q, N> const& q, qua<T, Q, N> const& p);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator-(qua<T, Q> const& q, qua<T, Q> const& p);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator-(qua<T, Q, N> const& q, qua<T, Q, N> const& p);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator*(qua<T, Q> const& q, qua<T, Q> const& p);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator*(qua<T, Q, N> const& q, qua<T, Q, N> const& p);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua<T, Q> const& q, vec<3, T, Q> const& v);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua<T, Q, N> const& q, vec<3, T, Q> const& v);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua<T, Q, N> const& q);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua<T, Q> const& q, vec<4, T, Q> const& v);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua<T, Q, N> const& q, vec<4, T, Q> const& v);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua<T, Q, N> const& q);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator*(qua<T, Q> const& q, T const& s);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator*(qua<T, Q, N> const& q, T const& s);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator*(T const& s, qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator*(T const& s, qua<T, Q, N> const& q);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> operator/(qua<T, Q> const& q, T const& s);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> operator/(qua<T, Q, N> const& q, T const& s);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua<T, Q> const& q1, qua<T, Q> const& q2);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua<T, Q, N> const& q1, qua<T, Q, N> const& q2);
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua<T, Q> const& q1, qua<T, Q> const& q2);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua<T, Q, N> const& q1, qua<T, Q, N> const& q2);
|
||||
} //namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
||||
@@ -71,8 +71,8 @@ namespace detail
|
||||
|
||||
// -- Component accesses --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua<T, Q>::operator[](typename qua<T, Q>::length_type i)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua<T, Q, N>::operator[](typename qua<T, Q, N>::length_type i)
|
||||
{
|
||||
GLM_ASSERT_LENGTH(i, this->length());
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
@@ -82,8 +82,8 @@ namespace detail
|
||||
# endif
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua<T, Q>::operator[](typename qua<T, Q>::length_type i) const
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua<T, Q, N>::operator[](typename qua<T, Q, N>::length_type i) const
|
||||
{
|
||||
GLM_ASSERT_LENGTH(i, this->length());
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
@@ -96,8 +96,8 @@ namespace detail
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua()
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua()
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
: w(1), x(0), y(0), z(0)
|
||||
# else
|
||||
@@ -106,9 +106,9 @@ namespace detail
|
||||
{}
|
||||
# endif
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<T, P> const& q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(qua<T, P, N> const& q)
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
: w(q.w), x(q.x), y(q.y), z(q.z)
|
||||
# else
|
||||
@@ -118,8 +118,8 @@ namespace detail
|
||||
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T s, vec<3, T, Q> const& v)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(T s, vec<3, T, Q> const& v)
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
: w(s), x(v.x), y(v.y), z(v.z)
|
||||
# else
|
||||
@@ -127,11 +127,11 @@ namespace detail
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <typename T, qualifier Q>
|
||||
template <typename T, qualifier Q, std::size_t N>
|
||||
# ifdef GLM_FORCE_QUAT_DATA_XYZW
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _x, T _y, T _z, T _w)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(T _x, T _y, T _z, T _w)
|
||||
# else
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(T _w, T _x, T _y, T _z)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(T _w, T _x, T _y, T _z)
|
||||
# endif
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
: w(_w), x(_x), y(_y), z(_z)
|
||||
@@ -140,20 +140,20 @@ namespace detail
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <typename T, qualifier Q>
|
||||
GLM_CONSTEXPR qua<T, Q> qua<T, Q>::wxyz(T w, T x, T y, T z) {
|
||||
template <typename T, qualifier Q, std::size_t N>
|
||||
GLM_CONSTEXPR qua<T, Q, N> qua<T, Q, N>::wxyz(T w, T x, T y, T z) {
|
||||
# ifdef GLM_FORCE_QUAT_DATA_XYZW
|
||||
return qua<T, Q>(x, y, z, w);
|
||||
return qua<T, Q, N>(x, y, z, w);
|
||||
# else
|
||||
return qua<T, Q>(w, x, y, z);
|
||||
return qua<T, Q, N>(w, x, y, z);
|
||||
# endif
|
||||
}
|
||||
|
||||
// -- Conversion constructors --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(qua<U, P> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U, qualifier P, std::size_t M>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(qua<U, P, M> const& q)
|
||||
# ifdef GLM_FORCE_QUAT_DATA_WXYZ
|
||||
: w(static_cast<T>(q.w)), x(static_cast<T>(q.x)), y(static_cast<T>(q.y)), z(static_cast<T>(q.z))
|
||||
# else
|
||||
@@ -179,8 +179,8 @@ namespace detail
|
||||
// this->z = c.x * c.y * s.z - s.x * s.y * c.z;
|
||||
//}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q>::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N>::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v)
|
||||
{
|
||||
T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v));
|
||||
T real_part = norm_u_norm_v + dot(u, v);
|
||||
@@ -203,8 +203,8 @@ namespace detail
|
||||
*this = normalize(qua<T, Q>::wxyz(real_part, t.x, t.y, t.z));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(vec<3, T, Q> const& eulerAngle)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(vec<3, T, Q> const& eulerAngle)
|
||||
{
|
||||
vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5));
|
||||
vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5));
|
||||
@@ -215,35 +215,35 @@ namespace detail
|
||||
this->z = c.x * c.y * s.z - s.x * s.y * c.z;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(mat<3, 3, T, Q> const& m)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(mat<3, 3, T, Q> const& m)
|
||||
{
|
||||
*this = quat_cast(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua(mat<4, 4, T, Q> const& m)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N>::qua(mat<4, 4, T, Q> const& m)
|
||||
{
|
||||
*this = quat_cast(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q>::operator mat<3, 3, T, Q>() const
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N>::operator mat<3, 3, T, Q>() const
|
||||
{
|
||||
return mat3_cast(*this);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q>::operator mat<4, 4, T, Q>() const
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N>::operator mat<4, 4, T, Q>() const
|
||||
{
|
||||
return mat4_cast(*this);
|
||||
}
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator=(qua<U, Q> const& q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator=(qua<U, Q, N> const& q)
|
||||
{
|
||||
this->w = static_cast<T>(q.w);
|
||||
this->x = static_cast<T>(q.x);
|
||||
@@ -252,26 +252,26 @@ namespace detail
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator+=(qua<U, Q> const& q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator+=(qua<U, Q, N> const& q)
|
||||
{
|
||||
return (*this = detail::compute_quat_add<T, Q, detail::is_aligned<Q>::value>::call(*this, qua<T, Q>(q)));
|
||||
return (*this = detail::compute_quat_add<T, Q, detail::is_aligned<Q>::value>::call(*this, qua<T, Q, N>(q)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator-=(qua<U, Q> const& q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator-=(qua<U, Q, N> const& q)
|
||||
{
|
||||
return (*this = detail::compute_quat_sub<T, Q, detail::is_aligned<Q>::value>::call(*this, qua<T, Q>(q)));
|
||||
return (*this = detail::compute_quat_sub<T, Q, detail::is_aligned<Q>::value>::call(*this, qua<T, Q, N>(q)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator*=(qua<U, Q> const& r)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator*=(qua<U, Q, N> const& r)
|
||||
{
|
||||
qua<T, Q> const p(*this);
|
||||
qua<T, Q> const q(r);
|
||||
qua<T, Q, N> const p(*this);
|
||||
qua<T, Q, N> const q(r);
|
||||
|
||||
this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z;
|
||||
this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y;
|
||||
@@ -280,56 +280,56 @@ namespace detail
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator*=(U s)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator*=(U s)
|
||||
{
|
||||
return (*this = detail::compute_quat_mul_scalar<T, Q, detail::is_aligned<Q>::value>::call(*this, static_cast<U>(s)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> & qua<T, Q>::operator/=(U s)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> & qua<T, Q, N>::operator/=(U s)
|
||||
{
|
||||
return (*this = detail::compute_quat_div_scalar<T, Q, detail::is_aligned<Q>::value>::call(*this, static_cast<U>(s)));
|
||||
}
|
||||
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator+(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator+(qua<T, Q, N> const& q)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator-(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator-(qua<T, Q, N> const& q)
|
||||
{
|
||||
return qua<T, Q>::wxyz(-q.w, -q.x, -q.y, -q.z);
|
||||
return qua<T, Q, N>::wxyz(-q.w, -q.x, -q.y, -q.z);
|
||||
}
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator+(qua<T, Q> const& q, qua<T, Q> const& p)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator+(qua<T, Q, N> const& q, qua<T, Q, N> const& p)
|
||||
{
|
||||
return qua<T, Q>(q) += p;
|
||||
return qua<T, Q, N>(q) += p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator-(qua<T, Q> const& q, qua<T, Q> const& p)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator-(qua<T, Q, N> const& q, qua<T, Q, N> const& p)
|
||||
{
|
||||
return qua<T, Q>(q) -= p;
|
||||
return qua<T, Q, N>(q) -= p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator*(qua<T, Q> const& q, qua<T, Q> const& p)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator*(qua<T, Q, N> const& q, qua<T, Q, N> const& p)
|
||||
{
|
||||
return qua<T, Q>(q) *= p;
|
||||
return qua<T, Q, N>(q) *= p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua<T, Q> const& q, vec<3, T, Q> const& v)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua<T, Q, N> const& q, vec<3, T, Q> const& v)
|
||||
{
|
||||
vec<3, T, Q> const QuatVector(q.x, q.y, q.z);
|
||||
vec<3, T, Q> const uv(glm::cross(QuatVector, v));
|
||||
@@ -338,54 +338,54 @@ namespace detail
|
||||
return v + ((uv * q.w) + uuv) * static_cast<T>(2);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua<T, Q, N> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua<T, Q> const& q, vec<4, T, Q> const& v)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua<T, Q, N> const& q, vec<4, T, Q> const& v)
|
||||
{
|
||||
return detail::compute_quat_mul_vec4<T, Q, detail::is_aligned<Q>::value>::call(q, v);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua<T, Q, N> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator*(qua<T, Q> const& q, T const& s)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator*(qua<T, Q, N> const& q, T const& s)
|
||||
{
|
||||
return qua<T, Q>::wxyz(
|
||||
return qua<T, Q, N>::wxyz(
|
||||
q.w * s, q.x * s, q.y * s, q.z * s);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator*(T const& s, qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator*(T const& s, qua<T, Q, N> const& q)
|
||||
{
|
||||
return q * s;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> operator/(qua<T, Q> const& q, T const& s)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> operator/(qua<T, Q, N> const& q, T const& s)
|
||||
{
|
||||
return qua<T, Q>::wxyz(
|
||||
return qua<T, Q, N>::wxyz(
|
||||
q.w / s, q.x / s, q.y / s, q.z / s);
|
||||
}
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua<T, Q> const& q1, qua<T, Q> const& q2)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua<T, Q, N> const& q1, qua<T, Q, N> const& q2)
|
||||
{
|
||||
return q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w;
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua<T, Q> const& q1, qua<T, Q> const& q2)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua<T, Q, N> const& q1, qua<T, Q, N> const& q2)
|
||||
{
|
||||
return q1.x != q2.x || q1.y != q2.y || q1.z != q2.z || q1.w != q2.w;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace glm
|
||||
/// @tparam Q A value from qualifier enum
|
||||
///
|
||||
/// @see - slerp(qua<T, Q> const& x, qua<T, Q> const& y, T const& a)
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL qua<T, Q> mix(qua<T, Q> const& x, qua<T, Q> const& y, T a);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL qua<T, Q, N> mix(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a);
|
||||
|
||||
/// Linear interpolation of two quaternions.
|
||||
/// The interpolation is oriented.
|
||||
@@ -61,8 +61,8 @@ namespace glm
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> lerp(qua<T, Q> const& x, qua<T, Q> const& y, T a);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> lerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions.
|
||||
/// The interpolation always take the short path and the rotation is performed at constant speed.
|
||||
@@ -73,8 +73,8 @@ namespace glm
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL qua<T, Q, N> slerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions with multiple spins over rotation axis.
|
||||
/// The interpolation always take the short path when the spin count is positive and long path
|
||||
@@ -88,22 +88,22 @@ namespace glm
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam S An integer scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, typename S, qualifier Q>
|
||||
GLM_FUNC_DECL qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a, S k);
|
||||
template<typename T, typename S, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL qua<T, Q, N> slerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a, S k);
|
||||
|
||||
/// Returns the q conjugate.
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> conjugate(qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> conjugate(qua<T, Q, N> const& q);
|
||||
|
||||
/// Returns the q inverse.
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q> inverse(qua<T, Q> const& q);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q, N> inverse(qua<T, Q, N> const& q);
|
||||
|
||||
/// Returns true if x holds a NaN (not a number)
|
||||
/// representation in the underlying implementation's set of
|
||||
@@ -115,8 +115,8 @@ namespace glm
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL vec<4, bool, Q> isnan(qua<T, Q> const& x);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL vec<4, bool, Q> isnan(qua<T, Q, N> const& x);
|
||||
|
||||
/// Returns true if x holds a positive infinity or negative
|
||||
/// infinity representation in the underlying implementation's
|
||||
@@ -126,8 +126,8 @@ namespace glm
|
||||
///
|
||||
/// @tparam T A floating-point scalar type
|
||||
/// @tparam Q A value from qualifier enum
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL vec<4, bool, Q> isinf(qua<T, Q> const& x);
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_DECL vec<4, bool, Q> isinf(qua<T, Q, N> const& x);
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace glm
|
||||
{
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> mix(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N> mix(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mix' only accept floating-point inputs");
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace glm
|
||||
if(cosTheta > static_cast<T>(1) - epsilon<T>())
|
||||
{
|
||||
// Linear interpolation
|
||||
return qua<T, Q>::wxyz(
|
||||
return qua<T, Q, N>::wxyz(
|
||||
mix(x.w, y.w, a),
|
||||
mix(x.x, y.x, a),
|
||||
mix(x.y, y.y, a),
|
||||
@@ -25,8 +25,8 @@ namespace glm
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> lerp(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> lerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'lerp' only accept floating-point inputs");
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace glm
|
||||
return x * (static_cast<T>(1) - a) + (y * a);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N> slerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
|
||||
qua<T, Q> z = y;
|
||||
qua<T, Q, N> z = y;
|
||||
|
||||
T cosTheta = dot(x, y);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace glm
|
||||
if(cosTheta > static_cast<T>(1) - epsilon<T>())
|
||||
{
|
||||
// Linear interpolation
|
||||
return qua<T, Q>::wxyz(
|
||||
return qua<T, Q, N>::wxyz(
|
||||
mix(x.w, z.w, a),
|
||||
mix(x.x, z.x, a),
|
||||
mix(x.y, z.y, a),
|
||||
@@ -72,13 +72,13 @@ namespace glm
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename S, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a, S k)
|
||||
template<typename T, typename S, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q, N> slerp(qua<T, Q, N> const& x, qua<T, Q, N> const& y, T a, S k)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<S>::is_integer, "'slerp' only accept integer for spin count");
|
||||
|
||||
qua<T, Q> z = y;
|
||||
qua<T, Q, N> z = y;
|
||||
|
||||
T cosTheta = dot(x, y);
|
||||
|
||||
@@ -109,28 +109,28 @@ namespace glm
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> conjugate(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> conjugate(qua<T, Q, N> const& q)
|
||||
{
|
||||
return qua<T, Q>::wxyz(q.w, -q.x, -q.y, -q.z);
|
||||
return qua<T, Q, N>::wxyz(q.w, -q.x, -q.y, -q.z);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> inverse(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q, N> inverse(qua<T, Q, N> const& q)
|
||||
{
|
||||
return conjugate(q) / dot(q, q);
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua<T, Q, N> const& q)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
|
||||
|
||||
return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua<T, Q> const& q)
|
||||
template<typename T, qualifier Q, std::size_t N>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua<T, Q, N> const& q)
|
||||
{
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
|
||||
|
||||
|
||||
@@ -31,8 +31,19 @@ namespace glm
|
||||
/// @addtogroup ext_quaternion_double
|
||||
/// @{
|
||||
|
||||
/// Quaternion of aligned double-precision floating-point numbers.
|
||||
typedef qua<double, defaultp, sizeof(double) * 4> aligned_dquat;
|
||||
|
||||
/// Quaternion of packed double-precision floating-point numbers.
|
||||
typedef qua<double, defaultp> packed_dquat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
/// Quaternion of double-precision floating-point numbers.
|
||||
typedef qua<double, defaultp> dquat;
|
||||
typedef aligned_dquat dquat;
|
||||
#else
|
||||
/// Quaternion of double-precision floating-point numbers.
|
||||
typedef packed_dquat dquat;
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
@@ -44,3 +55,16 @@ static_assert(std::is_trivially_copy_assignable<glm::dquat>::value);
|
||||
static_assert(std::is_trivially_copyable<glm::dquat>::value);
|
||||
static_assert(std::is_copy_constructible<glm::dquat>::value);
|
||||
static_assert(glm::dquat::length() == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_dquat) == 32);
|
||||
static_assert(alignof(glm::aligned_dquat) == 32);
|
||||
static_assert(sizeof(glm::packed_dquat) == 32);
|
||||
// static_assert(alignof(glm::packed_dquat) == 8); FIXME
|
||||
|
||||
static_assert(sizeof(glm::dquat) == 32);
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
static_assert(alignof(glm::dquat) == 32);
|
||||
#else
|
||||
static_assert(alignof(glm::dquat) == 8);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,20 +22,67 @@ namespace glm
|
||||
/// @addtogroup ext_quaternion_double_precision
|
||||
/// @{
|
||||
|
||||
/// Quaternion of aligned double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, highp, sizeof(double) * 4> aligned_highp_dquat;
|
||||
|
||||
/// Quaternion of packed double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, highp> packed_highp_dquat;
|
||||
|
||||
/// Quaternion of aligned double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, mediump, sizeof(double) * 4> aligned_mediump_dquat;
|
||||
|
||||
/// Quaternion of packed double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, mediump> packed_mediump_dquat;
|
||||
|
||||
/// Quaternion of aligned double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, lowp, sizeof(double) * 4> aligned_lowp_dquat;
|
||||
|
||||
/// Quaternion of packed double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, lowp> packed_lowp_dquat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
/// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, lowp> lowp_dquat;
|
||||
typedef aligned_highp_dquat highp_dquat;
|
||||
|
||||
/// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
/// Quaternion of double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, mediump> mediump_dquat;
|
||||
|
||||
/// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef aligned_mediump_dquat mediump_dquat;
|
||||
|
||||
/// Quaternion of double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef qua<double, highp> highp_dquat;
|
||||
typedef aligned_lowp_dquat lowp_dquat;
|
||||
#else
|
||||
/// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef packed_highp_dquat highp_dquat;
|
||||
|
||||
/// Quaternion of double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef packed_mediump_dquat mediump_dquat;
|
||||
|
||||
/// Quaternion of double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_double_precision
|
||||
typedef packed_lowp_dquat lowp_dquat;
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
@@ -57,3 +104,31 @@ static_assert(std::is_copy_constructible<glm::highp_dquat>::value);
|
||||
static_assert(glm::lowp_dquat::length() == 4);
|
||||
static_assert(glm::mediump_dquat::length() == 4);
|
||||
static_assert(glm::highp_dquat::length() == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_highp_dquat) == 32);
|
||||
static_assert(alignof(glm::aligned_highp_dquat) == 32);
|
||||
static_assert(sizeof(glm::packed_highp_dquat) == 32);
|
||||
static_assert(alignof(glm::packed_highp_dquat) == 8);
|
||||
|
||||
static_assert(sizeof(glm::aligned_mediump_dquat) == 32);
|
||||
static_assert(alignof(glm::aligned_mediump_dquat) == 32);
|
||||
static_assert(sizeof(glm::packed_mediump_dquat) == 32);
|
||||
static_assert(alignof(glm::packed_mediump_dquat) == 8);
|
||||
|
||||
static_assert(sizeof(glm::aligned_lowp_dquat) == 32);
|
||||
static_assert(alignof(glm::aligned_lowp_dquat) == 32);
|
||||
static_assert(sizeof(glm::packed_lowp_dquat) == 32);
|
||||
static_assert(alignof(glm::packed_lowp_dquat) == 8);
|
||||
|
||||
static_assert(sizeof(glm::highp_dquat) == 32);
|
||||
static_assert(sizeof(glm::mediump_dquat) == 32);
|
||||
static_assert(sizeof(glm::lowp_dquat) == 32);
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
static_assert(alignof(glm::highp_dquat) == 32);
|
||||
static_assert(alignof(glm::mediump_dquat) == 32);
|
||||
static_assert(alignof(glm::lowp_dquat) == 32);
|
||||
#else
|
||||
static_assert(alignof(glm::highp_dquat) == 8);
|
||||
static_assert(alignof(glm::mediump_dquat) == 8);
|
||||
static_assert(alignof(glm::lowp_dquat) == 8);
|
||||
#endif
|
||||
|
||||
@@ -31,8 +31,19 @@ namespace glm
|
||||
/// @addtogroup ext_quaternion_float
|
||||
/// @{
|
||||
|
||||
/// Quaternion of aligned single-precision floating-point numbers.
|
||||
typedef qua<float, defaultp, sizeof(float) * 4> aligned_quat;
|
||||
|
||||
/// Quaternion of packed single-precision floating-point numbers.
|
||||
typedef qua<float, defaultp> packed_quat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
/// Quaternion of single-precision floating-point numbers.
|
||||
typedef qua<float, defaultp> quat;
|
||||
typedef aligned_quat quat;
|
||||
#else
|
||||
/// Quaternion of single-precision floating-point numbers.
|
||||
typedef packed_quat quat;
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
@@ -44,3 +55,15 @@ static_assert(std::is_trivially_copy_assignable<glm::quat>::value);
|
||||
static_assert(std::is_trivially_copyable<glm::quat>::value);
|
||||
static_assert(std::is_copy_constructible<glm::quat>::value);
|
||||
static_assert(glm::quat::length() == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_quat) == 16);
|
||||
static_assert(alignof(glm::aligned_quat) == 16);
|
||||
static_assert(sizeof(glm::packed_quat) == 16);
|
||||
// static_assert(alignof(glm::packed_quat) == 4); FIXME
|
||||
|
||||
static_assert(sizeof(glm::quat) == 16);
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
static_assert(alignof(glm::quat) == 16);
|
||||
#else
|
||||
static_assert(alignof(glm::quat) == 4);
|
||||
#endif
|
||||
|
||||
@@ -22,14 +22,67 @@ namespace glm
|
||||
/// @addtogroup ext_quaternion_float_precision
|
||||
/// @{
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<float, lowp> lowp_quat;
|
||||
/// Quaternion of aligned single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, highp, sizeof(float) * 4> aligned_highp_quat;
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<float, mediump> mediump_quat;
|
||||
/// Quaternion of packed single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, highp> packed_highp_quat;
|
||||
|
||||
/// Quaternion of aligned single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, mediump, sizeof(float) * 4> aligned_mediump_quat;
|
||||
|
||||
/// Quaternion of packed single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, mediump> packed_mediump_quat;
|
||||
|
||||
/// Quaternion of aligned single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, lowp, sizeof(float) * 4> aligned_lowp_quat;
|
||||
|
||||
/// Quaternion of packed single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef qua<float, lowp> packed_lowp_quat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
/// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<float, highp> highp_quat;
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef aligned_highp_quat highp_quat;
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef aligned_mediump_quat mediump_quat;
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef aligned_lowp_quat lowp_quat;
|
||||
#else
|
||||
/// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef packed_highp_quat highp_quat;
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef packed_mediump_quat mediump_quat;
|
||||
|
||||
/// Quaternion of single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
///
|
||||
/// @see ext_quaternion_float_precision
|
||||
typedef packed_lowp_quat lowp_quat;
|
||||
#endif
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
@@ -51,3 +104,32 @@ static_assert(std::is_copy_constructible<glm::highp_quat>::value);
|
||||
static_assert(glm::lowp_quat::length() == 4);
|
||||
static_assert(glm::mediump_quat::length() == 4);
|
||||
static_assert(glm::highp_quat::length() == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_highp_quat) == 16);
|
||||
static_assert(alignof(glm::aligned_highp_quat) == 16);
|
||||
static_assert(sizeof(glm::packed_highp_quat) == 16);
|
||||
static_assert(alignof(glm::packed_highp_quat) == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_mediump_quat) == 16);
|
||||
static_assert(alignof(glm::aligned_mediump_quat) == 16);
|
||||
static_assert(sizeof(glm::packed_mediump_quat) == 16);
|
||||
static_assert(alignof(glm::packed_mediump_quat) == 4);
|
||||
|
||||
static_assert(sizeof(glm::aligned_lowp_quat) == 16);
|
||||
static_assert(alignof(glm::aligned_lowp_quat) == 16);
|
||||
static_assert(sizeof(glm::packed_lowp_quat) == 16);
|
||||
static_assert(alignof(glm::packed_lowp_quat) == 4);
|
||||
|
||||
static_assert(sizeof(glm::highp_quat) == 16);
|
||||
static_assert(sizeof(glm::mediump_quat) == 16);
|
||||
static_assert(sizeof(glm::lowp_quat) == 16);
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
static_assert(alignof(glm::highp_quat) == 16);
|
||||
static_assert(alignof(glm::mediump_quat) == 16);
|
||||
static_assert(alignof(glm::lowp_quat) == 16);
|
||||
#else
|
||||
static_assert(alignof(glm::highp_quat) == 4);
|
||||
static_assert(alignof(glm::mediump_quat) == 4);
|
||||
static_assert(alignof(glm::lowp_quat) == 4);
|
||||
#endif
|
||||
|
||||
|
||||
117
glm/fwd.hpp
117
glm/fwd.hpp
@@ -1192,30 +1192,103 @@ namespace glm
|
||||
|
||||
// Quaternion
|
||||
|
||||
typedef qua<float, lowp> lowp_quat;
|
||||
typedef qua<float, mediump> mediump_quat;
|
||||
typedef qua<float, highp> highp_quat;
|
||||
typedef qua<float, defaultp> quat;
|
||||
typedef qua<float, lowp, sizeof(float) * 4> aligned_lowp_quat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> aligned_mediump_quat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> aligned_highp_quat;
|
||||
|
||||
typedef qua<float, lowp> lowp_fquat;
|
||||
typedef qua<float, mediump> mediump_fquat;
|
||||
typedef qua<float, highp> highp_fquat;
|
||||
typedef qua<float, defaultp> fquat;
|
||||
typedef qua<float, lowp> packed_lowp_quat;
|
||||
typedef qua<float, mediump> packed_mediump_quat;
|
||||
typedef qua<float, highp> packed_highp_quat;
|
||||
|
||||
typedef qua<f32, lowp> lowp_f32quat;
|
||||
typedef qua<f32, mediump> mediump_f32quat;
|
||||
typedef qua<f32, highp> highp_f32quat;
|
||||
typedef qua<f32, defaultp> f32quat;
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
typedef qua<float, lowp, sizeof(float) * 4> lowp_quat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> mediump_quat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> highp_quat;
|
||||
typedef qua<float, defaultp, sizeof(float) * 4> quat;
|
||||
#else
|
||||
typedef qua<float, lowp> lowp_quat;
|
||||
typedef qua<float, mediump> mediump_quat;
|
||||
typedef qua<float, highp> highp_quat;
|
||||
typedef qua<float, defaultp> quat;
|
||||
#endif
|
||||
|
||||
typedef qua<double, lowp> lowp_dquat;
|
||||
typedef qua<double, mediump> mediump_dquat;
|
||||
typedef qua<double, highp> highp_dquat;
|
||||
typedef qua<double, defaultp> dquat;
|
||||
typedef qua<float, lowp, sizeof(float) * 4> aligned_lowp_fquat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> aligned_mediump_fquat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> aligned_highp_fquat;
|
||||
|
||||
typedef qua<f64, lowp> lowp_f64quat;
|
||||
typedef qua<f64, mediump> mediump_f64quat;
|
||||
typedef qua<f64, highp> highp_f64quat;
|
||||
typedef qua<f64, defaultp> f64quat;
|
||||
typedef qua<float, lowp> packed_lowp_fquat;
|
||||
typedef qua<float, mediump> packed_mediump_fquat;
|
||||
typedef qua<float, highp> packed_highp_fquat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
typedef qua<float, lowp, sizeof(float) * 4> lowp_fquat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> mediump_fquat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> highp_fquat;
|
||||
typedef qua<float, defaultp, sizeof(float) * 4> fquat;
|
||||
#else
|
||||
typedef qua<float, lowp> lowp_fquat;
|
||||
typedef qua<float, mediump> mediump_fquat;
|
||||
typedef qua<float, highp> highp_fquat;
|
||||
typedef qua<float, defaultp> fquat;
|
||||
#endif
|
||||
|
||||
typedef qua<double, lowp, sizeof(double) * 4> aligned_lowp_dquat;
|
||||
typedef qua<double, mediump, sizeof(double) * 4> aligned_mediump_dquat;
|
||||
typedef qua<double, highp, sizeof(double) * 4> aligned_highp_dquat;
|
||||
|
||||
typedef qua<double, lowp> packed_lowp_dquat;
|
||||
typedef qua<double, mediump> packed_mediump_dquat;
|
||||
typedef qua<double, highp> packed_highp_dquat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
typedef qua<double, lowp, sizeof(double) * 4> lowp_dquat;
|
||||
typedef qua<double, mediump, sizeof(double) * 4> mediump_dquat;
|
||||
typedef qua<double, highp, sizeof(double) * 4> highp_dquat;
|
||||
typedef qua<double, defaultp, sizeof(double) * 4> dquat;
|
||||
#else
|
||||
typedef qua<double, lowp> lowp_dquat;
|
||||
typedef qua<double, mediump> mediump_dquat;
|
||||
typedef qua<double, highp> highp_dquat;
|
||||
typedef qua<double, defaultp> dquat;
|
||||
#endif
|
||||
|
||||
typedef qua<float, lowp, sizeof(float) * 4> aligned_lowp_f32quat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> aligned_mediump_f32quat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> aligned_highp_f32quat;
|
||||
|
||||
typedef qua<float, lowp> packed_lowp_f32quat;
|
||||
typedef qua<float, mediump> packed_mediump_f32quat;
|
||||
typedef qua<float, highp> packed_highp_f32quat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
typedef qua<float, lowp, sizeof(float) * 4> lowp_f32quat;
|
||||
typedef qua<float, mediump, sizeof(float) * 4> mediump_f32quat;
|
||||
typedef qua<float, highp, sizeof(float) * 4> highp_f32quat;
|
||||
typedef qua<float, defaultp, sizeof(float) * 4> f32quat;
|
||||
#else
|
||||
typedef qua<float, lowp> lowp_f32quat;
|
||||
typedef qua<float, mediump> mediump_f32quat;
|
||||
typedef qua<float, highp> highp_f32quat;
|
||||
typedef qua<float, defaultp> f32quat;
|
||||
#endif
|
||||
|
||||
typedef qua<double, lowp, sizeof(double) * 4> aligned_lowp_f64quat;
|
||||
typedef qua<double, mediump, sizeof(double) * 4> aligned_mediump_f64quat;
|
||||
typedef qua<double, highp, sizeof(double) * 4> aligned_highp_f64quat;
|
||||
|
||||
typedef qua<double, lowp> packed_lowp_f64quat;
|
||||
typedef qua<double, mediump> packed_mediump_f64quat;
|
||||
typedef qua<double, highp> packed_highp_f64quat;
|
||||
|
||||
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
typedef qua<double, lowp, sizeof(double) * 4> lowp_f64quat;
|
||||
typedef qua<double, mediump, sizeof(double) * 4> mediump_f64quat;
|
||||
typedef qua<double, highp, sizeof(double) * 4> highp_f64quat;
|
||||
typedef qua<double, defaultp, sizeof(double) * 4> f64quat;
|
||||
#else
|
||||
typedef qua<double, lowp> lowp_f64quat;
|
||||
typedef qua<double, mediump> mediump_f64quat;
|
||||
typedef qua<double, highp> highp_f64quat;
|
||||
typedef qua<double, defaultp> f64quat;
|
||||
#endif
|
||||
}//namespace glm
|
||||
|
||||
|
||||
|
||||
@@ -864,123 +864,8 @@ namespace glm
|
||||
/// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4;
|
||||
|
||||
// -- *quat --
|
||||
|
||||
/// quaternion aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<float, aligned_highp> aligned_highp_quat;
|
||||
|
||||
/// quaternion aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
typedef qua<float, aligned_mediump> aligned_mediump_quat;
|
||||
|
||||
/// quaternion aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
typedef qua<float, aligned_lowp> aligned_lowp_quat;
|
||||
|
||||
/// quaternion aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<double, aligned_highp> aligned_highp_dquat;
|
||||
|
||||
/// quaternion aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
typedef qua<double, aligned_mediump> aligned_mediump_dquat;
|
||||
|
||||
/// quaternion aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
typedef qua<double, aligned_lowp> aligned_lowp_dquat;
|
||||
|
||||
/// quaternion tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<float, packed_highp> packed_highp_quat;
|
||||
|
||||
/// quaternion tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
typedef qua<float, packed_mediump> packed_mediump_quat;
|
||||
|
||||
/// quaternion tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
typedef qua<float, packed_lowp> packed_lowp_quat;
|
||||
|
||||
/// quaternion tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs.
|
||||
typedef qua<double, packed_highp> packed_highp_dquat;
|
||||
|
||||
/// quaternion tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs.
|
||||
typedef qua<double, packed_mediump> packed_mediump_dquat;
|
||||
|
||||
/// quaternion tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs.
|
||||
typedef qua<double, packed_lowp> packed_lowp_dquat;
|
||||
|
||||
// -- default --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef aligned_lowp_vec1 aligned_vec1;
|
||||
typedef aligned_lowp_vec2 aligned_vec2;
|
||||
typedef aligned_lowp_vec3 aligned_vec3;
|
||||
typedef aligned_lowp_vec4 aligned_vec4;
|
||||
typedef packed_lowp_vec1 packed_vec1;
|
||||
typedef packed_lowp_vec2 packed_vec2;
|
||||
typedef packed_lowp_vec3 packed_vec3;
|
||||
typedef packed_lowp_vec4 packed_vec4;
|
||||
|
||||
typedef aligned_lowp_mat2 aligned_mat2;
|
||||
typedef aligned_lowp_mat3 aligned_mat3;
|
||||
typedef aligned_lowp_mat4 aligned_mat4;
|
||||
typedef packed_lowp_mat2 packed_mat2;
|
||||
typedef packed_lowp_mat3 packed_mat3;
|
||||
typedef packed_lowp_mat4 packed_mat4;
|
||||
|
||||
typedef aligned_lowp_mat2x2 aligned_mat2x2;
|
||||
typedef aligned_lowp_mat2x3 aligned_mat2x3;
|
||||
typedef aligned_lowp_mat2x4 aligned_mat2x4;
|
||||
typedef aligned_lowp_mat3x2 aligned_mat3x2;
|
||||
typedef aligned_lowp_mat3x3 aligned_mat3x3;
|
||||
typedef aligned_lowp_mat3x4 aligned_mat3x4;
|
||||
typedef aligned_lowp_mat4x2 aligned_mat4x2;
|
||||
typedef aligned_lowp_mat4x3 aligned_mat4x3;
|
||||
typedef aligned_lowp_mat4x4 aligned_mat4x4;
|
||||
typedef packed_lowp_mat2x2 packed_mat2x2;
|
||||
typedef packed_lowp_mat2x3 packed_mat2x3;
|
||||
typedef packed_lowp_mat2x4 packed_mat2x4;
|
||||
typedef packed_lowp_mat3x2 packed_mat3x2;
|
||||
typedef packed_lowp_mat3x3 packed_mat3x3;
|
||||
typedef packed_lowp_mat3x4 packed_mat3x4;
|
||||
typedef packed_lowp_mat4x2 packed_mat4x2;
|
||||
typedef packed_lowp_mat4x3 packed_mat4x3;
|
||||
typedef packed_lowp_mat4x4 packed_mat4x4;
|
||||
|
||||
typedef aligned_lowp_quat aligned_quat;
|
||||
typedef packed_lowp_quat packed_quat;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef aligned_mediump_vec1 aligned_vec1;
|
||||
typedef aligned_mediump_vec2 aligned_vec2;
|
||||
typedef aligned_mediump_vec3 aligned_vec3;
|
||||
typedef aligned_mediump_vec4 aligned_vec4;
|
||||
typedef packed_mediump_vec1 packed_vec1;
|
||||
typedef packed_mediump_vec2 packed_vec2;
|
||||
typedef packed_mediump_vec3 packed_vec3;
|
||||
typedef packed_mediump_vec4 packed_vec4;
|
||||
|
||||
typedef aligned_mediump_mat2 aligned_mat2;
|
||||
typedef aligned_mediump_mat3 aligned_mat3;
|
||||
typedef aligned_mediump_mat4 aligned_mat4;
|
||||
typedef packed_mediump_mat2 packed_mat2;
|
||||
typedef packed_mediump_mat3 packed_mat3;
|
||||
typedef packed_mediump_mat4 packed_mat4;
|
||||
|
||||
typedef aligned_mediump_mat2x2 aligned_mat2x2;
|
||||
typedef aligned_mediump_mat2x3 aligned_mat2x3;
|
||||
typedef aligned_mediump_mat2x4 aligned_mat2x4;
|
||||
typedef aligned_mediump_mat3x2 aligned_mat3x2;
|
||||
typedef aligned_mediump_mat3x3 aligned_mat3x3;
|
||||
typedef aligned_mediump_mat3x4 aligned_mat3x4;
|
||||
typedef aligned_mediump_mat4x2 aligned_mat4x2;
|
||||
typedef aligned_mediump_mat4x3 aligned_mat4x3;
|
||||
typedef aligned_mediump_mat4x4 aligned_mat4x4;
|
||||
typedef packed_mediump_mat2x2 packed_mat2x2;
|
||||
typedef packed_mediump_mat2x3 packed_mat2x3;
|
||||
typedef packed_mediump_mat2x4 packed_mat2x4;
|
||||
typedef packed_mediump_mat3x2 packed_mat3x2;
|
||||
typedef packed_mediump_mat3x3 packed_mat3x3;
|
||||
typedef packed_mediump_mat3x4 packed_mat3x4;
|
||||
typedef packed_mediump_mat4x2 packed_mat4x2;
|
||||
typedef packed_mediump_mat4x3 packed_mat4x3;
|
||||
typedef packed_mediump_mat4x4 packed_mat4x4;
|
||||
|
||||
typedef aligned_mediump_quat aligned_quat;
|
||||
typedef packed_mediump_quat packed_quat;
|
||||
#else //defined(GLM_PRECISION_HIGHP_FLOAT)
|
||||
/// 1 component vector aligned in memory of single-precision floating-point numbers.
|
||||
typedef aligned_highp_vec1 aligned_vec1;
|
||||
|
||||
@@ -1077,90 +962,6 @@ namespace glm
|
||||
/// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers.
|
||||
typedef packed_highp_mat4x4 packed_mat4x4;
|
||||
|
||||
/// quaternion tightly aligned in memory of single-precision floating-point numbers.
|
||||
typedef aligned_highp_quat aligned_quat;
|
||||
|
||||
/// quaternion tightly packed in memory of single-precision floating-point numbers.
|
||||
typedef packed_highp_quat packed_quat;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
|
||||
typedef aligned_lowp_dvec1 aligned_dvec1;
|
||||
typedef aligned_lowp_dvec2 aligned_dvec2;
|
||||
typedef aligned_lowp_dvec3 aligned_dvec3;
|
||||
typedef aligned_lowp_dvec4 aligned_dvec4;
|
||||
typedef packed_lowp_dvec1 packed_dvec1;
|
||||
typedef packed_lowp_dvec2 packed_dvec2;
|
||||
typedef packed_lowp_dvec3 packed_dvec3;
|
||||
typedef packed_lowp_dvec4 packed_dvec4;
|
||||
|
||||
typedef aligned_lowp_dmat2 aligned_dmat2;
|
||||
typedef aligned_lowp_dmat3 aligned_dmat3;
|
||||
typedef aligned_lowp_dmat4 aligned_dmat4;
|
||||
typedef packed_lowp_dmat2 packed_dmat2;
|
||||
typedef packed_lowp_dmat3 packed_dmat3;
|
||||
typedef packed_lowp_dmat4 packed_dmat4;
|
||||
|
||||
typedef aligned_lowp_dmat2x2 aligned_dmat2x2;
|
||||
typedef aligned_lowp_dmat2x3 aligned_dmat2x3;
|
||||
typedef aligned_lowp_dmat2x4 aligned_dmat2x4;
|
||||
typedef aligned_lowp_dmat3x2 aligned_dmat3x2;
|
||||
typedef aligned_lowp_dmat3x3 aligned_dmat3x3;
|
||||
typedef aligned_lowp_dmat3x4 aligned_dmat3x4;
|
||||
typedef aligned_lowp_dmat4x2 aligned_dmat4x2;
|
||||
typedef aligned_lowp_dmat4x3 aligned_dmat4x3;
|
||||
typedef aligned_lowp_dmat4x4 aligned_dmat4x4;
|
||||
typedef packed_lowp_dmat2x2 packed_dmat2x2;
|
||||
typedef packed_lowp_dmat2x3 packed_dmat2x3;
|
||||
typedef packed_lowp_dmat2x4 packed_dmat2x4;
|
||||
typedef packed_lowp_dmat3x2 packed_dmat3x2;
|
||||
typedef packed_lowp_dmat3x3 packed_dmat3x3;
|
||||
typedef packed_lowp_dmat3x4 packed_dmat3x4;
|
||||
typedef packed_lowp_dmat4x2 packed_dmat4x2;
|
||||
typedef packed_lowp_dmat4x3 packed_dmat4x3;
|
||||
typedef packed_lowp_dmat4x4 packed_dmat4x4;
|
||||
|
||||
typedef aligned_lowp_dquat aligned_dquat;
|
||||
typedef packed_lowp_dquat packed_dquat;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
|
||||
typedef aligned_mediump_dvec1 aligned_dvec1;
|
||||
typedef aligned_mediump_dvec2 aligned_dvec2;
|
||||
typedef aligned_mediump_dvec3 aligned_dvec3;
|
||||
typedef aligned_mediump_dvec4 aligned_dvec4;
|
||||
typedef packed_mediump_dvec1 packed_dvec1;
|
||||
typedef packed_mediump_dvec2 packed_dvec2;
|
||||
typedef packed_mediump_dvec3 packed_dvec3;
|
||||
typedef packed_mediump_dvec4 packed_dvec4;
|
||||
|
||||
typedef aligned_mediump_dmat2 aligned_dmat2;
|
||||
typedef aligned_mediump_dmat3 aligned_dmat3;
|
||||
typedef aligned_mediump_dmat4 aligned_dmat4;
|
||||
typedef packed_mediump_dmat2 packed_dmat2;
|
||||
typedef packed_mediump_dmat3 packed_dmat3;
|
||||
typedef packed_mediump_dmat4 packed_dmat4;
|
||||
|
||||
typedef aligned_mediump_dmat2x2 aligned_dmat2x2;
|
||||
typedef aligned_mediump_dmat2x3 aligned_dmat2x3;
|
||||
typedef aligned_mediump_dmat2x4 aligned_dmat2x4;
|
||||
typedef aligned_mediump_dmat3x2 aligned_dmat3x2;
|
||||
typedef aligned_mediump_dmat3x3 aligned_dmat3x3;
|
||||
typedef aligned_mediump_dmat3x4 aligned_dmat3x4;
|
||||
typedef aligned_mediump_dmat4x2 aligned_dmat4x2;
|
||||
typedef aligned_mediump_dmat4x3 aligned_dmat4x3;
|
||||
typedef aligned_mediump_dmat4x4 aligned_dmat4x4;
|
||||
typedef packed_mediump_dmat2x2 packed_dmat2x2;
|
||||
typedef packed_mediump_dmat2x3 packed_dmat2x3;
|
||||
typedef packed_mediump_dmat2x4 packed_dmat2x4;
|
||||
typedef packed_mediump_dmat3x2 packed_dmat3x2;
|
||||
typedef packed_mediump_dmat3x3 packed_dmat3x3;
|
||||
typedef packed_mediump_dmat3x4 packed_dmat3x4;
|
||||
typedef packed_mediump_dmat4x2 packed_dmat4x2;
|
||||
typedef packed_mediump_dmat4x3 packed_dmat4x3;
|
||||
typedef packed_mediump_dmat4x4 packed_dmat4x4;
|
||||
|
||||
typedef aligned_mediump_dquat aligned_dquat;
|
||||
typedef packed_mediump_dquat packed_dquat;
|
||||
#else //defined(GLM_PRECISION_HIGHP_DOUBLE)
|
||||
/// 1 component vector aligned in memory of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dvec1 aligned_dvec1;
|
||||
|
||||
@@ -1257,24 +1058,8 @@ namespace glm
|
||||
/// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers.
|
||||
typedef packed_highp_dmat4x4 packed_dmat4x4;
|
||||
|
||||
/// quaternion tightly aligned in memory of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dquat aligned_dquat;
|
||||
// -- Signed integer definition --
|
||||
|
||||
/// quaternion tightly packed in memory of double-precision floating-point numbers.
|
||||
typedef packed_highp_dquat packed_dquat;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef aligned_lowp_ivec1 aligned_ivec1;
|
||||
typedef aligned_lowp_ivec2 aligned_ivec2;
|
||||
typedef aligned_lowp_ivec3 aligned_ivec3;
|
||||
typedef aligned_lowp_ivec4 aligned_ivec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef aligned_mediump_ivec1 aligned_ivec1;
|
||||
typedef aligned_mediump_ivec2 aligned_ivec2;
|
||||
typedef aligned_mediump_ivec3 aligned_ivec3;
|
||||
typedef aligned_mediump_ivec4 aligned_ivec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_INT)
|
||||
/// 1 component vector aligned in memory of signed integer numbers.
|
||||
typedef aligned_highp_ivec1 aligned_ivec1;
|
||||
|
||||
@@ -1298,21 +1083,9 @@ namespace glm
|
||||
|
||||
/// 4 components vector tightly packed in memory of signed integer numbers.
|
||||
typedef packed_highp_ivec4 packed_ivec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
// -- Unsigned integer definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef aligned_lowp_uvec1 aligned_uvec1;
|
||||
typedef aligned_lowp_uvec2 aligned_uvec2;
|
||||
typedef aligned_lowp_uvec3 aligned_uvec3;
|
||||
typedef aligned_lowp_uvec4 aligned_uvec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef aligned_mediump_uvec1 aligned_uvec1;
|
||||
typedef aligned_mediump_uvec2 aligned_uvec2;
|
||||
typedef aligned_mediump_uvec3 aligned_uvec3;
|
||||
typedef aligned_mediump_uvec4 aligned_uvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_UINT)
|
||||
/// 1 component vector aligned in memory of unsigned integer numbers.
|
||||
typedef aligned_highp_uvec1 aligned_uvec1;
|
||||
|
||||
@@ -1336,19 +1109,9 @@ namespace glm
|
||||
|
||||
/// 4 components vector tightly packed in memory of unsigned integer numbers.
|
||||
typedef packed_highp_uvec4 packed_uvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_BOOL))
|
||||
typedef aligned_lowp_bvec1 aligned_bvec1;
|
||||
typedef aligned_lowp_bvec2 aligned_bvec2;
|
||||
typedef aligned_lowp_bvec3 aligned_bvec3;
|
||||
typedef aligned_lowp_bvec4 aligned_bvec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_BOOL))
|
||||
typedef aligned_mediump_bvec1 aligned_bvec1;
|
||||
typedef aligned_mediump_bvec2 aligned_bvec2;
|
||||
typedef aligned_mediump_bvec3 aligned_bvec3;
|
||||
typedef aligned_mediump_bvec4 aligned_bvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_BOOL)
|
||||
// -- Boolean definition --
|
||||
|
||||
/// 1 component vector aligned in memory of bool values.
|
||||
typedef aligned_highp_bvec1 aligned_bvec1;
|
||||
|
||||
@@ -1372,7 +1135,6 @@ namespace glm
|
||||
|
||||
/// 4 components vector tightly packed in memory of bool values.
|
||||
typedef packed_highp_bvec4 packed_bvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
@@ -25,215 +25,11 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
///////////////////////////
|
||||
// Signed int vector types
|
||||
|
||||
/// @addtogroup gtx_type_aligned
|
||||
/// @{
|
||||
|
||||
/// Low qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1);
|
||||
|
||||
/// Low qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2);
|
||||
|
||||
/// Low qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4);
|
||||
|
||||
/// Low qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8);
|
||||
|
||||
|
||||
/// Low qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1);
|
||||
|
||||
/// Low qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2);
|
||||
|
||||
/// Low qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4);
|
||||
|
||||
/// Low qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8);
|
||||
|
||||
|
||||
/// Low qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1);
|
||||
|
||||
/// Low qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2);
|
||||
|
||||
/// Low qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4);
|
||||
|
||||
/// Low qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1);
|
||||
|
||||
/// Medium qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2);
|
||||
|
||||
/// Medium qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4);
|
||||
|
||||
/// Medium qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1);
|
||||
|
||||
/// Medium qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2);
|
||||
|
||||
/// Medium qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4);
|
||||
|
||||
/// Medium qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1);
|
||||
|
||||
/// Medium qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2);
|
||||
|
||||
/// Medium qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4);
|
||||
|
||||
/// Medium qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1);
|
||||
|
||||
/// High qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2);
|
||||
|
||||
/// High qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4);
|
||||
|
||||
/// High qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1);
|
||||
|
||||
/// High qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2);
|
||||
|
||||
/// High qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4);
|
||||
|
||||
/// High qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1);
|
||||
|
||||
/// High qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2);
|
||||
|
||||
/// High qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4);
|
||||
|
||||
/// High qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1);
|
||||
|
||||
/// Default qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2);
|
||||
|
||||
/// Default qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4);
|
||||
|
||||
/// Default qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1);
|
||||
|
||||
/// Default qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2);
|
||||
|
||||
/// Default qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4);
|
||||
|
||||
/// Default qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1);
|
||||
|
||||
/// Default qualifier 16 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2);
|
||||
|
||||
/// Default qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4);
|
||||
|
||||
/// Default qualifier 64 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8);
|
||||
|
||||
///////////////////////////
|
||||
// Signed int vector types
|
||||
|
||||
/// Default qualifier 32 bit signed integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
@@ -323,210 +119,6 @@ namespace glm
|
||||
/////////////////////////////
|
||||
// Unsigned int vector types
|
||||
|
||||
/// Low qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1);
|
||||
|
||||
/// Low qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2);
|
||||
|
||||
/// Low qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4);
|
||||
|
||||
/// Low qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8);
|
||||
|
||||
|
||||
/// Low qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1);
|
||||
|
||||
/// Low qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2);
|
||||
|
||||
/// Low qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4);
|
||||
|
||||
/// Low qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8);
|
||||
|
||||
|
||||
/// Low qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1);
|
||||
|
||||
/// Low qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2);
|
||||
|
||||
/// Low qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4);
|
||||
|
||||
/// Low qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1);
|
||||
|
||||
/// Medium qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2);
|
||||
|
||||
/// Medium qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4);
|
||||
|
||||
/// Medium qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1);
|
||||
|
||||
/// Medium qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2);
|
||||
|
||||
/// Medium qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4);
|
||||
|
||||
/// Medium qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8);
|
||||
|
||||
|
||||
/// Medium qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1);
|
||||
|
||||
/// Medium qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2);
|
||||
|
||||
/// Medium qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4);
|
||||
|
||||
/// Medium qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1);
|
||||
|
||||
/// High qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2);
|
||||
|
||||
/// High qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4);
|
||||
|
||||
/// High qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1);
|
||||
|
||||
/// High qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2);
|
||||
|
||||
/// High qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4);
|
||||
|
||||
/// High qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8);
|
||||
|
||||
|
||||
/// High qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1);
|
||||
|
||||
/// High qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2);
|
||||
|
||||
/// High qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4);
|
||||
|
||||
/// High qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1);
|
||||
|
||||
/// Default qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2);
|
||||
|
||||
/// Default qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4);
|
||||
|
||||
/// Default qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1);
|
||||
|
||||
/// Default qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2);
|
||||
|
||||
/// Default qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4);
|
||||
|
||||
/// Default qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8);
|
||||
|
||||
|
||||
/// Default qualifier 8 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1);
|
||||
|
||||
/// Default qualifier 16 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2);
|
||||
|
||||
/// Default qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4);
|
||||
|
||||
/// Default qualifier 64 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8);
|
||||
|
||||
|
||||
/// Default qualifier 32 bit unsigned integer aligned scalar type.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4);
|
||||
@@ -944,34 +536,6 @@ namespace glm
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4x4, 32);
|
||||
|
||||
# endif//GLM_FORCE_SINGLE_ONLY
|
||||
|
||||
|
||||
//////////////////////////
|
||||
// Quaternion types
|
||||
|
||||
/// Single-qualifier floating-point aligned quaternion.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(quat, aligned_quat, 16);
|
||||
|
||||
/// Single-qualifier floating-point aligned quaternion.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(quat, aligned_fquat, 16);
|
||||
|
||||
/// Double-qualifier floating-point aligned quaternion.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(dquat, aligned_dquat, 32);
|
||||
|
||||
/// Single-qualifier floating-point aligned quaternion.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(f32quat, aligned_f32quat, 16);
|
||||
|
||||
# ifndef GLM_FORCE_SINGLE_ONLY
|
||||
|
||||
/// Double-qualifier floating-point aligned quaternion.
|
||||
/// @see gtx_type_aligned
|
||||
GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32);
|
||||
|
||||
# endif//GLM_FORCE_SINGLE_ONLY
|
||||
|
||||
/// @}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// @ref gtc_type_aligned
|
||||
/// @ref gtx_type_aligned
|
||||
|
||||
namespace glm
|
||||
{
|
||||
|
||||
@@ -1,10 +1,74 @@
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/ext.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
# if GLM_SILENT_WARNINGS == GLM_ENABLE
|
||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||
# pragma GCC diagnostic ignored "-Wattributes" // for alignas(1), packed types
|
||||
# elif GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
# pragma clang diagnostic ignored "-Wpadded"
|
||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
|
||||
# pragma warning(disable: 4324)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
struct test_packed4 {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
|
||||
struct alignas(sizeof(float) * 4) test_aligned4 {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct test_packed3 {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct alignas(sizeof(float) * 4) test_aligned3 {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
printf("alignof(test_packed4): %d\n", static_cast<int>(alignof(test_packed4)));
|
||||
printf("alignof(test_aligned4): %d\n", static_cast<int>(alignof(test_aligned4)));
|
||||
printf("alignof(test_packed3): %d\n", static_cast<int>(alignof(test_packed3)));
|
||||
printf("alignof(test_aligned3): %d\n", static_cast<int>(alignof(test_aligned3)));
|
||||
|
||||
printf("alignof(packed_quat): %d\n", static_cast<int>(alignof(glm::packed_quat)));
|
||||
printf("alignof(glm::aligned_quat): %d\n", static_cast<int>(alignof(glm::aligned_quat)));
|
||||
printf("alignof(glm::quat): %d\n", static_cast<int>(alignof(glm::quat)));
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
# if GLM_SILENT_WARNINGS == GLM_ENABLE
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
# elif GLM_COMPILER & GLM_COMPILER_GCC
|
||||
# pragma GCC diagnostic pop
|
||||
# elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(pop)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
|
||||
@@ -87,6 +87,16 @@ static int test_precision()
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_align()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
Error += sizeof(glm::lowp_quat) <= sizeof(glm::mediump_quat) ? 0 : 1;
|
||||
Error += sizeof(glm::mediump_quat) <= sizeof(glm::highp_quat) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
@@ -95,6 +105,7 @@ int main()
|
||||
Error += test_two_axis_ctr();
|
||||
Error += test_size();
|
||||
Error += test_precision();
|
||||
Error += test_align();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
#ifndef GLM_FORCE_PURE
|
||||
#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
|
||||
#endif
|
||||
#include <glm/gtc/random.hpp>
|
||||
#include <glm/gtc/epsilon.hpp>
|
||||
#include <glm/gtc/type_precision.hpp>
|
||||
#if GLM_LANG & GLM_LANG_CXX0X_FLAG
|
||||
# include <array>
|
||||
#endif
|
||||
#include <array>
|
||||
|
||||
std::size_t const TestSamples = 10000;
|
||||
|
||||
@@ -324,47 +319,7 @@ static int test_ballRand()
|
||||
|
||||
return Error;
|
||||
}
|
||||
/*
|
||||
#if(GLM_LANG & GLM_LANG_CXX0X_FLAG)
|
||||
int test_grid()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
typedef std::array<int, 8> colors;
|
||||
typedef std::array<int, 8 * 8> grid;
|
||||
|
||||
grid Grid;
|
||||
colors Colors;
|
||||
|
||||
grid GridBest;
|
||||
colors ColorsBest;
|
||||
|
||||
while(true)
|
||||
{
|
||||
for(std::size_t i = 0; i < Grid.size(); ++i)
|
||||
Grid[i] = int(glm::linearRand(0.0, 8.0 * 8.0 * 8.0 - 1.0) / 64.0);
|
||||
|
||||
for(std::size_t i = 0; i < Grid.size(); ++i)
|
||||
++Colors[Grid[i]];
|
||||
|
||||
bool Exit = true;
|
||||
for(std::size_t i = 0; i < Colors.size(); ++i)
|
||||
{
|
||||
if(Colors[i] == 8)
|
||||
continue;
|
||||
|
||||
Exit = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(Exit == true)
|
||||
break;
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
@@ -374,10 +329,6 @@ int main()
|
||||
Error += test_sphericalRand();
|
||||
Error += test_diskRand();
|
||||
Error += test_ballRand();
|
||||
/*
|
||||
#if(GLM_LANG & GLM_LANG_CXX0X_FLAG)
|
||||
Error += test_grid();
|
||||
#endif
|
||||
*/
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user