Commit 338ae906 authored by Nianchen Deng's avatar Nianchen Deng
Browse files

tog'21 baseline

parent f1dd9e3a
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_vec3.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
//#include "../fwd.hpp"
#include "type_vec.hpp"
#ifdef GLM_SWIZZLE
# if GLM_HAS_ANONYMOUS_UNION
# include "_swizzle.hpp"
# else
# include "_swizzle_func.hpp"
# endif
#endif //GLM_SWIZZLE
#include <cstddef>
namespace glm
{
template <typename T, precision P = defaultp>
struct tvec3
{
//////////////////////////////////////
// Implementation detail
typedef tvec3<T, P> type;
typedef tvec3<bool, P> bool_type;
typedef T value_type;
//////////////////////////////////////
// Data
# if GLM_HAS_ANONYMOUS_UNION
union
{
struct{ T x, y, z; };
struct{ T r, g, b; };
struct{ T s, t, p; };
# ifdef GLM_SWIZZLE
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, x, y, z)
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, r, g, b)
_GLM_SWIZZLE3_2_MEMBERS(T, P, tvec2, s, t, p)
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, x, y, z)
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, r, g, b)
_GLM_SWIZZLE3_3_MEMBERS(T, P, tvec3, s, t, p)
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, x, y, z)
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, r, g, b)
_GLM_SWIZZLE3_4_MEMBERS(T, P, tvec4, s, t, p)
# endif//GLM_SWIZZLE
};
# else
union { T x, r, s; };
union { T y, g, t; };
union { T z, b, p; };
# ifdef GLM_SWIZZLE
GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4)
# endif//GLM_SWIZZLE
# endif//GLM_LANG
//////////////////////////////////////
// Component accesses
# ifdef GLM_FORCE_SIZE_FUNC
/// Return the count of components of the vector
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
GLM_FUNC_DECL T & operator[](size_type i);
GLM_FUNC_DECL T const & operator[](size_type i) const;
# else
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec3();
GLM_FUNC_DECL tvec3(tvec3<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec3(tvec3<T, Q> const & v);
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_DECL explicit tvec3(ctor);
GLM_FUNC_DECL explicit tvec3(T const & s);
GLM_FUNC_DECL tvec3(T const & a, T const & b, T const & c);
//////////////////////////////////////
// Conversion scalar constructors
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C>
GLM_FUNC_DECL tvec3(A const & a, B const & b, C const & c);
template <typename A, typename B, typename C>
GLM_FUNC_DECL tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);
//////////////////////////////////////
// Conversion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, B const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(A const & a, tvec2<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec4<U, Q> const & v);
# ifdef GLM_FORCE_EXPLICIT_CTOR
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec3(tvec3<U, Q> const & v);
# else
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL tvec3(tvec3<U, Q> const & v);
# endif
//////////////////////////////////////
// Swizzle constructors
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec3(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & that)
{
*this = that();
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & s)
{
*this = tvec3<T, P>(v(), s);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(T const & s, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec3<T, P>(s, v());
}
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> const & v);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tvec3<T, P> & operator++();
GLM_FUNC_DECL tvec3<T, P> & operator--();
GLM_FUNC_DECL tvec3<T, P> operator++(int);
GLM_FUNC_DECL tvec3<T, P> operator--(int);
//////////////////////////////////////
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(U s);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> const & v);
};
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> const & v);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_vec3.inl"
#endif//GLM_EXTERNAL_TEMPLATE
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_tvec3.inl
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////
// Implicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0)
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, P> const & v)
: x(v.x), y(v.y), z(v.z)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<T, Q> const & v)
: x(v.x), y(v.y), z(v.z)
{}
//////////////////////////////////////
// Explicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(T const & s)
: x(s), y(s), z(s)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(T const & a, T const & b, T const & c)
: x(a), y(b), z(c)
{}
//////////////////////////////////////
// Conversion scalar constructors
template <typename T, precision P>
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, B const & b, C const & c) :
x(static_cast<T>(a)),
y(static_cast<T>(b)),
z(static_cast<T>(c))
{}
template <typename T, precision P>
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c) :
x(static_cast<T>(a)),
y(static_cast<T>(b)),
z(static_cast<T>(c))
{}
//////////////////////////////////////
// Conversion vector constructors
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, B const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(b))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(b.x))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(A const & a, tvec2<B, Q> const & b) :
x(static_cast<T>(a)),
y(static_cast<T>(b.x)),
z(static_cast<T>(b.y))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)),
z(static_cast<T>(b.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec3<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)),
z(static_cast<T>(v.z))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec3<T, P>::tvec3(tvec4<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)),
z(static_cast<T>(v.z))
{}
//////////////////////////////////////
// Component accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::size_type tvec3<T, P>::size() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i)
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::size_type i) const
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T, P>::length_type tvec3<T, P>::length() const
{
return 3;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i)
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec3<T, P>::operator[](typename tvec3<T, P>::length_type i) const
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P>& tvec3<T, P>::operator=(tvec3<U, P> const & v)
{
this->x = static_cast<T>(v.x);
this->y = static_cast<T>(v.y);
this->z = static_cast<T>(v.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(U s)
{
this->x += static_cast<T>(s);
this->y += static_cast<T>(s);
this->z += static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec1<U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.x);
this->z += static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator+=(tvec3<U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.y);
this->z += static_cast<T>(v.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(U s)
{
this->x -= static_cast<T>(s);
this->y -= static_cast<T>(s);
this->z -= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec1<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.x);
this->z -= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator-=(tvec3<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.y);
this->z -= static_cast<T>(v.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(U s)
{
this->x *= static_cast<T>(s);
this->y *= static_cast<T>(s);
this->z *= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec1<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.x);
this->z *= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator*=(tvec3<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.y);
this->z *= static_cast<T>(v.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(U s)
{
this->x /= static_cast<T>(s);
this->y /= static_cast<T>(s);
this->z /= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec1<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.x);
this->z /= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator/=(tvec3<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.y);
this->z /= static_cast<T>(v.z);
return *this;
}
//////////////////////////////////////
// Increment and decrement operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator++()
{
++this->x;
++this->y;
++this->z;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator--()
{
--this->x;
--this->y;
--this->z;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> tvec3<T, P>::operator++(int)
{
tvec3<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> tvec3<T, P>::operator--(int)
{
tvec3<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////
// Unary bit operators
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(U s)
{
this->x %= s;
this->y %= s;
this->z %= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec1<U, P> const & v)
{
this->x %= v.x;
this->y %= v.x;
this->z %= v.x;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator%=(tvec3<U, P> const & v)
{
this->x %= v.x;
this->y %= v.y;
this->z %= v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(U s)
{
this->x &= s;
this->y &= s;
this->z &= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec1<U, P> const & v)
{
this->x &= v.x;
this->y &= v.x;
this->z &= v.x;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator&=(tvec3<U, P> const & v)
{
this->x &= v.x;
this->y &= v.y;
this->z &= v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(U s)
{
this->x |= s;
this->y |= s;
this->z |= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec1<U, P> const & v)
{
this->x |= v.x;
this->y |= v.x;
this->z |= v.x;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator|=(tvec3<U, P> const & v)
{
this->x |= v.x;
this->y |= v.y;
this->z |= v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(U s)
{
this->x ^= s;
this->y ^= s;
this->z ^= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec1<U, P> const & v)
{
this->x ^= v.x;
this->y ^= v.x;
this->z ^= v.x;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator^=(tvec3<U, P> const & v)
{
this->x ^= v.x;
this->y ^= v.y;
this->z ^= v.z;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(U s)
{
this->x <<= s;
this->y <<= s;
this->z <<= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec1<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
this->z <<= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator<<=(tvec3<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.y);
this->z <<= static_cast<T>(v.z);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(U s)
{
this->x >>= static_cast<T>(s);
this->y >>= static_cast<T>(s);
this->z >>= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec1<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.x);
this->z >>= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec3<T, P> & tvec3<T, P>::operator>>=(tvec3<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);
this->z >>= static_cast<T>(v.z);
return *this;
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
}
//////////////////////////////////////
// Binary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x + s,
v.y + s,
v.z + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x + s.x,
v.y + s.x,
v.z + s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s + v.x,
s + v.y,
s + v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x + v.x,
s.x + v.y,
s.x + v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x + v2.x,
v1.y + v2.y,
v1.z + v2.z);
}
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x - s,
v.y - s,
v.z - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x - s.x,
v.y - s.x,
v.z - s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s - v.x,
s - v.y,
s - v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x - v.x,
s.x - v.y,
s.x - v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x - v2.x,
v1.y - v2.y,
v1.z - v2.z);
}
//operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x * s,
v.y * s,
v.z * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x * s.x,
v.y * s.x,
v.z * s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s * v.x,
s * v.y,
s * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x * v.x,
s.x * v.y,
s.x * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x * v2.x,
v1.y * v2.y,
v1.z * v2.z);
}
//operator/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x / s,
v.y / s,
v.z / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x / s.x,
v.y / s.x,
v.z / s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s / v.x,
s / v.y,
s / v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x / v.x,
s.x / v.y,
s.x / v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x / v2.x,
v1.y / v2.y,
v1.z / v2.z);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v)
{
return tvec3<T, P>(
-v.x,
-v.y,
-v.z);
}
//////////////////////////////////////
// Binary bit operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x % s,
v.y % s,
v.z % s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x % s.x,
v.y % s.x,
v.z % s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s % v.x,
s % v.y,
s % v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x % v.x,
s.x % v.y,
s.x % v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x % v2.x,
v1.y % v2.y,
v1.z % v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x & s,
v.y & s,
v.z & s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x & s.x,
v.y & s.x,
v.z & s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s & v.x,
s & v.y,
s & v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x & v.x,
s.x & v.y,
s.x & v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x & v2.x,
v1.y & v2.y,
v1.z & v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x | s,
v.y | s,
v.z | s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x | s.x,
v.y | s.x,
v.z | s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s | v.x,
s | v.y,
s | v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x | v.x,
s.x | v.y,
s.x | v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x | v2.x,
v1.y | v2.y,
v1.z | v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x ^ s,
v.y ^ s,
v.z ^ s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x ^ s.x,
v.y ^ s.x,
v.z ^ s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s ^ v.x,
s ^ v.y,
s ^ v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x ^ v.x,
s.x ^ v.y,
s.x ^ v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x ^ v2.x,
v1.y ^ v2.y,
v1.z ^ v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x << s,
v.y << s,
v.z << s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x << s.x,
v.y << s.x,
v.z << s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s << v.x,
s << v.y,
s << v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x << v.x,
s.x << v.y,
s.x << v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x << v2.x,
v1.y << v2.y,
v1.z << v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, T const & s)
{
return tvec3<T, P>(
v.x >> s,
v.y >> s,
v.z >> s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v, tvec1<T, P> const & s)
{
return tvec3<T, P>(
v.x >> s.x,
v.y >> s.x,
v.z >> s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(T const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s >> v.x,
s >> v.y,
s >> v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec1<T, P> const & s, tvec3<T, P> const & v)
{
return tvec3<T, P>(
s.x >> v.x,
s.x >> v.y,
s.x >> v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2)
{
return tvec3<T, P>(
v1.x >> v2.x,
v1.y >> v2.y,
v1.z >> v2.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> operator~(tvec3<T, P> const & v)
{
return tvec3<T, P>(
~v.x,
~v.y,
~v.z);
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_vec4.hpp
/// @date 2008-08-22 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
//#include "../fwd.hpp"
#include "setup.hpp"
#include "type_vec.hpp"
#ifdef GLM_SWIZZLE
# if GLM_HAS_ANONYMOUS_UNION
# include "_swizzle.hpp"
# else
# include "_swizzle_func.hpp"
# endif
#endif //GLM_SWIZZLE
#include <cstddef>
namespace glm{
namespace detail
{
template <typename T>
struct simd
{
typedef T type[4];
};
# define GLM_NOT_BUGGY_VC32BITS !(GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER < GLM_COMPILER_VC2013)
# if GLM_ARCH & GLM_ARCH_SSE2 && GLM_NOT_BUGGY_VC32BITS
template <>
struct simd<float>
{
typedef __m128 type;
};
template <>
struct simd<int>
{
typedef __m128i type;
};
template <>
struct simd<unsigned int>
{
typedef __m128i type;
};
# endif
# if GLM_ARCH & GLM_ARCH_AVX && GLM_NOT_BUGGY_VC32BITS
template <>
struct simd<double>
{
typedef __m256d type;
};
# endif
# if GLM_ARCH & GLM_ARCH_AVX2 && GLM_NOT_BUGGY_VC32BITS
template <>
struct simd<int64>
{
typedef __m256i type;
};
template <>
struct simd<uint64>
{
typedef __m256i type;
};
# endif
}//namespace detail
template <typename T, precision P = defaultp>
struct tvec4
{
//////////////////////////////////////
// Implementation detail
typedef tvec4<T, P> type;
typedef tvec4<bool, P> bool_type;
typedef T value_type;
//////////////////////////////////////
// Data
# if GLM_HAS_ANONYMOUS_UNION
union
{
struct { T x, y, z, w;};
struct { T r, g, b, a; };
struct { T s, t, p, q; };
typename detail::simd<T>::type data;
# ifdef GLM_SWIZZLE
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, r, g, b, a)
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, s, t, p, q)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, x, y, z, w)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, r, g, b, a)
_GLM_SWIZZLE4_3_MEMBERS(T, P, tvec3, s, t, p, q)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, x, y, z, w)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(T, P, tvec4, s, t, p, q)
# endif//GLM_SWIZZLE
};
# else
union { T x, r, s; };
union { T y, g, t; };
union { T z, b, p; };
union { T w, a, q; };
# ifdef GLM_SWIZZLE
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, tvec4, tvec2, tvec3, tvec4)
# endif//GLM_SWIZZLE
# endif//GLM_LANG
//////////////////////////////////////
// Component accesses
# ifdef GLM_FORCE_SIZE_FUNC
/// Return the count of components of the vector
typedef size_t size_type;
GLM_FUNC_DECL GLM_CONSTEXPR size_type size() const;
GLM_FUNC_DECL T & operator[](size_type i);
GLM_FUNC_DECL T const & operator[](size_type i) const;
# else
/// Return the count of components of the vector
typedef length_t length_type;
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const & operator[](length_type i) const;
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tvec4();
GLM_FUNC_DECL tvec4(tvec4<T, P> const & v);
template <precision Q>
GLM_FUNC_DECL tvec4(tvec4<T, Q> const & v);
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_DECL explicit tvec4(ctor);
GLM_FUNC_DECL explicit tvec4(T s);
GLM_FUNC_DECL tvec4(T a, T b, T c, T d);
GLM_FUNC_DECL ~tvec4(){}
//////////////////////////////////////
// Conversion scalar constructors
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL tvec4(A a, B b, C c, D d);
template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d);
//////////////////////////////////////
// Conversion vector constructors
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, B b, C c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(A a, tvec2<B, Q> const & b, C c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(A a, B b, tvec2<C, Q> const & c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, B b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(A a, tvec3<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
# ifdef GLM_FORCE_EXPLICIT_CTOR
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL explicit tvec4(tvec4<U, Q> const & v);
# else
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL tvec4(tvec4<U, Q> const & v);
# endif
//////////////////////////////////////
// Swizzle constructors
# if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
template <int E0, int E1, int E2, int E3>
GLM_FUNC_DECL tvec4(detail::_swizzle<4, T, P, tvec4<T, P>, E0, E1, E2, E3> const & that)
{
*this = that();
}
template <int E0, int E1, int F0, int F1>
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, tvec2<T, P>, F0, F1, -1, -2> const & u)
{
*this = tvec4<T, P>(v(), u());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v)
{
*this = tvec4<T, P>(x, y, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & w)
{
*this = tvec4<T, P>(x, v(), w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, tvec2<T, P>, E0, E1, -1, -2> const & v, T const & z, T const & w)
{
*this = tvec4<T, P>(v(), z, w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v, T const & w)
{
*this = tvec4<T, P>(v(), w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, tvec3<T, P>, E0, E1, E2, -1> const & v)
{
*this = tvec4<T, P>(x, v());
}
# endif// GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE)
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<T, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v);
//////////////////////////////////////
// Increment and decrement operators
GLM_FUNC_DECL tvec4<T, P> & operator++();
GLM_FUNC_DECL tvec4<T, P> & operator--();
GLM_FUNC_DECL tvec4<T, P> operator++(int);
GLM_FUNC_DECL tvec4<T, P> operator--(int);
//////////////////////////////////////
// Unary bit operators
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v);
};
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_vec4.inl"
#endif//GLM_EXTERNAL_TEMPLATE
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_tvec4.inl
/// @date 2008-08-23 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
//////////////////////////////////////
// Implicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(0)
# endif
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<T, Q> const & v)
: x(v.x), y(v.y), z(v.z), w(v.w)
{}
//////////////////////////////////////
// Explicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T s)
: x(s), y(s), z(s), w(s)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(T a, T b, T c, T d)
: x(a), y(b), z(c), w(d)
{}
//////////////////////////////////////
// Conversion scalar constructors
template <typename T, precision P>
template <typename A, typename B, typename C, typename D>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A a, B b, C c, D d) :
x(static_cast<T>(a)),
y(static_cast<T>(b)),
z(static_cast<T>(c)),
w(static_cast<T>(d))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, typename D>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c, tvec1<D, P> const & d) :
x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)),
z(static_cast<T>(c.x)),
w(static_cast<T>(d.x))
{}
//////////////////////////////////////
// Conversion vector constructors
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, B b, C c) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(b)),
w(static_cast<T>(c))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(b.x)),
w(static_cast<T>(c.x))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A s1, tvec2<B, Q> const & v, C s2) :
x(static_cast<T>(s1)),
y(static_cast<T>(v.x)),
z(static_cast<T>(v.y)),
w(static_cast<T>(s2))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c) :
x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)),
z(static_cast<T>(b.y)),
w(static_cast<T>(c.x))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A s1, B s2, tvec2<C, Q> const & v) :
x(static_cast<T>(s1)),
y(static_cast<T>(s2)),
z(static_cast<T>(v.x)),
w(static_cast<T>(v.y))
{}
template <typename T, precision P>
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c) :
x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)),
z(static_cast<T>(c.x)),
w(static_cast<T>(c.y))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec3<A, Q> const & a, B b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(a.z)),
w(static_cast<T>(b))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(a.z)),
w(static_cast<T>(b.x))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(A a, tvec3<B, Q> const & b) :
x(static_cast<T>(a)),
y(static_cast<T>(b.x)),
z(static_cast<T>(b.y)),
w(static_cast<T>(b.z))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)),
z(static_cast<T>(b.y)),
w(static_cast<T>(b.z))
{}
template <typename T, precision P>
template <typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b) :
x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)),
z(static_cast<T>(b.x)),
w(static_cast<T>(b.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tvec4<T, P>::tvec4(tvec4<U, Q> const & v) :
x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)),
z(static_cast<T>(v.z)),
w(static_cast<T>(v.w))
{}
//////////////////////////////////////
// Component accesses
# ifdef GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::size_type tvec4<T, P>::size() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i)
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::size_type i) const
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
# else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::length_type tvec4<T, P>::length() const
{
return 4;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i)
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i) const
{
assert(i >= 0 && static_cast<detail::component_count_t>(i) < detail::component_count(*this));
return (&x)[i];
}
# endif//GLM_FORCE_SIZE_FUNC
//////////////////////////////////////
// Unary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<T, P> const & v)
{
this->x = v.x;
this->y = v.y;
this->z = v.z;
this->w = v.w;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator=(tvec4<U, P> const & v)
{
this->x = static_cast<T>(v.x);
this->y = static_cast<T>(v.y);
this->z = static_cast<T>(v.z);
this->w = static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
this->y += static_cast<T>(scalar);
this->z += static_cast<T>(scalar);
this->w += static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec1<U, P> const & v)
{
T const scalar = static_cast<T>(v.x);
this->x += scalar;
this->y += scalar;
this->z += scalar;
this->w += scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator+=(tvec4<U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.y);
this->z += static_cast<T>(v.z);
this->w += static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
this->y -= static_cast<T>(scalar);
this->z -= static_cast<T>(scalar);
this->w -= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(tvec1<U, P> const & v)
{
T const scalar = static_cast<T>(v.x);
this->x -= scalar;
this->y -= scalar;
this->z -= scalar;
this->w -= scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator-=(tvec4<U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.y);
this->z -= static_cast<T>(v.z);
this->w -= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(U s)
{
this->x *= static_cast<T>(s);
this->y *= static_cast<T>(s);
this->z *= static_cast<T>(s);
this->w *= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(tvec1<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.x);
this->z *= static_cast<T>(v.x);
this->w *= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator*=(tvec4<U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.y);
this->z *= static_cast<T>(v.z);
this->w *= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(U s)
{
this->x /= static_cast<T>(s);
this->y /= static_cast<T>(s);
this->z /= static_cast<T>(s);
this->w /= static_cast<T>(s);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(tvec1<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.x);
this->z /= static_cast<T>(v.x);
this->w /= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator/=(tvec4<U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.y);
this->z /= static_cast<T>(v.z);
this->w /= static_cast<T>(v.w);
return *this;
}
//////////////////////////////////////
// Increment and decrement operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator++()
{
++this->x;
++this->y;
++this->z;
++this->w;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator--()
{
--this->x;
--this->y;
--this->z;
--this->w;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> tvec4<T, P>::operator++(int)
{
tvec4<T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> tvec4<T, P>::operator--(int)
{
tvec4<T, P> Result(*this);
--*this;
return Result;
}
//////////////////////////////////////
// Unary bit operators
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
this->y %= static_cast<T>(scalar);
this->z %= static_cast<T>(scalar);
this->w %= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(tvec1<U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.x);
this->z %= static_cast<T>(v.x);
this->w %= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator%=(tvec4<U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.y);
this->z %= static_cast<T>(v.z);
this->w %= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
this->y &= static_cast<T>(scalar);
this->z &= static_cast<T>(scalar);
this->w &= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(tvec1<U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.x);
this->z &= static_cast<T>(v.x);
this->w &= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator&=(tvec4<U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.y);
this->z &= static_cast<T>(v.z);
this->w &= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
this->y |= static_cast<T>(scalar);
this->z |= static_cast<T>(scalar);
this->w |= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(tvec1<U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.x);
this->z |= static_cast<T>(v.x);
this->w |= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator|=(tvec4<U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.y);
this->z |= static_cast<T>(v.z);
this->w |= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
this->y ^= static_cast<T>(scalar);
this->z ^= static_cast<T>(scalar);
this->w ^= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(tvec1<U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.x);
this->z ^= static_cast<T>(v.x);
this->w ^= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator^=(tvec4<U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.y);
this->z ^= static_cast<T>(v.z);
this->w ^= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
this->y <<= static_cast<T>(scalar);
this->z <<= static_cast<T>(scalar);
this->w <<= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(tvec1<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
this->z <<= static_cast<T>(v.x);
this->w <<= static_cast<T>(v.x);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator<<=(tvec4<U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.y);
this->z <<= static_cast<T>(v.z);
this->w <<= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
this->y >>= static_cast<T>(scalar);
this->z >>= static_cast<T>(scalar);
this->w >>= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(tvec1<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);
this->z >>= static_cast<T>(v.z);
this->w >>= static_cast<T>(v.w);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<T, P> & tvec4<T, P>::operator>>=(tvec4<U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);
this->z >>= static_cast<T>(v.z);
this->w >>= static_cast<T>(v.w);
return *this;
}
//////////////////////////////////////
// Boolean operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z) && (v1.w == v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z) || (v1.w != v2.w);
}
//////////////////////////////////////
// Binary arithmetic operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x + scalar,
v.y + scalar,
v.z + scalar,
v.w + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar + v.x,
scalar + v.y,
scalar + v.z,
scalar + v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x + v2.x,
v1.y + v2.y,
v1.z + v2.z,
v1.w + v2.w);
}
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x - scalar,
v.y - scalar,
v.z - scalar,
v.w - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar - v.x,
scalar - v.y,
scalar - v.z,
scalar - v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x - v2.x,
v1.y - v2.y,
v1.z - v2.z,
v1.w - v2.w);
}
//operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x * scalar,
v.y * scalar,
v.z * scalar,
v.w * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar * v.x,
scalar * v.y,
scalar * v.z,
scalar * v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x * v2.x,
v1.y * v2.y,
v1.z * v2.z,
v1.w * v2.w);
}
//operator/
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x / scalar,
v.y / scalar,
v.z / scalar,
v.w / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar / v.x,
scalar / v.y,
scalar / v.z,
scalar / v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x / v2.x,
v1.y / v2.y,
v1.z / v2.z,
v1.w / v2.w);
}
// Unary constant operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v)
{
return tvec4<T, P>(
-v.x,
-v.y,
-v.z,
-v.w);
}
//////////////////////////////////////
// Binary bit operators
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v, T s)
{
return tvec4<T, P>(
v.x % s,
v.y % s,
v.z % s,
v.w % s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x % s.x,
v.y % s.x,
v.z % s.x,
v.w % s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator%(T s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s % v.x,
s % v.y,
s % v.z,
s % v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x % v.x,
s.x % v.y,
s.x % v.z,
s.x % v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x % v2.x,
v1.y % v2.y,
v1.z % v2.z,
v1.w % v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v, T s)
{
return tvec4<T, P>(
v.x & s,
v.y & s,
v.z & s,
v.w & s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x & s.x,
v.y & s.x,
v.z & s.x,
v.w & s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator&(T s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s & v.x,
s & v.y,
s & v.z,
s & v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x & v.x,
s.x & v.y,
s.x & v.z,
s.x & v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x & v2.x,
v1.y & v2.y,
v1.z & v2.z,
v1.w & v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v, T s)
{
return tvec4<T, P>(
v.x | s,
v.y | s,
v.z | s,
v.w | s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x | s.x,
v.y | s.x,
v.z | s.x,
v.w | s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator|(T s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s | v.x,
s | v.y,
s | v.z,
s | v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x | v.x,
s.x | v.y,
s.x | v.z,
s.x | v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x | v2.x,
v1.y | v2.y,
v1.z | v2.z,
v1.w | v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v, T s)
{
return tvec4<T, P>(
v.x ^ s,
v.y ^ s,
v.z ^ s,
v.w ^ s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x ^ s.x,
v.y ^ s.x,
v.z ^ s.x,
v.w ^ s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar ^ v.x,
scalar ^ v.y,
scalar ^ v.z,
scalar ^ v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x ^ v.x,
s.x ^ v.y,
s.x ^ v.z,
s.x ^ v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x ^ v2.x,
v1.y ^ v2.y,
v1.z ^ v2.z,
v1.w ^ v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x << scalar,
v.y << scalar,
v.z << scalar,
v.w << scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x << s.x,
v.y << s.x,
v.z << s.x,
v.w << s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar << v.x,
scalar << v.y,
scalar << v.z,
scalar << v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x << v.x,
s.x << v.y,
s.x << v.z,
s.x << v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x << v2.x,
v1.y << v2.y,
v1.z << v2.z,
v1.w << v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar)
{
return tvec4<T, P>(
v.x >> scalar,
v.y >> scalar,
v.z >> scalar,
v.w >> scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & s)
{
return tvec4<T, P>(
v.x >> s.x,
v.y >> s.x,
v.z >> s.x,
v.w >> s.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v)
{
return tvec4<T, P>(
scalar >> v.x,
scalar >> v.y,
scalar >> v.z,
scalar >> v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec1<T, P> const & s, tvec4<T, P> const & v)
{
return tvec4<T, P>(
s.x >> v.x,
s.x >> v.y,
s.x >> v.z,
s.x >> v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2)
{
return tvec4<T, P>(
v1.x >> v2.x,
v1.y >> v2.y,
v1.z >> v2.z,
v1.w >> v2.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> operator~(tvec4<T, P> const & v)
{
return tvec4<T, P>(
~v.x,
~v.y,
~v.z,
~v.w);
}
}//namespace glm
#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS
#if GLM_ARCH & GLM_ARCH_SSE2
# include "type_vec4_sse2.inl"
#endif
#if GLM_ARCH & GLM_ARCH_AVX
# include "type_vec4_avx.inl"
#endif
#if GLM_ARCH & GLM_ARCH_AVX2
# include "type_vec4_avx2.inl"
#endif
#endif//
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_tvec4_avx.inl
/// @date 2014-12-01 / 2014-12-01
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
}//namespace detail
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_tvec4_avx2.inl
/// @date 2014-12-01 / 2014-12-01
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
}//namespace detail
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/detail/type_tvec4_sse2.inl
/// @date 2014-12-01 / 2014-12-01
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
}//namespace detail
template <>
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template <>
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template <>
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U scalar)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
return *this;
}
template <>
template <>
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=<float>(float scalar)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
return *this;
}
template <>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(U scalar)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(scalar)));
return *this;
}
template <>
template <>
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=<float>(float scalar)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar));
return *this;
}
template <>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & v)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
return *this;
}
template <>
template <typename U>
GLM_FUNC_QUALIFIER tvec4<float, mediump> & tvec4<float, mediump>::operator+=(tvec1<U, mediump> const & v)
{
this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast<float>(v.x)));
return *this;
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/exponential.hpp
/// @date 2013-12-24 / 2013-12-24
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "detail/func_exponential.hpp"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @file glm/glm.hpp
/// @date 2009-05-01 / 2011-05-16
/// @author Christophe Riccio
///
/// @ref core (Dependence)
///
/// @defgroup gtc GTC Extensions (Stable)
///
/// @brief Functions and types that the GLSL specification doesn't define, but useful to have for a C++ program.
///
/// GTC extensions aim to be stable.
///
/// Even if it's highly unrecommended, it's possible to include all the extensions at once by
/// including <glm/ext.hpp>. Otherwise, each extension needs to be included a specific file.
///
/// @defgroup gtx GTX Extensions (Experimental)
///
/// @brief Functions and types that the GLSL specification doesn't define, but
/// useful to have for a C++ program.
///
/// Experimental extensions are useful functions and types, but the development of
/// their API and functionality is not necessarily stable. They can change
/// substantially between versions. Backwards compatibility is not much of an issue
/// for them.
///
/// Even if it's highly unrecommended, it's possible to include all the extensions
/// at once by including <glm/ext.hpp>. Otherwise, each extension needs to be
/// included a specific file.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED))
# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED
# pragma message("GLM: All extensions included (not recommanded)")
#endif//GLM_MESSAGES
#include "./gtc/bitfield.hpp"
#include "./gtc/constants.hpp"
#include "./gtc/epsilon.hpp"
#include "./gtc/integer.hpp"
#include "./gtc/matrix_access.hpp"
#include "./gtc/matrix_integer.hpp"
#include "./gtc/matrix_inverse.hpp"
#include "./gtc/matrix_transform.hpp"
#include "./gtc/noise.hpp"
#include "./gtc/packing.hpp"
#include "./gtc/quaternion.hpp"
#include "./gtc/random.hpp"
#include "./gtc/reciprocal.hpp"
#include "./gtc/round.hpp"
#include "./gtc/type_precision.hpp"
#include "./gtc/type_ptr.hpp"
#include "./gtc/ulp.hpp"
#include "./gtc/vec1.hpp"
#include "./gtx/associated_min_max.hpp"
#include "./gtx/bit.hpp"
#include "./gtx/closest_point.hpp"
#include "./gtx/color_space.hpp"
#include "./gtx/color_space_YCoCg.hpp"
#include "./gtx/compatibility.hpp"
#include "./gtx/component_wise.hpp"
#include "./gtx/dual_quaternion.hpp"
#include "./gtx/euler_angles.hpp"
#include "./gtx/extend.hpp"
#include "./gtx/extented_min_max.hpp"
#include "./gtx/fast_exponential.hpp"
#include "./gtx/fast_square_root.hpp"
#include "./gtx/fast_trigonometry.hpp"
#include "./gtx/gradient_paint.hpp"
#include "./gtx/handed_coordinate_space.hpp"
#include "./gtx/integer.hpp"
#include "./gtx/intersect.hpp"
#include "./gtx/log_base.hpp"
#include "./gtx/matrix_cross_product.hpp"
#include "./gtx/matrix_interpolation.hpp"
#include "./gtx/matrix_major_storage.hpp"
#include "./gtx/matrix_operation.hpp"
#include "./gtx/matrix_query.hpp"
#include "./gtx/mixed_product.hpp"
#include "./gtx/norm.hpp"
#include "./gtx/normal.hpp"
#include "./gtx/normalize_dot.hpp"
#include "./gtx/number_precision.hpp"
#include "./gtx/optimum_pow.hpp"
#include "./gtx/orthonormalize.hpp"
#include "./gtx/perpendicular.hpp"
#include "./gtx/polar_coordinates.hpp"
#include "./gtx/projection.hpp"
#include "./gtx/quaternion.hpp"
#include "./gtx/raw_data.hpp"
#include "./gtx/rotate_vector.hpp"
#include "./gtx/spline.hpp"
#include "./gtx/std_based_type.hpp"
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
# include "./gtx/string_cast.hpp"
#endif
#include "./gtx/transform.hpp"
#include "./gtx/transform2.hpp"
#include "./gtx/type_aligned.hpp"
#include "./gtx/vector_angle.hpp"
#include "./gtx/vector_query.hpp"
#include "./gtx/wrap.hpp"
#if GLM_HAS_TEMPLATE_ALIASES
# include "./gtx/scalar_multiplication.hpp"
#endif
#if GLM_HAS_RANGE_FOR
# include "./gtx/range.hpp"
#endif
#if GLM_ARCH & GLM_ARCH_SSE2
# include "./gtx/simd_vec4.hpp"
# include "./gtx/simd_mat4.hpp"
#endif
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/fwd.hpp
/// @date 2013-03-30 / 2013-03-31
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "detail/type_int.hpp"
#include "detail/type_float.hpp"
#include "detail/type_vec.hpp"
#include "detail/type_mat.hpp"
//////////////////////
// GLM_GTC_quaternion
namespace glm
{
template <typename T, precision P> struct tquat;
/// Quaternion of low single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<float, lowp> lowp_quat;
/// Quaternion of medium single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<float, mediump> mediump_quat;
/// Quaternion of high single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<float, highp> highp_quat;
#if(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef highp_quat quat;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
typedef mediump_quat quat;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
typedef lowp_quat quat;
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
/// Quaternion of default single-precision floating-point numbers.
typedef highp_quat quat;
#endif
/// Quaternion of low single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef lowp_quat lowp_fquat;
/// Quaternion of medium single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef mediump_quat mediump_fquat;
/// Quaternion of high single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef highp_quat highp_fquat;
/// Quaternion of default single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef quat fquat;
/// Quaternion of low double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<double, lowp> lowp_dquat;
/// Quaternion of medium double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<double, mediump> mediump_dquat;
/// Quaternion of high double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef tquat<double, highp> highp_dquat;
#if(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
typedef highp_dquat dquat;
#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
typedef mediump_dquat dquat;
#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE))
typedef lowp_dquat dquat;
#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE))
/// Quaternion of default double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef highp_dquat dquat;
#endif
}//namespace glm
//////////////////////
// GLM_GTC_precision
namespace glm
{
/// @addtogroup gtc_type_precision
/// @{
/// Low precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_int8;
/// Low precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_int16;
/// Low precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 lowp_int32;
/// Low precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 lowp_int64;
/// Low precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_int8_t;
/// Low precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_int16_t;
/// Low precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 lowp_int32_t;
/// Low precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 lowp_int64_t;
/// Low precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 lowp_i8;
/// Low precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 lowp_i16;
/// Low precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 lowp_i32;
/// Low precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 lowp_i64;
/// Medium precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_int8;
/// Medium precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_int16;
/// Medium precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 mediump_int32;
/// Medium precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 mediump_int64;
/// Medium precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_int8_t;
/// Medium precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_int16_t;
/// Medium precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 mediump_int32_t;
/// Medium precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 mediump_int64_t;
/// Medium precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 mediump_i8;
/// Medium precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 mediump_i16;
/// Medium precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 mediump_i32;
/// Medium precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 mediump_i64;
/// High precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_int8;
/// High precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_int16;
/// High precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 highp_int32;
/// High precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 highp_int64;
/// High precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_int8_t;
/// High precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_int16_t;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 highp_int32_t;
/// High precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 highp_int64_t;
/// High precision 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 highp_i8;
/// High precision 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 highp_i16;
/// High precision 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 highp_i32;
/// High precision 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 highp_i64;
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 int32;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 int64;
#if GLM_HAS_EXTENDED_INTEGER_TYPE
using std::int8_t;
using std::int16_t;
using std::int32_t;
using std::int64_t;
#else
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8_t;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16_t;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 int32_t;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 int64_t;
#endif
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 i8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 i16;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 i32;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 i64;
/// Low precision 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i8, lowp> lowp_i8vec1;
/// Low precision 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i8, lowp> lowp_i8vec2;
/// Low precision 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i8, lowp> lowp_i8vec3;
/// Low precision 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i8, lowp> lowp_i8vec4;
/// Medium precision 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i8, mediump> mediump_i8vec1;
/// Medium precision 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i8, mediump> mediump_i8vec2;
/// Medium precision 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i8, mediump> mediump_i8vec3;
/// Medium precision 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i8, mediump> mediump_i8vec4;
/// High precision 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i8, highp> highp_i8vec1;
/// High precision 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i8, highp> highp_i8vec2;
/// High precision 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i8, highp> highp_i8vec3;
/// High precision 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i8, highp> highp_i8vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_i8vec1 i8vec1;
typedef lowp_i8vec2 i8vec2;
typedef lowp_i8vec3 i8vec3;
typedef lowp_i8vec4 i8vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_i8vec1 i8vec1;
typedef mediump_i8vec2 i8vec2;
typedef mediump_i8vec3 i8vec3;
typedef mediump_i8vec4 i8vec4;
#else
/// Default precision 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef highp_i8vec1 i8vec1;
/// Default precision 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_i8vec2 i8vec2;
/// Default precision 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_i8vec3 i8vec3;
/// Default precision 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_i8vec4 i8vec4;
#endif
/// Low precision 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i16, lowp> lowp_i16vec1;
/// Low precision 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i16, lowp> lowp_i16vec2;
/// Low precision 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i16, lowp> lowp_i16vec3;
/// Low precision 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i16, lowp> lowp_i16vec4;
/// Medium precision 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i16, mediump> mediump_i16vec1;
/// Medium precision 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i16, mediump> mediump_i16vec2;
/// Medium precision 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i16, mediump> mediump_i16vec3;
/// Medium precision 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i16, mediump> mediump_i16vec4;
/// High precision 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i16, highp> highp_i16vec1;
/// High precision 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i16, highp> highp_i16vec2;
/// High precision 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i16, highp> highp_i16vec3;
/// High precision 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i16, highp> highp_i16vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_i16vec1 i16vec1;
typedef lowp_i16vec2 i16vec2;
typedef lowp_i16vec3 i16vec3;
typedef lowp_i16vec4 i16vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_i16vec1 i16vec1;
typedef mediump_i16vec2 i16vec2;
typedef mediump_i16vec3 i16vec3;
typedef mediump_i16vec4 i16vec4;
#else
/// Default precision 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef highp_i16vec1 i16vec1;
/// Default precision 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_i16vec2 i16vec2;
/// Default precision 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_i16vec3 i16vec3;
/// Default precision 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_i16vec4 i16vec4;
#endif
/// Low precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, lowp> lowp_i32vec1;
/// Low precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, lowp> lowp_i32vec2;
/// Low precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, lowp> lowp_i32vec3;
/// Low precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, lowp> lowp_i32vec4;
/// Medium precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, mediump> mediump_i32vec1;
/// Medium precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, mediump> mediump_i32vec2;
/// Medium precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, mediump> mediump_i32vec3;
/// Medium precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, mediump> mediump_i32vec4;
/// High precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, highp> highp_i32vec1;
/// High precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, highp> highp_i32vec2;
/// High precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, highp> highp_i32vec3;
/// High precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, highp> highp_i32vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_i32vec1 i32vec1;
typedef lowp_i32vec2 i32vec2;
typedef lowp_i32vec3 i32vec3;
typedef lowp_i32vec4 i32vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_i32vec1 i32vec1;
typedef mediump_i32vec2 i32vec2;
typedef mediump_i32vec3 i32vec3;
typedef mediump_i32vec4 i32vec4;
#else
/// Default precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef highp_i32vec1 i32vec1;
/// Default precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_i32vec2 i32vec2;
/// Default precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_i32vec3 i32vec3;
/// Default precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_i32vec4 i32vec4;
#endif
/// Low precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, lowp> lowp_i32vec1;
/// Low precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, lowp> lowp_i32vec2;
/// Low precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, lowp> lowp_i32vec3;
/// Low precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, lowp> lowp_i32vec4;
/// Medium precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, mediump> mediump_i32vec1;
/// Medium precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, mediump> mediump_i32vec2;
/// Medium precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, mediump> mediump_i32vec3;
/// Medium precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, mediump> mediump_i32vec4;
/// High precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, highp> highp_i32vec1;
/// High precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, highp> highp_i32vec2;
/// High precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, highp> highp_i32vec3;
/// High precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, highp> highp_i32vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_i32vec1 i32vec1;
typedef lowp_i32vec2 i32vec2;
typedef lowp_i32vec3 i32vec3;
typedef lowp_i32vec4 i32vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_i32vec1 i32vec1;
typedef mediump_i32vec2 i32vec2;
typedef mediump_i32vec3 i32vec3;
typedef mediump_i32vec4 i32vec4;
#else
/// Default precision 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef highp_i32vec1 i32vec1;
/// Default precision 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_i32vec2 i32vec2;
/// Default precision 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_i32vec3 i32vec3;
/// Default precision 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_i32vec4 i32vec4;
#endif
/// Low precision 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i64, lowp> lowp_i64vec1;
/// Low precision 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i64, lowp> lowp_i64vec2;
/// Low precision 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i64, lowp> lowp_i64vec3;
/// Low precision 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i64, lowp> lowp_i64vec4;
/// Medium precision 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i64, mediump> mediump_i64vec1;
/// Medium precision 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i64, mediump> mediump_i64vec2;
/// Medium precision 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i64, mediump> mediump_i64vec3;
/// Medium precision 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i64, mediump> mediump_i64vec4;
/// High precision 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i64, highp> highp_i64vec1;
/// High precision 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i64, highp> highp_i64vec2;
/// High precision 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i64, highp> highp_i64vec3;
/// High precision 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i64, highp> highp_i64vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_i64vec1 i64vec1;
typedef lowp_i64vec2 i64vec2;
typedef lowp_i64vec3 i64vec3;
typedef lowp_i64vec4 i64vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_i64vec1 i64vec1;
typedef mediump_i64vec2 i64vec2;
typedef mediump_i64vec3 i64vec3;
typedef mediump_i64vec4 i64vec4;
#else
/// Default precision 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef highp_i64vec1 i64vec1;
/// Default precision 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_i64vec2 i64vec2;
/// Default precision 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_i64vec3 i64vec3;
/// Default precision 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_i64vec4 i64vec4;
#endif
/////////////////////////////
// Unsigned int vector types
/// Low precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_uint8;
/// Low precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_uint16;
/// Low precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 lowp_uint32;
/// Low precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 lowp_uint64;
/// Low precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_uint8_t;
/// Low precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_uint16_t;
/// Low precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 lowp_uint32_t;
/// Low precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 lowp_uint64_t;
/// Low precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 lowp_u8;
/// Low precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 lowp_u16;
/// Low precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 lowp_u32;
/// Low precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 lowp_u64;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_uint8;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_uint16;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 mediump_uint32;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 mediump_uint64;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_uint8_t;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_uint16_t;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 mediump_uint32_t;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 mediump_uint64_t;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 mediump_u8;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 mediump_u16;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 mediump_u32;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 mediump_u64;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_uint8;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_uint16;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 highp_uint32;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 highp_uint64;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_uint8_t;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_uint16_t;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 highp_uint32_t;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 highp_uint64_t;
/// Medium precision 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 highp_u8;
/// Medium precision 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 highp_u16;
/// Medium precision 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 highp_u32;
/// Medium precision 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 highp_u64;
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 uint32;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 uint64;
#if GLM_HAS_EXTENDED_INTEGER_TYPE
using std::uint8_t;
using std::uint16_t;
using std::uint32_t;
using std::uint64_t;
#else
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8_t;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16_t;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 uint32_t;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 uint64_t;
#endif
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 u8;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 u16;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 u32;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 u64;
/// Low precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u8, lowp> lowp_u8vec1;
/// Low precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u8, lowp> lowp_u8vec2;
/// Low precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u8, lowp> lowp_u8vec3;
/// Low precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u8, lowp> lowp_u8vec4;
/// Medium precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u8, mediump> mediump_u8vec1;
/// Medium precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u8, mediump> mediump_u8vec2;
/// Medium precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u8, mediump> mediump_u8vec3;
/// Medium precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u8, mediump> mediump_u8vec4;
/// High precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u8, highp> highp_u8vec1;
/// High precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u8, highp> highp_u8vec2;
/// High precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u8, highp> highp_u8vec3;
/// High precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u8, highp> highp_u8vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_u8vec1 u8vec1;
typedef lowp_u8vec2 u8vec2;
typedef lowp_u8vec3 u8vec3;
typedef lowp_u8vec4 u8vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_u8vec1 u8vec1;
typedef mediump_u8vec2 u8vec2;
typedef mediump_u8vec3 u8vec3;
typedef mediump_u8vec4 u8vec4;
#else
/// Default precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef highp_u8vec1 u8vec1;
/// Default precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_u8vec2 u8vec2;
/// Default precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_u8vec3 u8vec3;
/// Default precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_u8vec4 u8vec4;
#endif
/// Low precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u16, lowp> lowp_u16vec1;
/// Low precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u16, lowp> lowp_u16vec2;
/// Low precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u16, lowp> lowp_u16vec3;
/// Low precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u16, lowp> lowp_u16vec4;
/// Medium precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u16, mediump> mediump_u16vec1;
/// Medium precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u16, mediump> mediump_u16vec2;
/// Medium precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u16, mediump> mediump_u16vec3;
/// Medium precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u16, mediump> mediump_u16vec4;
/// High precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u16, highp> highp_u16vec1;
/// High precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u16, highp> highp_u16vec2;
/// High precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u16, highp> highp_u16vec3;
/// High precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u16, highp> highp_u16vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_u16vec1 u16vec1;
typedef lowp_u16vec2 u16vec2;
typedef lowp_u16vec3 u16vec3;
typedef lowp_u16vec4 u16vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_u16vec1 u16vec1;
typedef mediump_u16vec2 u16vec2;
typedef mediump_u16vec3 u16vec3;
typedef mediump_u16vec4 u16vec4;
#else
/// Default precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef highp_u16vec1 u16vec1;
/// Default precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_u16vec2 u16vec2;
/// Default precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_u16vec3 u16vec3;
/// Default precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_u16vec4 u16vec4;
#endif
/// Low precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, lowp> lowp_u32vec1;
/// Low precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, lowp> lowp_u32vec2;
/// Low precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, lowp> lowp_u32vec3;
/// Low precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, lowp> lowp_u32vec4;
/// Medium precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, mediump> mediump_u32vec1;
/// Medium precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, mediump> mediump_u32vec2;
/// Medium precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, mediump> mediump_u32vec3;
/// Medium precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, mediump> mediump_u32vec4;
/// High precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, highp> highp_u32vec1;
/// High precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, highp> highp_u32vec2;
/// High precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, highp> highp_u32vec3;
/// High precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, highp> highp_u32vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_u32vec1 u32vec1;
typedef lowp_u32vec2 u32vec2;
typedef lowp_u32vec3 u32vec3;
typedef lowp_u32vec4 u32vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_u32vec1 u32vec1;
typedef mediump_u32vec2 u32vec2;
typedef mediump_u32vec3 u32vec3;
typedef mediump_u32vec4 u32vec4;
#else
/// Default precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef highp_u32vec1 u32vec1;
/// Default precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_u32vec2 u32vec2;
/// Default precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_u32vec3 u32vec3;
/// Default precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_u32vec4 u32vec4;
#endif
/// Low precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, lowp> lowp_u32vec1;
/// Low precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, lowp> lowp_u32vec2;
/// Low precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, lowp> lowp_u32vec3;
/// Low precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, lowp> lowp_u32vec4;
/// Medium precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, mediump> mediump_u32vec1;
/// Medium precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, mediump> mediump_u32vec2;
/// Medium precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, mediump> mediump_u32vec3;
/// Medium precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, mediump> mediump_u32vec4;
/// High precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, highp> highp_u32vec1;
/// High precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, highp> highp_u32vec2;
/// High precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, highp> highp_u32vec3;
/// High precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, highp> highp_u32vec4;
#if(defined(GLM_PRECISION_LOWP_INT))
typedef lowp_u32vec1 u32vec1;
typedef lowp_u32vec2 u32vec2;
typedef lowp_u32vec3 u32vec3;
typedef lowp_u32vec4 u32vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
typedef mediump_u32vec1 u32vec1;
typedef mediump_u32vec2 u32vec2;
typedef mediump_u32vec3 u32vec3;
typedef mediump_u32vec4 u32vec4;
#else
/// Default precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef highp_u32vec1 u32vec1;
/// Default precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_u32vec2 u32vec2;
/// Default precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_u32vec3 u32vec3;
/// Default precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_u32vec4 u32vec4;
#endif
/// Low precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u64, lowp> lowp_u64vec1;
/// Low precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u64, lowp> lowp_u64vec2;
/// Low precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u64, lowp> lowp_u64vec3;
/// Low precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u64, lowp> lowp_u64vec4;
/// Medium precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u64, mediump> mediump_u64vec1;
/// Medium precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u64, mediump> mediump_u64vec2;
/// Medium precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u64, mediump> mediump_u64vec3;
/// Medium precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u64, mediump> mediump_u64vec4;
/// High precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u64, highp> highp_u64vec1;
/// High precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u64, highp> highp_u64vec2;
/// High precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u64, highp> highp_u64vec3;
/// High precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u64, highp> highp_u64vec4;
#if(defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_u64vec1 u64vec1;
typedef lowp_u64vec2 u64vec2;
typedef lowp_u64vec3 u64vec3;
typedef lowp_u64vec4 u64vec4;
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
typedef mediump_u64vec1 u64vec1;
typedef mediump_u64vec2 u64vec2;
typedef mediump_u64vec3 u64vec3;
typedef mediump_u64vec4 u64vec4;
#else
/// Default precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef highp_u64vec1 u64vec1;
/// Default precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef highp_u64vec2 u64vec2;
/// Default precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef highp_u64vec3 u64vec3;
/// Default precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef highp_u64vec4 u64vec4;
#endif
//////////////////////
// Float vector types
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32_t;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64_t;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 lowp_f32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 lowp_f64;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32_t;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64_t;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 lowp_f32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 lowp_f64;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 lowp_float32_t;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 lowp_float64_t;
/// Low 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 lowp_f32;
/// Low 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 lowp_f64;
/// Medium 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 mediump_float32;
/// Medium 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 mediump_float64;
/// Medium 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 mediump_float32_t;
/// Medium 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 mediump_float64_t;
/// Medium 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 mediump_f32;
/// Medium 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 mediump_f64;
/// High 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 highp_float32;
/// High 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 highp_float64;
/// High 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 highp_float32_t;
/// High 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 highp_float64_t;
/// High 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 highp_f32;
/// High 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 highp_f64;
#if(defined(GLM_PRECISION_LOWP_FLOAT))
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_float32 float32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_float64 float64;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_float32_t float32_t;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_float64_t float64_t;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_f32 f32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef lowp_f64 f64;
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float32 float32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float64 float64;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float32 float32_t;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float64 float64_t;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float32 f32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef mediump_float64 f64;
#else//(defined(GLM_PRECISION_HIGHP_FLOAT))
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float32 float32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float64 float64;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float32_t float32_t;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float64_t float64_t;
/// Default 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float32_t f32;
/// Default 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef highp_float64_t f64;
#endif
/// Low single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, lowp> lowp_vec1;
/// Low single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, lowp> lowp_vec2;
/// Low single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, lowp> lowp_vec3;
/// Low single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, lowp> lowp_vec4;
/// Low single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, lowp> lowp_fvec1;
/// Low single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, lowp> lowp_fvec2;
/// Low single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, lowp> lowp_fvec3;
/// Low single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, lowp> lowp_fvec4;
/// Medium single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, mediump> mediump_vec1;
/// Medium Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, mediump> mediump_vec2;
/// Medium Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, mediump> mediump_vec3;
/// Medium Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, mediump> mediump_vec4;
/// Medium single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, mediump> mediump_fvec1;
/// Medium Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, mediump> mediump_fvec2;
/// Medium Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, mediump> mediump_fvec3;
/// Medium Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, mediump> mediump_fvec4;
/// High single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, highp> highp_vec1;
/// High Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, highp> highp_vec2;
/// High Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, highp> highp_vec3;
/// High Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, highp> highp_vec4;
/// High single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, highp> highp_fvec1;
/// High Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, highp> highp_fvec2;
/// High Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, highp> highp_fvec3;
/// High Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, highp> highp_fvec4;
/// Low single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f32, lowp> lowp_f32vec1;
/// Low single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f32, lowp> lowp_f32vec2;
/// Low single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f32, lowp> lowp_f32vec3;
/// Low single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f32, lowp> lowp_f32vec4;
/// Medium single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f32, mediump> mediump_f32vec1;
/// Medium single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f32, mediump> mediump_f32vec2;
/// Medium single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f32, mediump> mediump_f32vec3;
/// Medium single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f32, mediump> mediump_f32vec4;
/// High single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f32, highp> highp_f32vec1;
/// High single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f32, highp> highp_f32vec2;
/// High single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f32, highp> highp_f32vec3;
/// High single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f32, highp> highp_f32vec4;
/// Low double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f64, lowp> lowp_f64vec1;
/// Low double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f64, lowp> lowp_f64vec2;
/// Low double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f64, lowp> lowp_f64vec3;
/// Low double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f64, lowp> lowp_f64vec4;
/// Medium double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f64, mediump> mediump_f64vec1;
/// Medium double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f64, mediump> mediump_f64vec2;
/// Medium double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f64, mediump> mediump_f64vec3;
/// Medium double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f64, mediump> mediump_f64vec4;
/// High double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f64, highp> highp_f64vec1;
/// High double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f64, highp> highp_f64vec2;
/// High double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f64, highp> highp_f64vec3;
/// High double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f64, highp> highp_f64vec4;
//////////////////////
// Float matrix types
/// Low single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef lowp_f32 lowp_fmat1x1;
/// Low single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, lowp> lowp_fmat2x2;
/// Low single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, lowp> lowp_fmat2x3;
/// Low single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, lowp> lowp_fmat2x4;
/// Low single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, lowp> lowp_fmat3x2;
/// Low single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, lowp> lowp_fmat3x3;
/// Low single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, lowp> lowp_fmat3x4;
/// Low single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, lowp> lowp_fmat4x2;
/// Low single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, lowp> lowp_fmat4x3;
/// Low single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, lowp> lowp_fmat4x4;
/// Low single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef lowp_fmat1x1 lowp_fmat1;
/// Low single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef lowp_fmat2x2 lowp_fmat2;
/// Low single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef lowp_fmat3x3 lowp_fmat3;
/// Low single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef lowp_fmat4x4 lowp_fmat4;
/// Medium single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef mediump_f32 mediump_fmat1x1;
/// Medium single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, mediump> mediump_fmat2x2;
/// Medium single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, mediump> mediump_fmat2x3;
/// Medium single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, mediump> mediump_fmat2x4;
/// Medium single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, mediump> mediump_fmat3x2;
/// Medium single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, mediump> mediump_fmat3x3;
/// Medium single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, mediump> mediump_fmat3x4;
/// Medium single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, mediump> mediump_fmat4x2;
/// Medium single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, mediump> mediump_fmat4x3;
/// Medium single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, mediump> mediump_fmat4x4;
/// Medium single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef mediump_fmat1x1 mediump_fmat1;
/// Medium single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef mediump_fmat2x2 mediump_fmat2;
/// Medium single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef mediump_fmat3x3 mediump_fmat3;
/// Medium single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef mediump_fmat4x4 mediump_fmat4;
/// High single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef highp_f32 highp_fmat1x1;
/// High single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, highp> highp_fmat2x2;
/// High single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, highp> highp_fmat2x3;
/// High single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, highp> highp_fmat2x4;
/// High single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, highp> highp_fmat3x2;
/// High single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, highp> highp_fmat3x3;
/// High single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, highp> highp_fmat3x4;
/// High single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, highp> highp_fmat4x2;
/// High single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, highp> highp_fmat4x3;
/// High single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, highp> highp_fmat4x4;
/// High single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef highp_fmat1x1 highp_fmat1;
/// High single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_fmat2x2 highp_fmat2;
/// High single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_fmat3x3 highp_fmat3;
/// High single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_fmat4x4 highp_fmat4;
/// Low single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f32 lowp_f32mat1x1;
/// Low single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, lowp> lowp_f32mat2x2;
/// Low single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, lowp> lowp_f32mat2x3;
/// Low single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, lowp> lowp_f32mat2x4;
/// Low single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, lowp> lowp_f32mat3x2;
/// Low single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, lowp> lowp_f32mat3x3;
/// Low single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, lowp> lowp_f32mat3x4;
/// Low single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, lowp> lowp_f32mat4x2;
/// Low single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, lowp> lowp_f32mat4x3;
/// Low single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, lowp> lowp_f32mat4x4;
/// Low single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32, lowp> lowp_f32mat1;
/// Low single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef lowp_f32mat2x2 lowp_f32mat2;
/// Low single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef lowp_f32mat3x3 lowp_f32mat3;
/// Low single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef lowp_f32mat4x4 lowp_f32mat4;
/// High single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f32 mediump_f32mat1x1;
/// Low single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, mediump> mediump_f32mat2x2;
/// Medium single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, mediump> mediump_f32mat2x3;
/// Medium single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, mediump> mediump_f32mat2x4;
/// Medium single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, mediump> mediump_f32mat3x2;
/// Medium single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, mediump> mediump_f32mat3x3;
/// Medium single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, mediump> mediump_f32mat3x4;
/// Medium single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, mediump> mediump_f32mat4x2;
/// Medium single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, mediump> mediump_f32mat4x3;
/// Medium single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, mediump> mediump_f32mat4x4;
/// Medium single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32, mediump> f32mat1;
/// Medium single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef mediump_f32mat2x2 mediump_f32mat2;
/// Medium single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef mediump_f32mat3x3 mediump_f32mat3;
/// Medium single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef mediump_f32mat4x4 mediump_f32mat4;
/// High single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f32 highp_f32mat1x1;
/// High single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, highp> highp_f32mat2x2;
/// High single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, highp> highp_f32mat2x3;
/// High single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, highp> highp_f32mat2x4;
/// High single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, highp> highp_f32mat3x2;
/// High single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, highp> highp_f32mat3x3;
/// High single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, highp> highp_f32mat3x4;
/// High single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, highp> highp_f32mat4x2;
/// High single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, highp> highp_f32mat4x3;
/// High single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, highp> highp_f32mat4x4;
/// High single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32, highp> f32mat1;
/// High single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x2 highp_f32mat2;
/// High single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x3 highp_f32mat3;
/// High single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x4 highp_f32mat4;
/// Low double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f64 lowp_f64mat1x1;
/// Low double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, lowp> lowp_f64mat2x2;
/// Low double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f64, lowp> lowp_f64mat2x3;
/// Low double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f64, lowp> lowp_f64mat2x4;
/// Low double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f64, lowp> lowp_f64mat3x2;
/// Low double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, lowp> lowp_f64mat3x3;
/// Low double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f64, lowp> lowp_f64mat3x4;
/// Low double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f64, lowp> lowp_f64mat4x2;
/// Low double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f64, lowp> lowp_f64mat4x3;
/// Low double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, lowp> lowp_f64mat4x4;
/// Low double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef lowp_f64mat1x1 lowp_f64mat1;
/// Low double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef lowp_f64mat2x2 lowp_f64mat2;
/// Low double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef lowp_f64mat3x3 lowp_f64mat3;
/// Low double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef lowp_f64mat4x4 lowp_f64mat4;
/// Medium double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f64 Highp_f64mat1x1;
/// Medium double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, mediump> mediump_f64mat2x2;
/// Medium double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f64, mediump> mediump_f64mat2x3;
/// Medium double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f64, mediump> mediump_f64mat2x4;
/// Medium double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f64, mediump> mediump_f64mat3x2;
/// Medium double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, mediump> mediump_f64mat3x3;
/// Medium double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f64, mediump> mediump_f64mat3x4;
/// Medium double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f64, mediump> mediump_f64mat4x2;
/// Medium double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f64, mediump> mediump_f64mat4x3;
/// Medium double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, mediump> mediump_f64mat4x4;
/// Medium double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef mediump_f64mat1x1 mediump_f64mat1;
/// Medium double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef mediump_f64mat2x2 mediump_f64mat2;
/// Medium double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef mediump_f64mat3x3 mediump_f64mat3;
/// Medium double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef mediump_f64mat4x4 mediump_f64mat4;
/// High double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f64 highp_f64mat1x1;
/// High double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, highp> highp_f64mat2x2;
/// High double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f64, highp> highp_f64mat2x3;
/// High double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f64, highp> highp_f64mat2x4;
/// High double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f64, highp> highp_f64mat3x2;
/// High double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, highp> highp_f64mat3x3;
/// High double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f64, highp> highp_f64mat3x4;
/// High double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f64, highp> highp_f64mat4x2;
/// High double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f64, highp> highp_f64mat4x3;
/// High double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, highp> highp_f64mat4x4;
/// High double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef highp_f64mat1x1 highp_f64mat1;
/// High double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_f64mat2x2 highp_f64mat2;
/// High double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_f64mat3x3 highp_f64mat3;
/// High double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_f64mat4x4 highp_f64mat4;
//////////////////////////
// Quaternion types
/// Low single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f32, lowp> lowp_f32quat;
/// Low double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f64, lowp> lowp_f64quat;
/// Medium single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f32, mediump> mediump_f32quat;
/// Medium double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f64, mediump> mediump_f64quat;
/// High single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f32, highp> highp_f32quat;
/// High double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef tquat<f64, highp> highp_f64quat;
#if(defined(GLM_PRECISION_LOWP_FLOAT))
typedef lowp_f32vec1 fvec1;
typedef lowp_f32vec2 fvec2;
typedef lowp_f32vec3 fvec3;
typedef lowp_f32vec4 fvec4;
typedef lowp_f32mat2 fmat2;
typedef lowp_f32mat3 fmat3;
typedef lowp_f32mat4 fmat4;
typedef lowp_f32mat2x2 fmat2x2;
typedef lowp_f32mat3x2 fmat3x2;
typedef lowp_f32mat4x2 fmat4x2;
typedef lowp_f32mat2x3 fmat2x3;
typedef lowp_f32mat3x3 fmat3x3;
typedef lowp_f32mat4x3 fmat4x3;
typedef lowp_f32mat2x4 fmat2x4;
typedef lowp_f32mat3x4 fmat3x4;
typedef lowp_f32mat4x4 fmat4x4;
typedef lowp_f32quat fquat;
typedef lowp_f32vec1 f32vec1;
typedef lowp_f32vec2 f32vec2;
typedef lowp_f32vec3 f32vec3;
typedef lowp_f32vec4 f32vec4;
typedef lowp_f32mat2 f32mat2;
typedef lowp_f32mat3 f32mat3;
typedef lowp_f32mat4 f32mat4;
typedef lowp_f32mat2x2 f32mat2x2;
typedef lowp_f32mat3x2 f32mat3x2;
typedef lowp_f32mat4x2 f32mat4x2;
typedef lowp_f32mat2x3 f32mat2x3;
typedef lowp_f32mat3x3 f32mat3x3;
typedef lowp_f32mat4x3 f32mat4x3;
typedef lowp_f32mat2x4 f32mat2x4;
typedef lowp_f32mat3x4 f32mat3x4;
typedef lowp_f32mat4x4 f32mat4x4;
typedef lowp_f32quat f32quat;
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
typedef mediump_f32vec1 fvec1;
typedef mediump_f32vec2 fvec2;
typedef mediump_f32vec3 fvec3;
typedef mediump_f32vec4 fvec4;
typedef mediump_f32mat2 fmat2;
typedef mediump_f32mat3 fmat3;
typedef mediump_f32mat4 fmat4;
typedef mediump_f32mat2x2 fmat2x2;
typedef mediump_f32mat3x2 fmat3x2;
typedef mediump_f32mat4x2 fmat4x2;
typedef mediump_f32mat2x3 fmat2x3;
typedef mediump_f32mat3x3 fmat3x3;
typedef mediump_f32mat4x3 fmat4x3;
typedef mediump_f32mat2x4 fmat2x4;
typedef mediump_f32mat3x4 fmat3x4;
typedef mediump_f32mat4x4 fmat4x4;
typedef mediump_f32quat fquat;
typedef mediump_f32vec1 f32vec1;
typedef mediump_f32vec2 f32vec2;
typedef mediump_f32vec3 f32vec3;
typedef mediump_f32vec4 f32vec4;
typedef mediump_f32mat2 f32mat2;
typedef mediump_f32mat3 f32mat3;
typedef mediump_f32mat4 f32mat4;
typedef mediump_f32mat2x2 f32mat2x2;
typedef mediump_f32mat3x2 f32mat3x2;
typedef mediump_f32mat4x2 f32mat4x2;
typedef mediump_f32mat2x3 f32mat2x3;
typedef mediump_f32mat3x3 f32mat3x3;
typedef mediump_f32mat4x3 f32mat4x3;
typedef mediump_f32mat2x4 f32mat2x4;
typedef mediump_f32mat3x4 f32mat3x4;
typedef mediump_f32mat4x4 f32mat4x4;
typedef mediump_f32quat f32quat;
#else//if(defined(GLM_PRECISION_HIGHP_FLOAT))
/// Default single-precision floating-point vector of 1 components.
/// @see gtc_type_precision
typedef highp_f32vec1 fvec1;
/// Default single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef highp_f32vec2 fvec2;
/// Default single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef highp_f32vec3 fvec3;
/// Default single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef highp_f32vec4 fvec4;
/// Default single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x2 fmat2x2;
/// Default single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x3 fmat2x3;
/// Default single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x4 fmat2x4;
/// Default single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x2 fmat3x2;
/// Default single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x3 fmat3x3;
/// Default single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x4 fmat3x4;
/// Default single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x2 fmat4x2;
/// Default single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x3 fmat4x3;
/// Default single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x4 fmat4x4;
/// Default single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef fmat2x2 fmat2;
/// Default single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef fmat3x3 fmat3;
/// Default single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef fmat4x4 fmat4;
/// Default single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef highp_fquat fquat;
/// Default single-precision floating-point vector of 1 components.
/// @see gtc_type_precision
typedef highp_f32vec1 f32vec1;
/// Default single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef highp_f32vec2 f32vec2;
/// Default single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef highp_f32vec3 f32vec3;
/// Default single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef highp_f32vec4 f32vec4;
/// Default single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x2 f32mat2x2;
/// Default single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x3 f32mat2x3;
/// Default single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat2x4 f32mat2x4;
/// Default single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x2 f32mat3x2;
/// Default single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x3 f32mat3x3;
/// Default single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat3x4 f32mat3x4;
/// Default single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x2 f32mat4x2;
/// Default single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x3 f32mat4x3;
/// Default single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_f32mat4x4 f32mat4x4;
/// Default single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef f32mat2x2 f32mat2;
/// Default single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef f32mat3x3 f32mat3;
/// Default single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef f32mat4x4 f32mat4;
/// Default single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef highp_f32quat f32quat;
#endif
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
typedef lowp_f64vec1 f64vec1;
typedef lowp_f64vec2 f64vec2;
typedef lowp_f64vec3 f64vec3;
typedef lowp_f64vec4 f64vec4;
typedef lowp_f64mat2 f64mat2;
typedef lowp_f64mat3 f64mat3;
typedef lowp_f64mat4 f64mat4;
typedef lowp_f64mat2x2 f64mat2x2;
typedef lowp_f64mat3x2 f64mat3x2;
typedef lowp_f64mat4x2 f64mat4x2;
typedef lowp_f64mat2x3 f64mat2x3;
typedef lowp_f64mat3x3 f64mat3x3;
typedef lowp_f64mat4x3 f64mat4x3;
typedef lowp_f64mat2x4 f64mat2x4;
typedef lowp_f64mat3x4 f64mat3x4;
typedef lowp_f64mat4x4 f64mat4x4;
typedef lowp_f64quat f64quat;
#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
typedef mediump_f64vec1 f64vec1;
typedef mediump_f64vec2 f64vec2;
typedef mediump_f64vec3 f64vec3;
typedef mediump_f64vec4 f64vec4;
typedef mediump_f64mat2 f64mat2;
typedef mediump_f64mat3 f64mat3;
typedef mediump_f64mat4 f64mat4;
typedef mediump_f64mat2x2 f64mat2x2;
typedef mediump_f64mat3x2 f64mat3x2;
typedef mediump_f64mat4x2 f64mat4x2;
typedef mediump_f64mat2x3 f64mat2x3;
typedef mediump_f64mat3x3 f64mat3x3;
typedef mediump_f64mat4x3 f64mat4x3;
typedef mediump_f64mat2x4 f64mat2x4;
typedef mediump_f64mat3x4 f64mat3x4;
typedef mediump_f64mat4x4 f64mat4x4;
typedef mediump_f64quat f64quat;
#else
/// Default double-precision floating-point vector of 1 components.
/// @see gtc_type_precision
typedef highp_f64vec1 f64vec1;
/// Default double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef highp_f64vec2 f64vec2;
/// Default double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef highp_f64vec3 f64vec3;
/// Default double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef highp_f64vec4 f64vec4;
/// Default double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef highp_f64mat2x2 f64mat2x2;
/// Default double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef highp_f64mat2x3 f64mat2x3;
/// Default double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef highp_f64mat2x4 f64mat2x4;
/// Default double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef highp_f64mat3x2 f64mat3x2;
/// Default double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef highp_f64mat3x3 f64mat3x3;
/// Default double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef highp_f64mat3x4 f64mat3x4;
/// Default double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef highp_f64mat4x2 f64mat4x2;
/// Default double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef highp_f64mat4x3 f64mat4x3;
/// Default double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef highp_f64mat4x4 f64mat4x4;
/// Default double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef f64mat2x2 f64mat2;
/// Default double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef f64mat3x3 f64mat3;
/// Default double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef f64mat4x4 f64mat4;
/// Default double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef highp_f64quat f64quat;
#endif
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/geometric.hpp
/// @date 2013-12-24 / 2013-12-24
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "detail/func_geometric.hpp"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref core
/// @file glm/glm.hpp
/// @date 2005-01-14 / 2011-10-24
/// @author Christophe Riccio
///
/// @defgroup core GLM Core
///
/// @brief The core of GLM, which implements exactly and only the GLSL specification to the degree possible.
///
/// The GLM core consists of @ref core_types "C++ types that mirror GLSL types" and
/// C++ functions that mirror the GLSL functions. It also includes
/// @ref core_precision "a set of precision-based types" that can be used in the appropriate
/// functions. The C++ types are all based on a basic set of @ref core_template "template types".
///
/// The best documentation for GLM Core is the current GLSL specification,
/// <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.clean.pdf">version 4.2
/// (pdf file)</a>.
///
/// GLM core functionnalities require <glm/glm.hpp> to be included to be used.
///
/// @defgroup core_types Types
///
/// @brief The standard types defined by the specification.
///
/// These types are all typedefs of more generalized, template types. To see the definiton
/// of these template types, go to @ref core_template.
///
/// @ingroup core
///
/// @defgroup core_precision Precision types
///
/// @brief Non-GLSL types that are used to define precision-based types.
///
/// The GLSL language allows the user to define the precision of a particular variable.
/// In OpenGL's GLSL, these precision qualifiers have no effect; they are there for compatibility
/// with OpenGL ES's precision qualifiers, where they @em do have an effect.
///
/// C++ has no language equivalent to precision qualifiers. So GLM provides the next-best thing:
/// a number of typedefs of the @ref core_template that use a particular precision.
///
/// None of these types make any guarantees about the actual precision used.
///
/// @ingroup core
///
/// @defgroup core_template Template types
///
/// @brief The generic template types used as the basis for the core types.
///
/// These types are all templates used to define the actual @ref core_types.
/// These templetes are implementation details of GLM types and should not be used explicitly.
///
/// @ingroup core
///////////////////////////////////////////////////////////////////////////////////
#include "detail/_fixes.hpp"
#pragma once
#include <cmath>
#include <climits>
#include <cfloat>
#include <limits>
#include <cassert>
#include "fwd.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
# pragma message("GLM: Core library included")
#endif//GLM_MESSAGE
#include "vec2.hpp"
#include "vec3.hpp"
#include "vec4.hpp"
#include "mat2x2.hpp"
#include "mat2x3.hpp"
#include "mat2x4.hpp"
#include "mat3x2.hpp"
#include "mat3x3.hpp"
#include "mat3x4.hpp"
#include "mat4x2.hpp"
#include "mat4x3.hpp"
#include "mat4x4.hpp"
#include "trigonometric.hpp"
#include "exponential.hpp"
#include "common.hpp"
#include "packing.hpp"
#include "geometric.hpp"
#include "matrix.hpp"
#include "vector_relational.hpp"
#include "integer.hpp"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_bitfield
/// @file glm/gtc/bitfield.hpp
/// @date 2014-10-25 / 2014-10-25
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_bitfield (dependence)
///
/// @defgroup gtc_bitfield GLM_GTC_bitfield
/// @ingroup gtc
///
/// @brief Allow to perform bit operations on integer values
///
/// <glm/gtc/bitfield.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#include "../detail/precision.hpp"
#include "../detail/type_int.hpp"
#include "../detail/_vectorize.hpp"
#include <limits>
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTC_bitfield extension included")
#endif
namespace glm
{
/// @addtogroup gtc_bitfield
/// @{
/// Build a mask of 'count' bits
///
/// @see gtc_bitfield
template <typename genIUType>
GLM_FUNC_DECL genIUType mask(genIUType Bits);
/// Build a mask of 'count' bits
///
/// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecIUType>
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
///
/// @see gtc_bitfield
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
///
/// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift);
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
///
/// @see gtc_bitfield
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
///
/// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift);
/// Set to 1 a range of bits.
///
/// @see gtc_bitfield
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
/// Set to 1 a range of bits.
///
/// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount);
/// Set to 0 a range of bits.
///
/// @see gtc_bitfield
template <typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
/// Set to 0 a range of bits.
///
/// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z);
/// Interleaves the bits of x, y and z.
/// The first bit is the first bit of x followed by the first bit of y and the first bit of z.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z);
/// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w);
/// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w);
/// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w);
/// Interleaves the bits of x, y, z and w.
/// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w.
/// The other bits are interleaved following the previous sequence.
///
/// @see gtc_bitfield
GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w);
/// @}
} //namespace glm
#include "bitfield.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_bitfield
/// @file glm/gtc/bitfield.inl
/// @date 2011-10-14 / 2012-01-25
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y);
template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z);
template <typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w);
template <>
GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y)
{
glm::uint16 REG1(x);
glm::uint16 REG2(y);
REG1 = ((REG1 << 4) | REG1) & glm::uint16(0x0F0F);
REG2 = ((REG2 << 4) | REG2) & glm::uint16(0x0F0F);
REG1 = ((REG1 << 2) | REG1) & glm::uint16(0x3333);
REG2 = ((REG2 << 2) | REG2) & glm::uint16(0x3333);
REG1 = ((REG1 << 1) | REG1) & glm::uint16(0x5555);
REG2 = ((REG2 << 1) | REG2) & glm::uint16(0x5555);
return REG1 | (REG2 << 1);
}
template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y)
{
glm::uint32 REG1(x);
glm::uint32 REG2(y);
REG1 = ((REG1 << 8) | REG1) & glm::uint32(0x00FF00FF);
REG2 = ((REG2 << 8) | REG2) & glm::uint32(0x00FF00FF);
REG1 = ((REG1 << 4) | REG1) & glm::uint32(0x0F0F0F0F);
REG2 = ((REG2 << 4) | REG2) & glm::uint32(0x0F0F0F0F);
REG1 = ((REG1 << 2) | REG1) & glm::uint32(0x33333333);
REG2 = ((REG2 << 2) | REG2) & glm::uint32(0x33333333);
REG1 = ((REG1 << 1) | REG1) & glm::uint32(0x55555555);
REG2 = ((REG2 << 1) | REG2) & glm::uint32(0x55555555);
return REG1 | (REG2 << 1);
}
template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y)
{
glm::uint64 REG1(x);
glm::uint64 REG2(y);
REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
return REG1 | (REG2 << 1);
}
template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z)
{
glm::uint32 REG1(x);
glm::uint32 REG2(y);
glm::uint32 REG3(z);
REG1 = ((REG1 << 16) | REG1) & glm::uint32(0x00FF0000FF0000FF);
REG2 = ((REG2 << 16) | REG2) & glm::uint32(0x00FF0000FF0000FF);
REG3 = ((REG3 << 16) | REG3) & glm::uint32(0x00FF0000FF0000FF);
REG1 = ((REG1 << 8) | REG1) & glm::uint32(0xF00F00F00F00F00F);
REG2 = ((REG2 << 8) | REG2) & glm::uint32(0xF00F00F00F00F00F);
REG3 = ((REG3 << 8) | REG3) & glm::uint32(0xF00F00F00F00F00F);
REG1 = ((REG1 << 4) | REG1) & glm::uint32(0x30C30C30C30C30C3);
REG2 = ((REG2 << 4) | REG2) & glm::uint32(0x30C30C30C30C30C3);
REG3 = ((REG3 << 4) | REG3) & glm::uint32(0x30C30C30C30C30C3);
REG1 = ((REG1 << 2) | REG1) & glm::uint32(0x9249249249249249);
REG2 = ((REG2 << 2) | REG2) & glm::uint32(0x9249249249249249);
REG3 = ((REG3 << 2) | REG3) & glm::uint32(0x9249249249249249);
return REG1 | (REG2 << 1) | (REG3 << 2);
}
template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z)
{
glm::uint64 REG1(x);
glm::uint64 REG2(y);
glm::uint64 REG3(z);
REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF);
REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF);
REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF);
REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF);
REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF);
REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF);
REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F);
REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F);
REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F);
REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3);
REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3);
REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3);
REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249);
REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249);
REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249);
return REG1 | (REG2 << 1) | (REG3 << 2);
}
template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z)
{
glm::uint64 REG1(x);
glm::uint64 REG2(y);
glm::uint64 REG3(z);
REG1 = ((REG1 << 32) | REG1) & glm::uint64(0xFFFF00000000FFFF);
REG2 = ((REG2 << 32) | REG2) & glm::uint64(0xFFFF00000000FFFF);
REG3 = ((REG3 << 32) | REG3) & glm::uint64(0xFFFF00000000FFFF);
REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x00FF0000FF0000FF);
REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x00FF0000FF0000FF);
REG3 = ((REG3 << 16) | REG3) & glm::uint64(0x00FF0000FF0000FF);
REG1 = ((REG1 << 8) | REG1) & glm::uint64(0xF00F00F00F00F00F);
REG2 = ((REG2 << 8) | REG2) & glm::uint64(0xF00F00F00F00F00F);
REG3 = ((REG3 << 8) | REG3) & glm::uint64(0xF00F00F00F00F00F);
REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x30C30C30C30C30C3);
REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x30C30C30C30C30C3);
REG3 = ((REG3 << 4) | REG3) & glm::uint64(0x30C30C30C30C30C3);
REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x9249249249249249);
REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x9249249249249249);
REG3 = ((REG3 << 2) | REG3) & glm::uint64(0x9249249249249249);
return REG1 | (REG2 << 1) | (REG3 << 2);
}
template <>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w)
{
glm::uint32 REG1(x);
glm::uint32 REG2(y);
glm::uint32 REG3(z);
glm::uint32 REG4(w);
REG1 = ((REG1 << 12) | REG1) & glm::uint32(0x000F000F000F000F);
REG2 = ((REG2 << 12) | REG2) & glm::uint32(0x000F000F000F000F);
REG3 = ((REG3 << 12) | REG3) & glm::uint32(0x000F000F000F000F);
REG4 = ((REG4 << 12) | REG4) & glm::uint32(0x000F000F000F000F);
REG1 = ((REG1 << 6) | REG1) & glm::uint32(0x0303030303030303);
REG2 = ((REG2 << 6) | REG2) & glm::uint32(0x0303030303030303);
REG3 = ((REG3 << 6) | REG3) & glm::uint32(0x0303030303030303);
REG4 = ((REG4 << 6) | REG4) & glm::uint32(0x0303030303030303);
REG1 = ((REG1 << 3) | REG1) & glm::uint32(0x1111111111111111);
REG2 = ((REG2 << 3) | REG2) & glm::uint32(0x1111111111111111);
REG3 = ((REG3 << 3) | REG3) & glm::uint32(0x1111111111111111);
REG4 = ((REG4 << 3) | REG4) & glm::uint32(0x1111111111111111);
return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3);
}
template <>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w)
{
glm::uint64 REG1(x);
glm::uint64 REG2(y);
glm::uint64 REG3(z);
glm::uint64 REG4(w);
REG1 = ((REG1 << 24) | REG1) & glm::uint64(0x000000FF000000FF);
REG2 = ((REG2 << 24) | REG2) & glm::uint64(0x000000FF000000FF);
REG3 = ((REG3 << 24) | REG3) & glm::uint64(0x000000FF000000FF);
REG4 = ((REG4 << 24) | REG4) & glm::uint64(0x000000FF000000FF);
REG1 = ((REG1 << 12) | REG1) & glm::uint64(0x000F000F000F000F);
REG2 = ((REG2 << 12) | REG2) & glm::uint64(0x000F000F000F000F);
REG3 = ((REG3 << 12) | REG3) & glm::uint64(0x000F000F000F000F);
REG4 = ((REG4 << 12) | REG4) & glm::uint64(0x000F000F000F000F);
REG1 = ((REG1 << 6) | REG1) & glm::uint64(0x0303030303030303);
REG2 = ((REG2 << 6) | REG2) & glm::uint64(0x0303030303030303);
REG3 = ((REG3 << 6) | REG3) & glm::uint64(0x0303030303030303);
REG4 = ((REG4 << 6) | REG4) & glm::uint64(0x0303030303030303);
REG1 = ((REG1 << 3) | REG1) & glm::uint64(0x1111111111111111);
REG2 = ((REG2 << 3) | REG2) & glm::uint64(0x1111111111111111);
REG3 = ((REG3 << 3) | REG3) & glm::uint64(0x1111111111111111);
REG4 = ((REG4 << 3) | REG4) & glm::uint64(0x1111111111111111);
return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3);
}
}//namespace detail
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values");
return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1);
}
template <typename T, precision P, template <typename, precision> class vecIUType>
GLM_FUNC_QUALIFIER vecIUType<T, P> mask(vecIUType<T, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
return detail::functor1<T, T, P, vecIUType>::call(mask, v);
}
template <typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values");
int const BitSize = static_cast<genIType>(sizeof(genIType) * 8);
return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateRight(vecType<T, P> const & In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
int const BitSize = static_cast<int>(sizeof(T) * 8);
return (In << static_cast<T>(Shift)) | (In >> static_cast<T>(BitSize - Shift));
}
template <typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
int const BitSize = static_cast<genIType>(sizeof(genIType) * 8);
return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldRotateLeft(vecType<T, P> const & In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
int const BitSize = static_cast<int>(sizeof(T) * 8);
return (In >> static_cast<T>(Shift)) | (In << static_cast<T>(BitSize - Shift));
}
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount)
{
return Value | static_cast<genIUType>(mask(BitCount) << FirstBit);
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillOne(vecType<T, P> const & Value, int FirstBit, int BitCount)
{
return Value | static_cast<T>(mask(BitCount) << FirstBit);
}
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount)
{
return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> bitfieldFillZero(vecType<T, P> const & Value, int FirstBit, int BitCount)
{
return Value & static_cast<T>(~(mask(BitCount) << FirstBit));
}
GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y)
{
union sign8
{
int8 i;
uint8 u;
} sign_x, sign_y;
union sign16
{
int16 i;
uint16 u;
} result;
sign_x.i = x;
sign_y.i = y;
result.u = bitfieldInterleave(sign_x.u, sign_y.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y)
{
return detail::bitfieldInterleave<uint8, uint16>(x, y);
}
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y)
{
union sign16
{
int16 i;
uint16 u;
} sign_x, sign_y;
union sign32
{
int32 i;
uint32 u;
} result;
sign_x.i = x;
sign_y.i = y;
result.u = bitfieldInterleave(sign_x.u, sign_y.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y)
{
return detail::bitfieldInterleave<uint16, uint32>(x, y);
}
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y)
{
union sign32
{
int32 i;
uint32 u;
} sign_x, sign_y;
union sign64
{
int64 i;
uint64 u;
} result;
sign_x.i = x;
sign_y.i = y;
result.u = bitfieldInterleave(sign_x.u, sign_y.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y)
{
return detail::bitfieldInterleave<uint32, uint64>(x, y);
}
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z)
{
union sign8
{
int8 i;
uint8 u;
} sign_x, sign_y, sign_z;
union sign32
{
int32 i;
uint32 u;
} result;
sign_x.i = x;
sign_y.i = y;
sign_z.i = z;
result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z)
{
return detail::bitfieldInterleave<uint8, uint32>(x, y, z);
}
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z)
{
union sign16
{
int16 i;
uint16 u;
} sign_x, sign_y, sign_z;
union sign64
{
int64 i;
uint64 u;
} result;
sign_x.i = x;
sign_y.i = y;
sign_z.i = z;
result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z)
{
return detail::bitfieldInterleave<uint32, uint64>(x, y, z);
}
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z)
{
union sign16
{
int32 i;
uint32 u;
} sign_x, sign_y, sign_z;
union sign64
{
int64 i;
uint64 u;
} result;
sign_x.i = x;
sign_y.i = y;
sign_z.i = z;
result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z)
{
return detail::bitfieldInterleave<uint32, uint64>(x, y, z);
}
GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w)
{
union sign8
{
int8 i;
uint8 u;
} sign_x, sign_y, sign_z, sign_w;
union sign32
{
int32 i;
uint32 u;
} result;
sign_x.i = x;
sign_y.i = y;
sign_z.i = z;
sign_w.i = w;
result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w)
{
return detail::bitfieldInterleave<uint8, uint32>(x, y, z, w);
}
GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w)
{
union sign16
{
int16 i;
uint16 u;
} sign_x, sign_y, sign_z, sign_w;
union sign64
{
int64 i;
uint64 u;
} result;
sign_x.i = x;
sign_y.i = y;
sign_z.i = z;
sign_w.i = w;
result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u);
return result.i;
}
GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w)
{
return detail::bitfieldInterleave<uint16, uint64>(x, y, z, w);
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_constants
/// @file glm/gtc/constants.hpp
/// @date 2011-09-30 / 2012-01-25
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
///
/// @defgroup gtc_constants GLM_GTC_constants
/// @ingroup gtc
///
/// @brief Provide a list of constants and precomputed useful values.
///
/// <glm/gtc/constants.hpp> need to be included to use these features.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTC_constants extension included")
#endif
namespace glm
{
/// @addtogroup gtc_constants
/// @{
/// Return the epsilon constant for floating point types.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType epsilon();
/// Return 0.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType zero();
/// Return 1.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType one();
/// Return the pi constant.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType pi();
/// Return pi * 2.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType two_pi();
/// Return square root of pi.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_pi();
/// Return pi / 2.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType half_pi();
/// Return pi / 2 * 3.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType three_over_two_pi();
/// Return pi / 4.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType quarter_pi();
/// Return 1 / pi.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType one_over_pi();
/// Return 1 / (pi * 2).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType one_over_two_pi();
/// Return 2 / pi.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType two_over_pi();
/// Return 4 / pi.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType four_over_pi();
/// Return 2 / sqrt(pi).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType two_over_root_pi();
/// Return 1 / sqrt(2).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType one_over_root_two();
/// Return sqrt(pi / 2).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_half_pi();
/// Return sqrt(2 * pi).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_two_pi();
/// Return sqrt(ln(4)).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_ln_four();
/// Return e constant.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType e();
/// Return Euler's constant.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType euler();
/// Return sqrt(2).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_two();
/// Return sqrt(3).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_three();
/// Return sqrt(5).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType root_five();
/// Return ln(2).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType ln_two();
/// Return ln(10).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType ln_ten();
/// Return ln(ln(2)).
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType ln_ln_two();
/// Return 1 / 3.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType third();
/// Return 2 / 3.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType two_thirds();
/// Return the golden ratio constant.
/// @see gtc_constants
template <typename genType>
GLM_FUNC_DECL genType golden_ratio();
/// @}
} //namespace glm
#include "constants.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_constants
/// @file glm/gtc/constants.inl
/// @date 2011-10-14 / 2014-10-25
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
#include <limits>
namespace glm
{
template <typename genType>
GLM_FUNC_QUALIFIER genType epsilon()
{
return std::numeric_limits<genType>::epsilon();
}
template <typename genType>
GLM_FUNC_QUALIFIER genType zero()
{
return genType(0);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType one()
{
return genType(1);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType pi()
{
return genType(3.14159265358979323846264338327950288);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType two_pi()
{
return genType(6.28318530717958647692528676655900576);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_pi()
{
return genType(1.772453850905516027);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType half_pi()
{
return genType(1.57079632679489661923132169163975144);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType three_over_two_pi()
{
return genType(4.71238898038468985769396507491925432);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType quarter_pi()
{
return genType(0.785398163397448309615660845819875721);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType one_over_pi()
{
return genType(0.318309886183790671537767526745028724);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType one_over_two_pi()
{
return genType(0.159154943091895335768883763372514362);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType two_over_pi()
{
return genType(0.636619772367581343075535053490057448);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType four_over_pi()
{
return genType(1.273239544735162686151070106980114898);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType two_over_root_pi()
{
return genType(1.12837916709551257389615890312154517);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType one_over_root_two()
{
return genType(0.707106781186547524400844362104849039);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_half_pi()
{
return genType(1.253314137315500251);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_two_pi()
{
return genType(2.506628274631000502);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_ln_four()
{
return genType(1.17741002251547469);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType e()
{
return genType(2.71828182845904523536);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType euler()
{
return genType(0.577215664901532860606);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_two()
{
return genType(1.41421356237309504880168872420969808);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_three()
{
return genType(1.73205080756887729352744634150587236);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType root_five()
{
return genType(2.23606797749978969640917366873127623);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType ln_two()
{
return genType(0.693147180559945309417232121458176568);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType ln_ten()
{
return genType(2.30258509299404568401799145468436421);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType ln_ln_two()
{
return genType(-0.3665129205816643);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType third()
{
return genType(0.3333333333333333333333333333333333333333);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType two_thirds()
{
return genType(0.666666666666666666666666666666666666667);
}
template <typename genType>
GLM_FUNC_QUALIFIER genType golden_ratio()
{
return genType(1.61803398874989484820458683436563811);
}
} //namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_epsilon
/// @file glm/gtc/epsilon.hpp
/// @date 2012-04-07 / 2012-04-07
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_half_float (dependence)
/// @see gtc_quaternion (dependence)
///
/// @defgroup gtc_epsilon GLM_GTC_epsilon
/// @ingroup gtc
///
/// @brief Comparison functions for a user defined epsilon values.
///
/// <glm/gtc/epsilon.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#include "../detail/precision.hpp"
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTC_epsilon extension included")
#endif
namespace glm
{
/// @addtogroup gtc_epsilon
/// @{
/// Returns the component-wise comparison of |x - y| < epsilon.
/// True if this expression is satisfied.
///
/// @see gtc_epsilon
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> epsilonEqual(
vecType<T, P> const & x,
vecType<T, P> const & y,
T const & epsilon);
/// Returns the component-wise comparison of |x - y| < epsilon.
/// True if this expression is satisfied.
///
/// @see gtc_epsilon
template <typename genType>
GLM_FUNC_DECL bool epsilonEqual(
genType const & x,
genType const & y,
genType const & epsilon);
/// Returns the component-wise comparison of |x - y| < epsilon.
/// True if this expression is not satisfied.
///
/// @see gtc_epsilon
template <typename genType>
GLM_FUNC_DECL typename genType::boolType epsilonNotEqual(
genType const & x,
genType const & y,
typename genType::value_type const & epsilon);
/// Returns the component-wise comparison of |x - y| >= epsilon.
/// True if this expression is not satisfied.
///
/// @see gtc_epsilon
template <typename genType>
GLM_FUNC_DECL bool epsilonNotEqual(
genType const & x,
genType const & y,
genType const & epsilon);
/// @}
}//namespace glm
#include "epsilon.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_epsilon
/// @file glm/gtc/epsilon.inl
/// @date 2012-04-07 / 2012-04-07
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
// Dependency:
#include "quaternion.hpp"
#include "../vector_relational.hpp"
#include "../common.hpp"
#include "../vec2.hpp"
#include "../vec3.hpp"
#include "../vec4.hpp"
namespace glm
{
template <>
GLM_FUNC_QUALIFIER bool epsilonEqual
(
float const & x,
float const & y,
float const & epsilon
)
{
return abs(x - y) < epsilon;
}
template <>
GLM_FUNC_QUALIFIER bool epsilonEqual
(
double const & x,
double const & y,
double const & epsilon
)
{
return abs(x - y) < epsilon;
}
template <>
GLM_FUNC_QUALIFIER bool epsilonNotEqual
(
float const & x,
float const & y,
float const & epsilon
)
{
return abs(x - y) >= epsilon;
}
template <>
GLM_FUNC_QUALIFIER bool epsilonNotEqual
(
double const & x,
double const & y,
double const & epsilon
)
{
return abs(x - y) >= epsilon;
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> epsilonEqual
(
vecType<T, P> const & x,
vecType<T, P> const & y,
T const & epsilon
)
{
return lessThan(abs(x - y), vecType<T, P>(epsilon));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> epsilonEqual
(
vecType<T, P> const & x,
vecType<T, P> const & y,
vecType<T, P> const & epsilon
)
{
return lessThan(abs(x - y), vecType<T, P>(epsilon));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> epsilonNotEqual
(
vecType<T, P> const & x,
vecType<T, P> const & y,
T const & epsilon
)
{
return greaterThanEqual(abs(x - y), vecType<T, P>(epsilon));
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> epsilonNotEqual
(
vecType<T, P> const & x,
vecType<T, P> const & y,
vecType<T, P> const & epsilon
)
{
return greaterThanEqual(abs(x - y), vecType<T, P>(epsilon));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<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));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<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));
}
}//namespace glm
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_integer
/// @file glm/gtc/integer.hpp
/// @date 2014-11-17 / 2014-11-17
/// @author Christophe Riccio
///
/// @see core (dependence)
/// @see gtc_integer (dependence)
///
/// @defgroup gtc_integer GLM_GTC_integer
/// @ingroup gtc
///
/// @brief Allow to perform bit operations on integer values
///
/// <glm/gtc/integer.hpp> need to be included to use these functionalities.
///////////////////////////////////////////////////////////////////////////////////
#pragma once
// Dependencies
#include "../detail/setup.hpp"
#include "../detail/precision.hpp"
#include "../detail/func_common.hpp"
#include "../detail/func_integer.hpp"
#include "../detail/func_exponential.hpp"
#include <limits>
#if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
# pragma message("GLM: GLM_GTC_integer extension included")
#endif
namespace glm
{
/// @addtogroup gtc_integer
/// @{
/// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size.
/// @see gtc_integer
template <typename genIUType>
GLM_FUNC_DECL genIUType log2(genIUType x);
/// Modulus. Returns x % y
/// for each component in x using the floating point value y.
///
/// @tparam genIUType Integer-point scalar or vector types.
///
/// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genIUType>
GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y);
/// Modulus. Returns x % y
/// for each component in x using the floating point value y.
///
/// @tparam T Integer scalar types.
/// @tparam vecType vector types.
///
/// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y);
/// Modulus. Returns x % y
/// for each component in x using the floating point value y.
///
/// @tparam T Integer scalar types.
/// @tparam vecType vector types.
///
/// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y);
/// @}
} //namespace glm
#include "integer.inl"
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// Restrictions:
/// By making use of the Software for military purposes, you choose to make
/// a Bunny unhappy.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
///
/// @ref gtc_integer
/// @file glm/gtc/integer.inl
/// @date 2014-11-17 / 2014-11-17
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm{
namespace detail
{
template <typename T, precision P, template <class, precision> class vecType>
struct compute_log2<T, P, vecType, false>
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec)
{
//Equivalent to return findMSB(vec); but save one function call in ASM with VC
//return findMSB(vec);
return vecType<T, P>(detail::compute_findMSB_vec<T, P, vecType, sizeof(T) * 8>::call(vec));
}
};
# if GLM_HAS_BITSCAN_WINDOWS
template <precision P>
struct compute_log2<int, P, tvec4, false>
{
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec)
{
tvec4<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);
return Result;
}
};
# endif//GLM_HAS_BITSCAN_WINDOWS
template <typename T, precision P, template <class, precision> class vecType, typename genType>
struct compute_mod<T, P, vecType, genType, false>
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b)
{
return a % b;
}
};
}//namespace detail
}//namespace glm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment