mirror of
https://github.com/g-truc/glm.git
synced 2024-11-09 20:21:47 +00:00
More consistent coding style
This commit is contained in:
parent
d1afe662be
commit
e76fca75a0
@ -12,73 +12,73 @@ namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T mod289(T const & x)
|
||||
GLM_FUNC_QUALIFIER T mod289(T const& x)
|
||||
{
|
||||
return x - floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) * static_cast<T>(289.0);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T permute(T const & x)
|
||||
GLM_FUNC_QUALIFIER T permute(T const& x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const& x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const& x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const& x)
|
||||
{
|
||||
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
|
||||
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const & r)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const& r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const & r)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const& r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const & r)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const& r)
|
||||
{
|
||||
return T(1.79284291400159) - T(0.85373472095314) * r;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const & t)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const& t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const & t)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const& t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const & t)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const& t)
|
||||
{
|
||||
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ namespace detail
|
||||
{
|
||||
struct Stub {};
|
||||
|
||||
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; }
|
||||
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
|
||||
|
||||
GLM_FUNC_QUALIFIER T operator[] (size_t i) const
|
||||
{
|
||||
|
@ -17,7 +17,7 @@ namespace detail
|
||||
template<typename R, typename T, qualifier P>
|
||||
struct functor1<1, R, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, R, P>(Func(v.x));
|
||||
}
|
||||
@ -26,7 +26,7 @@ namespace detail
|
||||
template<typename R, typename T, qualifier P>
|
||||
struct functor1<2, R, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, R, P>(Func(v.x), Func(v.y));
|
||||
}
|
||||
@ -35,7 +35,7 @@ namespace detail
|
||||
template<typename R, typename T, qualifier P>
|
||||
struct functor1<3, R, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, R, P>(Func(v.x), Func(v.y), Func(v.z));
|
||||
}
|
||||
@ -44,7 +44,7 @@ namespace detail
|
||||
template<typename R, typename T, qualifier P>
|
||||
struct functor1<4, R, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
|
||||
}
|
||||
@ -56,7 +56,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2<1, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, vec<1, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const& a, vec<1, T, P> const& b)
|
||||
{
|
||||
return vec<1, T, P>(Func(a.x, b.x));
|
||||
}
|
||||
@ -65,7 +65,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2<2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, vec<2, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const& a, vec<2, T, P> const& b)
|
||||
{
|
||||
return vec<2, T, P>(Func(a.x, b.x), Func(a.y, b.y));
|
||||
}
|
||||
@ -74,7 +74,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2<3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, vec<3, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const& a, vec<3, T, P> const& b)
|
||||
{
|
||||
return vec<3, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
|
||||
}
|
||||
@ -83,7 +83,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2<4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
|
||||
}
|
||||
@ -95,7 +95,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2_vec_sca<1, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, T b)
|
||||
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const& a, T b)
|
||||
{
|
||||
return vec<1, T, P>(Func(a.x, b));
|
||||
}
|
||||
@ -104,7 +104,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2_vec_sca<2, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, T b)
|
||||
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const& a, T b)
|
||||
{
|
||||
return vec<2, T, P>(Func(a.x, b), Func(a.y, b));
|
||||
}
|
||||
@ -113,7 +113,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2_vec_sca<3, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, T b)
|
||||
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const& a, T b)
|
||||
{
|
||||
return vec<3, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
|
||||
}
|
||||
@ -122,7 +122,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct functor2_vec_sca<4, T, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, T b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const& a, T b)
|
||||
{
|
||||
return vec<4, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ struct light
|
||||
|
||||
glm::vec3 computeNormal
|
||||
(
|
||||
glm::vec3 const & a,
|
||||
glm::vec3 const & b,
|
||||
glm::vec3 const & c
|
||||
glm::vec3 const& a,
|
||||
glm::vec3 const& b,
|
||||
glm::vec3 const& c
|
||||
)
|
||||
{
|
||||
return glm::normalize(glm::cross(c - a, b - a));
|
||||
@ -62,7 +62,7 @@ void glUniformMatrix4fv(GLuint, int, int, float*){}
|
||||
#include <glm/mat4x4.hpp> // glm::mat4
|
||||
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
|
||||
#include <glm/gtc/type_ptr.hpp> // glm::value_ptr
|
||||
void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate)
|
||||
void func(GLuint LocationMVP, float Translate, glm::vec2 const& Rotate)
|
||||
{
|
||||
glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f);
|
||||
glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
|
||||
@ -132,10 +132,10 @@ struct intersection
|
||||
#include <glm/gtc/random.hpp>// glm::vecRand3
|
||||
glm::vec3 lighting
|
||||
(
|
||||
intersection const & Intersection,
|
||||
material const & Material,
|
||||
light const & Light,
|
||||
glm::vec3 const & View
|
||||
intersection const& Intersection,
|
||||
material const& Material,
|
||||
light const& Light,
|
||||
glm::vec3 const& View
|
||||
)
|
||||
{
|
||||
glm::vec3 Color(0.0f);
|
||||
|
@ -264,7 +264,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp 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<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const & x, T minVal, T maxVal);
|
||||
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const& x, T minVal, T maxVal);
|
||||
|
||||
/// Returns min(max(x, minVal), maxVal) for each component in x
|
||||
/// using the floating-point values minVal and maxVal.
|
||||
@ -419,7 +419,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt 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>
|
||||
GLM_FUNC_DECL int floatBitsToInt(float const & v);
|
||||
GLM_FUNC_DECL int floatBitsToInt(float const& v);
|
||||
|
||||
/// Returns a signed integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
@ -439,7 +439,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint 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>
|
||||
GLM_FUNC_DECL uint floatBitsToUint(float const & v);
|
||||
GLM_FUNC_DECL uint floatBitsToUint(float const& v);
|
||||
|
||||
/// Returns a unsigned integer value representing
|
||||
/// the encoding of a floating-point value. The floatingpoint
|
||||
@ -461,7 +461,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat 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>
|
||||
GLM_FUNC_DECL float intBitsToFloat(int const & v);
|
||||
GLM_FUNC_DECL float intBitsToFloat(int const& v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a signed
|
||||
/// integer encoding of a floating-point value.
|
||||
@ -485,7 +485,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat 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>
|
||||
GLM_FUNC_DECL float uintBitsToFloat(uint const & v);
|
||||
GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
|
||||
|
||||
/// Returns a floating-point value corresponding to a
|
||||
/// unsigned integer encoding of a floating-point value.
|
||||
|
@ -110,7 +110,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier P, bool Aligned>
|
||||
struct compute_abs_vector
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(abs, x);
|
||||
}
|
||||
@ -312,7 +312,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> abs(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> abs(vec<L, T, P> const& x)
|
||||
{
|
||||
return detail::compute_abs_vector<L, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
@ -406,7 +406,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundEven(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundEven(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(roundEven, x);
|
||||
@ -415,7 +415,7 @@ namespace detail
|
||||
// ceil
|
||||
using ::std::ceil;
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> ceil(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> ceil(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs");
|
||||
return detail::compute_ceil<L, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
@ -429,7 +429,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fract(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fract(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs");
|
||||
return detail::compute_fract<L, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
@ -449,7 +449,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> mod(vec<L, T, P> const & x, T y)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> mod(vec<L, T, P> const& x, T y)
|
||||
{
|
||||
return detail::compute_mod<L, T, P, detail::is_aligned<P>::value>::call(x, vec<L, T, P>(y));
|
||||
}
|
||||
@ -469,14 +469,14 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const & x, vec<1, T, P> & i)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const& x, vec<1, T, P> & i)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
modf(x.x, i.x));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const & x, vec<2, T, P> & i)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const& x, vec<2, T, P> & i)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
modf(x.x, i.x),
|
||||
@ -484,7 +484,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const & x, vec<3, T, P> & i)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const& x, vec<3, T, P> & i)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
modf(x.x, i.x),
|
||||
@ -493,7 +493,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const & x, vec<4, T, P> & i)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const& x, vec<4, T, P> & i)
|
||||
{
|
||||
return vec<4, T, P>(
|
||||
modf(x.x, i.x),
|
||||
@ -512,7 +512,7 @@ namespace detail
|
||||
|
||||
// min
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> min(vec<L, T, P> const & a, T b)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> min(vec<L, T, P> const& a, T b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
|
||||
return detail::compute_min_vector<L, T, P, detail::is_aligned<P>::value>::call(a, vec<L, T, P>(b));
|
||||
@ -533,7 +533,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> max(vec<L, T, P> const& a, vec<L, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> max(vec<L, T, P> const& a, vec<L, T, P> const& b)
|
||||
{
|
||||
return detail::compute_max_vector<L, T, P, detail::is_aligned<P>::value>::call(a, b);
|
||||
}
|
||||
@ -547,7 +547,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> clamp(vec<L, T, P> const & x, T minVal, T maxVal)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> clamp(vec<L, T, P> const& x, T minVal, T maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
||||
return detail::compute_clamp_vector<L, T, P, detail::is_aligned<P>::value>::call(x, vec<L, T, P>(minVal), vec<L, T, P>(maxVal));
|
||||
@ -732,7 +732,7 @@ namespace detail
|
||||
return reinterpret_cast<vec<L, uint, P>&>(const_cast<vec<L, float, P>&>(v));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v)
|
||||
GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_abs_vector<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_abs(v.data);
|
||||
@ -24,7 +24,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_abs_vector<4, int, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v)
|
||||
{
|
||||
vec<4, int, P> result;
|
||||
result.data = glm_ivec4_abs(v.data);
|
||||
@ -35,7 +35,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_floor<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_floor(v.data);
|
||||
@ -46,7 +46,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_ceil<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_ceil(v.data);
|
||||
@ -57,7 +57,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_fract<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_fract(v.data);
|
||||
@ -68,7 +68,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_round<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_round(v.data);
|
||||
@ -79,7 +79,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_mod<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& y)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = glm_vec4_mod(x.data, y.data);
|
||||
@ -90,7 +90,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_min_vector<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v1, vec<4, float, P> const& v2)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = _mm_min_ps(v1.data, v2.data);
|
||||
@ -101,7 +101,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_min_vector<4, int32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2)
|
||||
{
|
||||
vec<4, int32, P> result;
|
||||
result.data = _mm_min_epi32(v1.data, v2.data);
|
||||
@ -112,7 +112,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_min_vector<4, uint32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const& v1, vec<4, uint32, P> const& v2)
|
||||
{
|
||||
vec<4, uint32, P> result;
|
||||
result.data = _mm_min_epu32(v1.data, v2.data);
|
||||
@ -123,7 +123,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_max_vector<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v1, vec<4, float, P> const& v2)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = _mm_max_ps(v1.data, v2.data);
|
||||
@ -134,7 +134,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_max_vector<4, int32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2)
|
||||
{
|
||||
vec<4, int32, P> result;
|
||||
result.data = _mm_max_epi32(v1.data, v2.data);
|
||||
@ -145,7 +145,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_max_vector<4, uint32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& v1, vec<4, uint32, P> const& v2)
|
||||
{
|
||||
vec<4, uint32, P> result;
|
||||
result.data = _mm_max_epu32(v1.data, v2.data);
|
||||
@ -156,7 +156,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_clamp_vector<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & minVal, vec<4, float, P> const & maxVal)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& minVal, vec<4, float, P> const& maxVal)
|
||||
{
|
||||
vec<4, float, P> result;
|
||||
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
|
||||
@ -167,7 +167,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_clamp_vector<4, int32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & x, vec<4, int32, P> const & minVal, vec<4, int32, P> const & maxVal)
|
||||
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const& x, vec<4, int32, P> const& minVal, vec<4, int32, P> const& maxVal)
|
||||
{
|
||||
vec<4, int32, P> result;
|
||||
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
|
||||
@ -178,7 +178,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_clamp_vector<4, uint32, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & x, vec<4, uint32, P> const & minVal, vec<4, uint32, P> const & maxVal)
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const& x, vec<4, uint32, P> const& minVal, vec<4, uint32, P> const& maxVal)
|
||||
{
|
||||
vec<4, uint32, P> result;
|
||||
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
|
||||
@ -189,7 +189,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_mix_vector<4, float, bool, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y, vec<4, bool, P> const & a)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& x, vec<4, float, P> const& y, vec<4, bool, P> const& a)
|
||||
{
|
||||
__m128i const Load = _mm_set_epi32(-static_cast<int>(a.w), -static_cast<int>(a.z), -static_cast<int>(a.y), -static_cast<int>(a.x));
|
||||
__m128 const Mask = _mm_castsi128_ps(Load);
|
||||
|
@ -29,7 +29,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> pow(vec<L, T, P> const & base, vec<L, T, P> const& exponent);
|
||||
GLM_FUNC_DECL vec<L, T, P> pow(vec<L, T, P> const& base, vec<L, T, P> const& exponent);
|
||||
|
||||
/// Returns the natural exponentiation of x, i.e., e^x.
|
||||
///
|
||||
@ -87,7 +87,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> sqrt(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, T, P> sqrt(vec<L, T, P> const& v);
|
||||
|
||||
/// Returns the reciprocal of the positive square root of v.
|
||||
///
|
||||
@ -98,7 +98,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> inversesqrt(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, T, P> inversesqrt(vec<L, T, P> const& v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -41,7 +41,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier P, bool Aligned>
|
||||
struct compute_inversesqrt
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
|
||||
{
|
||||
return static_cast<T>(1) / sqrt(x);
|
||||
}
|
||||
@ -50,7 +50,7 @@ namespace detail
|
||||
template<length_t L, bool Aligned>
|
||||
struct compute_inversesqrt<L, float, lowp, Aligned>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, float, lowp> call(vec<L, float, lowp> const & x)
|
||||
GLM_FUNC_QUALIFIER static vec<L, float, lowp> call(vec<L, float, lowp> const& x)
|
||||
{
|
||||
vec<L, float, lowp> tmp(x);
|
||||
vec<L, float, lowp> xhalf(tmp * 0.5f);
|
||||
@ -67,7 +67,7 @@ namespace detail
|
||||
// pow
|
||||
using std::pow;
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> pow(vec<L, T, P> const & base, vec<L, T, P> const& exponent)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> pow(vec<L, T, P> const& base, vec<L, T, P> const& exponent)
|
||||
{
|
||||
return detail::functor2<L, T, P>::call(pow, base, exponent);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_sqrt<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = _mm_sqrt_ps(v.data);
|
||||
@ -22,7 +22,7 @@ namespace detail
|
||||
template<>
|
||||
struct compute_sqrt<4, float, aligned_lowp, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v)
|
||||
{
|
||||
vec<4, float, aligned_lowp> Result;
|
||||
Result.data = glm_vec4_sqrt_lowp(v.data);
|
||||
|
@ -45,7 +45,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL T dot(vec<L, T, P> const & x, vec<L, T, P> const & y);
|
||||
GLM_FUNC_DECL T dot(vec<L, T, P> const& x, vec<L, T, P> const& y);
|
||||
|
||||
/// Returns the cross product of x and y.
|
||||
///
|
||||
@ -54,7 +54,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> cross(vec<3, T, P> const & x, vec<3, T, P> const & y);
|
||||
GLM_FUNC_DECL vec<3, T, P> cross(vec<3, T, P> const& x, vec<3, T, P> const& y);
|
||||
|
||||
/// Returns a vector in the same direction as x but with length of 1.
|
||||
/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
|
||||
|
@ -11,7 +11,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_length<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& v)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_length(v.data));
|
||||
}
|
||||
@ -20,7 +20,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_distance<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & p0, vec<4, float, P> const & p1)
|
||||
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& p0, vec<4, float, P> const& p1)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
|
||||
}
|
||||
@ -38,7 +38,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_cross<float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const & a, vec<3, float, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const& a, vec<3, float, P> const& b)
|
||||
{
|
||||
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
|
||||
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
|
||||
@ -53,7 +53,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_normalize<4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = glm_vec4_normalize(v.data);
|
||||
|
@ -32,8 +32,8 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uint, P> uaddCarry(
|
||||
vec<L, uint, P> const & x,
|
||||
vec<L, uint, P> const & y,
|
||||
vec<L, uint, P> const& x,
|
||||
vec<L, uint, P> const& y,
|
||||
vec<L, uint, P> & carry);
|
||||
|
||||
/// Subtracts the 32-bit unsigned integer y from x, returning
|
||||
@ -46,8 +46,8 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uint, P> usubBorrow(
|
||||
vec<L, uint, P> const & x,
|
||||
vec<L, uint, P> const & y,
|
||||
vec<L, uint, P> const& x,
|
||||
vec<L, uint, P> const& y,
|
||||
vec<L, uint, P> & borrow);
|
||||
|
||||
/// Multiplies 32-bit integers x and y, producing a 64-bit
|
||||
@ -60,8 +60,8 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL void umulExtended(
|
||||
vec<L, uint, P> const & x,
|
||||
vec<L, uint, P> const & y,
|
||||
vec<L, uint, P> const& x,
|
||||
vec<L, uint, P> const& y,
|
||||
vec<L, uint, P> & msb,
|
||||
vec<L, uint, P> & lsb);
|
||||
|
||||
@ -75,8 +75,8 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL void imulExtended(
|
||||
vec<L, int, P> const & x,
|
||||
vec<L, int, P> const & y,
|
||||
vec<L, int, P> const& x,
|
||||
vec<L, int, P> const& y,
|
||||
vec<L, int, P> & msb,
|
||||
vec<L, int, P> & lsb);
|
||||
|
||||
@ -134,7 +134,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldReverse(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldReverse(vec<L, T, P> const& v);
|
||||
|
||||
/// Returns the number of bits set to 1 in the binary representation of value.
|
||||
///
|
||||
@ -153,7 +153,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, int, P> bitCount(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, int, P> bitCount(vec<L, T, P> const& v);
|
||||
|
||||
/// Returns the bit number of the least significant bit set to
|
||||
/// 1 in the binary representation of value.
|
||||
@ -176,7 +176,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, int, P> findLSB(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, int, P> findLSB(vec<L, T, P> const& v);
|
||||
|
||||
/// Returns the bit number of the most significant bit in the binary representation of value.
|
||||
/// For positive integers, the result will be the bit number of the most significant bit set to 1.
|
||||
@ -201,7 +201,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, int, P> findMSB(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, int, P> findMSB(vec<L, T, P> const& v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -178,7 +178,7 @@ namespace detail
|
||||
}//namespace detail
|
||||
|
||||
// uaddCarry
|
||||
GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
|
||||
GLM_FUNC_QUALIFIER uint uaddCarry(uint const& x, uint const& y, uint & Carry)
|
||||
{
|
||||
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
||||
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
|
||||
@ -196,7 +196,7 @@ namespace detail
|
||||
}
|
||||
|
||||
// usubBorrow
|
||||
GLM_FUNC_QUALIFIER uint usubBorrow(uint const & x, uint const & y, uint & Borrow)
|
||||
GLM_FUNC_QUALIFIER uint usubBorrow(uint const& x, uint const& y, uint & Borrow)
|
||||
{
|
||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||
|
||||
@ -217,7 +217,7 @@ namespace detail
|
||||
}
|
||||
|
||||
// umulExtended
|
||||
GLM_FUNC_QUALIFIER void umulExtended(uint const & x, uint const & y, uint & msb, uint & lsb)
|
||||
GLM_FUNC_QUALIFIER void umulExtended(uint const& x, uint const& y, uint & msb, uint & lsb)
|
||||
{
|
||||
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
|
||||
|
||||
@ -273,7 +273,7 @@ namespace detail
|
||||
|
||||
// bitfieldInsert
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const & Base, genIUType const & Insert, int Offset, int Bits)
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits)
|
||||
{
|
||||
return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ namespace detail
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template<typename T, qualifier P, template<typename, qualifier> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y);
|
||||
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const& x, matType<T, P> const& y);
|
||||
|
||||
/// Treats the first parameter c as a column vector
|
||||
/// and the second parameter r as a row vector
|
||||
@ -110,7 +110,7 @@ namespace detail
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template<length_t DA, length_t DB, typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const & c, vec<DB, T, P> const & r);
|
||||
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const& c, vec<DB, T, P> const& r);
|
||||
|
||||
/// Returns the transposed matrix of x
|
||||
///
|
||||
@ -119,7 +119,7 @@ namespace detail
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template<typename T, qualifier P, template<typename, qualifier> class matType>
|
||||
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
|
||||
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const& x);
|
||||
|
||||
/// Return the determinant of a squared matrix.
|
||||
///
|
||||
@ -128,7 +128,7 @@ namespace detail
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template<typename T, qualifier P, template<typename, qualifier> class matType>
|
||||
GLM_FUNC_DECL T determinant(matType<T, P> const & m);
|
||||
GLM_FUNC_DECL T determinant(matType<T, P> const& m);
|
||||
|
||||
/// Return the inverse of a squared matrix.
|
||||
///
|
||||
@ -137,7 +137,7 @@ namespace detail
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
|
||||
template<typename T, qualifier P, template<typename, qualifier> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const& m);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -356,14 +356,14 @@ namespace detail
|
||||
}//namespace detail
|
||||
|
||||
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<C, R, T, P> matrixCompMult(matType<C, R, T, P> const & x, matType<C, R, T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER matType<C, R, T, P> matrixCompMult(matType<C, R, T, P> const& x, matType<C, R, T, P> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs");
|
||||
return detail::compute_matrixCompMult<matType, C, R, T, P, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
||||
template<length_t DA, length_t DB, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const & c, vec<DB, T, P> const & r)
|
||||
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const& c, vec<DB, T, P> const& r)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
|
||||
|
||||
@ -374,21 +374,21 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
|
||||
GLM_FUNC_QUALIFIER typename matType<C, R, T, P>::transpose_type transpose(matType<C, R, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename matType<C, R, T, P>::transpose_type transpose(matType<C, R, T, P> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs");
|
||||
return detail::compute_transpose<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
}
|
||||
|
||||
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
|
||||
GLM_FUNC_QUALIFIER T determinant(matType<C, R, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER T determinant(matType<C, R, T, P> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs");
|
||||
return detail::compute_determinant<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
}
|
||||
|
||||
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
|
||||
GLM_FUNC_QUALIFIER matType<C, R, T, P> inverse(matType<C, R, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER matType<C, R, T, P> inverse(matType<C, R, T, P> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
|
||||
return detail::compute_inverse<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
|
||||
|
@ -16,7 +16,7 @@ namespace detail
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
|
||||
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & x, mat<4, 4, float, P> const & y)
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& x, mat<4, 4, float, P> const& y)
|
||||
{
|
||||
mat<4, 4, float, P> Result;
|
||||
glm_mat4_matrixCompMult(
|
||||
@ -30,7 +30,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_transpose<mat, 4, 4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & m)
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m)
|
||||
{
|
||||
mat<4, 4, float, P> Result;
|
||||
glm_mat4_transpose(
|
||||
|
@ -30,7 +30,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packUnorm2x16(vec2 const & v);
|
||||
GLM_FUNC_DECL uint packUnorm2x16(vec2 const& v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
@ -43,7 +43,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packSnorm2x16(vec2 const & v);
|
||||
GLM_FUNC_DECL uint packSnorm2x16(vec2 const& v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
@ -56,7 +56,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packUnorm4x8(vec4 const & v);
|
||||
GLM_FUNC_DECL uint packUnorm4x8(vec4 const& v);
|
||||
|
||||
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
|
||||
/// Then, the results are packed into the returned 32-bit unsigned integer.
|
||||
@ -69,7 +69,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packSnorm4x8(vec4 const & v);
|
||||
GLM_FUNC_DECL uint packSnorm4x8(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
|
||||
@ -131,7 +131,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL double packDouble2x32(uvec2 const & v);
|
||||
GLM_FUNC_DECL double packDouble2x32(uvec2 const& v);
|
||||
|
||||
/// Returns a two-component unsigned integer vector representation of v.
|
||||
/// The bit-level representation of v is preserved.
|
||||
@ -150,7 +150,7 @@ namespace glm
|
||||
///
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint packHalf2x16(vec2 const & v);
|
||||
GLM_FUNC_DECL uint packHalf2x16(vec2 const& v);
|
||||
|
||||
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
|
||||
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -36,7 +36,7 @@ namespace glm
|
||||
return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -65,7 +65,7 @@ namespace glm
|
||||
return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -96,7 +96,7 @@ namespace glm
|
||||
return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -127,7 +127,7 @@ namespace glm
|
||||
return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v)
|
||||
GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
@ -154,7 +154,7 @@ namespace glm
|
||||
return uvec2(u.out[0], u.out[1]);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const& v)
|
||||
{
|
||||
union
|
||||
{
|
||||
|
@ -42,8 +42,8 @@ namespace detail
|
||||
typedef TYPE<VALTYPE> const * const const_pointer_const;
|
||||
typedef TYPE<VALTYPE> * const pointer_const;
|
||||
typedef TYPE<VALTYPE> & reference;
|
||||
typedef TYPE<VALTYPE> const & const_reference;
|
||||
typedef TYPE<VALTYPE> const & param_type;
|
||||
typedef TYPE<VALTYPE> const& const_reference;
|
||||
typedef TYPE<VALTYPE> const& param_type;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Address (Implementation details)
|
||||
@ -104,33 +104,33 @@ namespace detail
|
||||
//////////////////////////////////////
|
||||
// Constructors
|
||||
base();
|
||||
base(class_type const & m);
|
||||
base(class_type const& m);
|
||||
|
||||
explicit base(T const & x);
|
||||
explicit base(T const& x);
|
||||
explicit base(value_type const * const x);
|
||||
explicit base(col_type const * const x);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Conversions
|
||||
template<typename vU, uint cU, uint rU, profile pU>
|
||||
explicit base(base<vU, cU, rU, pU> const & m);
|
||||
explicit base(base<vU, cU, rU, pU> const& m);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Accesses
|
||||
col_type& operator[](size_type i);
|
||||
col_type const & operator[](size_type i) const;
|
||||
col_type const& operator[](size_type i) const;
|
||||
|
||||
//////////////////////////////////////
|
||||
// Unary updatable operators
|
||||
class_type& operator= (class_type const & x);
|
||||
class_type& operator+= (T const & x);
|
||||
class_type& operator+= (class_type const & x);
|
||||
class_type& operator-= (T const & x);
|
||||
class_type& operator-= (class_type const & x);
|
||||
class_type& operator*= (T const & x);
|
||||
class_type& operator*= (class_type const & x);
|
||||
class_type& operator/= (T const & x);
|
||||
class_type& operator/= (class_type const & x);
|
||||
class_type& operator= (class_type const& x);
|
||||
class_type& operator+= (T const& x);
|
||||
class_type& operator+= (class_type const& x);
|
||||
class_type& operator-= (T const& x);
|
||||
class_type& operator-= (class_type const& x);
|
||||
class_type& operator*= (T const& x);
|
||||
class_type& operator*= (class_type const& x);
|
||||
class_type& operator/= (T const& x);
|
||||
class_type& operator/= (class_type const& x);
|
||||
class_type& operator++ ();
|
||||
class_type& operator-- ();
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ base<vT, cT, rT, pT>::base()
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
base<vT, cT, rT, pT>::base
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & m
|
||||
typename base<vT, cT, rT, pT>::class_type const& m
|
||||
)
|
||||
{
|
||||
for
|
||||
@ -72,7 +72,7 @@ base<vT, cT, rT, pT>::base
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
base<vT, cT, rT, pT>::base
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::T const & x
|
||||
typename base<vT, cT, rT, pT>::T const& x
|
||||
)
|
||||
{
|
||||
if(rT == 1) // vector
|
||||
@ -135,7 +135,7 @@ template<typename vT, uint cT, uint rT, profile pT>
|
||||
template<typename vU, uint cU, uint rU, profile pU>
|
||||
base<vT, cT, rT, pT>::base
|
||||
(
|
||||
base<vU, cU, rU, pU> const & m
|
||||
base<vU, cU, rU, pU> const& m
|
||||
)
|
||||
{
|
||||
for
|
||||
@ -162,7 +162,7 @@ typename base<vT, cT, rT, pT>::col_type& base<vT, cT, rT, pT>::operator[]
|
||||
}
|
||||
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[]
|
||||
typename base<vT, cT, rT, pT>::col_type const& base<vT, cT, rT, pT>::operator[]
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::size_type i
|
||||
) const
|
||||
@ -176,7 +176,7 @@ typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[]
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & x
|
||||
typename base<vT, cT, rT, pT>::class_type const& x
|
||||
)
|
||||
{
|
||||
memcpy(&this->value, &x.value, cT * rT * sizeof(vT));
|
||||
@ -186,7 +186,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::T const & x
|
||||
typename base<vT, cT, rT, pT>::T const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -202,7 +202,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & x
|
||||
typename base<vT, cT, rT, pT>::class_type const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -218,7 +218,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::T const & x
|
||||
typename base<vT, cT, rT, pT>::T const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -234,7 +234,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & x
|
||||
typename base<vT, cT, rT, pT>::class_type const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -250,7 +250,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::T const & x
|
||||
typename base<vT, cT, rT, pT>::T const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -266,7 +266,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & x
|
||||
typename base<vT, cT, rT, pT>::class_type const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -282,7 +282,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::T const & x
|
||||
typename base<vT, cT, rT, pT>::T const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
@ -298,7 +298,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
|
||||
template<typename vT, uint cT, uint rT, profile pT>
|
||||
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
|
||||
(
|
||||
typename base<vT, cT, rT, pT>::class_type const & x
|
||||
typename base<vT, cT, rT, pT>::class_type const& x
|
||||
)
|
||||
{
|
||||
typename base<vT, cT, rT, pT>::size_type stop_col = x.col_size();
|
||||
|
@ -11,7 +11,7 @@ namespace detail
|
||||
typedef short hdata;
|
||||
|
||||
GLM_FUNC_DECL float toFloat32(hdata value);
|
||||
GLM_FUNC_DECL hdata toFloat16(float const & value);
|
||||
GLM_FUNC_DECL hdata toFloat16(float const& value);
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
@ -25,7 +25,7 @@ namespace detail
|
||||
#endif//GLM_HAS_TEMPLATE_ALIASES
|
||||
|
||||
template<typename T, qualifier P, template<typename, qualifier> class matType>
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
|
||||
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const& m);
|
||||
|
||||
/// @addtogroup core_precision
|
||||
/// @{
|
||||
|
@ -30,71 +30,71 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 2, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 2, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
T const & x1, T const & y1,
|
||||
T const & x2, T const & y2);
|
||||
T const& x1, T const& y1,
|
||||
T const& x2, T const& y2);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
col_type const& v1,
|
||||
col_type const& v2);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
template<typename U, typename V, typename M, typename N>
|
||||
GLM_FUNC_DECL mat(
|
||||
U const & x1, V const & y1,
|
||||
M const & x2, N const & y2);
|
||||
U const& x1, V const& y1,
|
||||
M const& x2, N const& y2);
|
||||
|
||||
template<typename U, typename V>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<2, U, P> const & v1,
|
||||
vec<2, V, P> const & v2);
|
||||
vec<2, U, P> const& v1,
|
||||
vec<2, V, P> const& v2);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const& v) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const& m);
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
@ -107,74 +107,74 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
} //namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -40,8 +40,8 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
|
||||
(
|
||||
T const & x0, T const & y0,
|
||||
T const & x1, T const & y1
|
||||
T const& x0, T const& y0,
|
||||
T const& x1, T const& y1
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0);
|
||||
@ -61,8 +61,8 @@ namespace glm
|
||||
template<typename X1, typename Y1, typename X2, typename Y2>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
|
||||
(
|
||||
X1 const & x1, Y1 const & y1,
|
||||
X2 const & x2, Y2 const & y2
|
||||
X1 const& x1, Y1 const& y1,
|
||||
X2 const& x2, Y2 const& y2
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1));
|
||||
@ -163,7 +163,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -173,7 +173,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -191,7 +191,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -209,7 +209,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -227,7 +227,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const& m)
|
||||
{
|
||||
return (*this = *this * m);
|
||||
}
|
||||
@ -243,7 +243,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const& m)
|
||||
{
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
@ -285,13 +285,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
-m[0],
|
||||
@ -301,7 +301,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -309,7 +309,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -317,7 +317,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -325,7 +325,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -333,7 +333,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
scalar - m[0],
|
||||
@ -341,7 +341,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -349,7 +349,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -357,7 +357,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -368,7 +368,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator*
|
||||
(
|
||||
mat<2, 2, T, P> const& m,
|
||||
typename mat<2, 2, T, P>::row_type const & v
|
||||
typename mat<2, 2, T, P>::row_type const& v
|
||||
)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
@ -379,7 +379,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator*
|
||||
(
|
||||
typename mat<2, 2, T, P>::col_type const & v,
|
||||
typename mat<2, 2, T, P>::col_type const& v,
|
||||
mat<2, 2, T, P> const& m
|
||||
)
|
||||
{
|
||||
@ -389,7 +389,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -399,7 +399,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -411,7 +411,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -425,7 +425,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -433,7 +433,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return mat<2, 2, T, P>(
|
||||
scalar / m[0],
|
||||
@ -441,19 +441,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const& m, typename mat<2, 2, T, P>::row_type const& v)
|
||||
{
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const& v, mat<2, 2, T, P> const& m)
|
||||
{
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
mat<2, 2, T, P> m1_copy(m1);
|
||||
return m1_copy /= m2;
|
||||
@ -462,13 +462,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
|
||||
}
|
||||
|
@ -31,22 +31,22 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 3, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
T x0, T y0, T z0,
|
||||
T x1, T y1, T z1);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1);
|
||||
col_type const& v0,
|
||||
col_type const& v1);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -57,37 +57,37 @@ namespace glm
|
||||
|
||||
template<typename U, typename V>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<3, U, P> const & v1,
|
||||
vec<3, V, P> const & v2);
|
||||
vec<3, U, P> const& v1,
|
||||
vec<3, V, P> const& v2);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -104,59 +104,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const & m, typename mat<2, 3, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const& m, typename mat<2, 3, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const & v, mat<2, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const& v, mat<2, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -22,7 +22,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -47,7 +47,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const & v0, col_type const & v1)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const& v0, col_type const& v1)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
this->value[1] = v1;
|
||||
@ -71,7 +71,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename V1, typename V2>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const & v1, vec<3, V2, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const& v1, vec<3, V2, P> const& v2)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
this->value[1] = col_type(v2);
|
||||
@ -81,63 +81,63 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -153,7 +153,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const& mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -163,7 +163,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -173,7 +173,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -191,7 +191,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -209,7 +209,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -271,13 +271,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
-m[0],
|
||||
@ -287,7 +287,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -295,7 +295,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -303,7 +303,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -311,7 +311,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -319,7 +319,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -327,7 +327,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -338,7 +338,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator*
|
||||
(
|
||||
mat<2, 3, T, P> const& m,
|
||||
typename mat<2, 3, T, P>::row_type const & v)
|
||||
typename mat<2, 3, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<2, 3, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y,
|
||||
@ -349,7 +349,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator*
|
||||
(
|
||||
typename mat<2, 3, T, P>::col_type const & v,
|
||||
typename mat<2, 3, T, P>::col_type const& v,
|
||||
mat<2, 3, T, P> const& m)
|
||||
{
|
||||
return typename mat<2, 3, T, P>::row_type(
|
||||
@ -358,7 +358,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -370,7 +370,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
T SrcA00 = m1[0][0];
|
||||
T SrcA01 = m1[0][1];
|
||||
@ -400,7 +400,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -418,7 +418,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -426,7 +426,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
scalar / m[0],
|
||||
@ -436,13 +436,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
|
||||
}
|
||||
|
@ -31,22 +31,22 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 4, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<2, 4, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
T x0, T y0, T z0, T w0,
|
||||
T x1, T y1, T z1, T w1);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1);
|
||||
col_type const& v0,
|
||||
col_type const& v1);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -59,37 +59,37 @@ namespace glm
|
||||
|
||||
template<typename U, typename V>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<4, U, P> const & v1,
|
||||
vec<4, V, P> const & v2);
|
||||
vec<4, U, P> const& v1,
|
||||
vec<4, V, P> const& v2);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -106,59 +106,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const& m, typename mat<2, 4, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const& v, mat<2, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<2, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -22,7 +22,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -48,7 +48,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const & v0, col_type const & v1)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const& v0, col_type const& v1)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
this->value[1] = v1;
|
||||
@ -72,7 +72,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename V1, typename V2>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const & v1, vec<4, V2, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const& v1, vec<4, V2, P> const& v2)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
this->value[1] = col_type(v2);
|
||||
@ -82,63 +82,63 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -154,7 +154,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const& mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -164,7 +164,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -174,7 +174,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -192,7 +192,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -210,7 +210,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -272,13 +272,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
-m[0],
|
||||
@ -288,7 +288,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -296,7 +296,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -304,7 +304,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -312,7 +312,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -320,7 +320,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -328,7 +328,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -336,7 +336,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const& m, typename mat<2, 4, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<2, 4, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y,
|
||||
@ -346,7 +346,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const& v, mat<2, 4, T, P> const& m)
|
||||
{
|
||||
return typename mat<2, 4, T, P>::row_type(
|
||||
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
|
||||
@ -354,7 +354,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
T SrcA00 = m1[0][0];
|
||||
T SrcA01 = m1[0][1];
|
||||
@ -395,7 +395,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<2, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -409,7 +409,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
|
||||
@ -427,7 +427,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -435,7 +435,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
scalar / m[0],
|
||||
@ -445,13 +445,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
|
||||
}
|
||||
|
@ -31,14 +31,14 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 2, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 2, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
@ -46,9 +46,9 @@ namespace glm
|
||||
T x1, T y1,
|
||||
T x2, T y2);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -63,38 +63,38 @@ namespace glm
|
||||
|
||||
template<typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<2, V1, P> const & v1,
|
||||
vec<2, V2, P> const & v2,
|
||||
vec<2, V3, P> const & v3);
|
||||
vec<2, V1, P> const& v1,
|
||||
vec<2, V2, P> const& v2,
|
||||
vec<2, V3, P> const& v3);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -111,59 +111,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const& m, typename mat<3, 2, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const& v, mat<3, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
|
||||
|
||||
}//namespace glm
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -23,7 +23,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -54,9 +54,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -87,9 +87,9 @@ namespace glm
|
||||
template<typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
|
||||
(
|
||||
vec<2, V1, P> const & v1,
|
||||
vec<2, V2, P> const & v2,
|
||||
vec<2, V3, P> const & v3
|
||||
vec<2, V1, P> const& v1,
|
||||
vec<2, V2, P> const& v2,
|
||||
vec<2, V3, P> const& v3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
@ -101,7 +101,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -109,7 +109,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -117,7 +117,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -125,7 +125,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -133,7 +133,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -141,7 +141,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -149,7 +149,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -157,7 +157,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -165,7 +165,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -182,7 +182,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const& mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -192,7 +192,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -203,7 +203,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -223,7 +223,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -243,7 +243,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -310,13 +310,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
-m[0],
|
||||
@ -327,7 +327,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -336,7 +336,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -345,7 +345,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -354,7 +354,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -363,7 +363,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -372,7 +372,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -381,7 +381,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const& m, typename mat<3, 2, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<3, 2, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
|
||||
@ -389,7 +389,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const& v, mat<3, 2, T, P> const& m)
|
||||
{
|
||||
return typename mat<3, 2, T, P>::row_type(
|
||||
v.x * m[0][0] + v.y * m[0][1],
|
||||
@ -398,7 +398,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
const T SrcA00 = m1[0][0];
|
||||
const T SrcA01 = m1[0][1];
|
||||
@ -423,7 +423,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -435,7 +435,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -449,7 +449,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -458,7 +458,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
scalar / m[0],
|
||||
@ -469,13 +469,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
|
||||
}
|
||||
|
@ -30,14 +30,14 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 3, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
@ -45,9 +45,9 @@ namespace glm
|
||||
T x1, T y1, T z1,
|
||||
T x2, T y2, T z2);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -62,46 +62,46 @@ namespace glm
|
||||
|
||||
template<typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<3, V1, P> const & v1,
|
||||
vec<3, V2, P> const & v2,
|
||||
vec<3, V3, P> const & v3);
|
||||
vec<3, V1, P> const& v1,
|
||||
vec<3, V2, P> const& v2,
|
||||
vec<3, V3, P> const& v3);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const& m);
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
@ -114,74 +114,74 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -15,7 +15,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -25,7 +25,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -56,9 +56,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -103,7 +103,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -111,7 +111,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -119,7 +119,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -127,7 +127,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -135,7 +135,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -143,7 +143,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -151,7 +151,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -159,7 +159,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -167,7 +167,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -184,7 +184,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const& mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -194,7 +194,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -205,7 +205,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -225,7 +225,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -245,7 +245,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -265,7 +265,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const& m)
|
||||
{
|
||||
return (*this = *this * m);
|
||||
}
|
||||
@ -282,7 +282,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const& m)
|
||||
{
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
@ -326,13 +326,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
-m[0],
|
||||
@ -343,7 +343,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -352,7 +352,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -361,7 +361,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -370,7 +370,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -379,7 +379,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
scalar - m[0],
|
||||
@ -388,7 +388,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -397,7 +397,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -406,7 +406,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -415,7 +415,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<3, 3, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
|
||||
@ -424,7 +424,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return typename mat<3, 3, T, P>::row_type(
|
||||
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,
|
||||
@ -433,7 +433,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
T const SrcA00 = m1[0][0];
|
||||
T const SrcA01 = m1[0][1];
|
||||
@ -469,7 +469,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -481,7 +481,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -499,7 +499,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -508,7 +508,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return mat<3, 3, T, P>(
|
||||
scalar / m[0],
|
||||
@ -517,19 +517,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const& m, typename mat<3, 3, T, P>::row_type const& v)
|
||||
{
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const& v, mat<3, 3, T, P> const& m)
|
||||
{
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
mat<3, 3, T, P> m1_copy(m1);
|
||||
return m1_copy /= m2;
|
||||
@ -538,13 +538,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
|
||||
}
|
||||
|
@ -31,14 +31,14 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 4, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<3, 4, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
@ -46,9 +46,9 @@ namespace glm
|
||||
T x1, T y1, T z1, T w1,
|
||||
T x2, T y2, T z2, T w2);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -63,38 +63,38 @@ namespace glm
|
||||
|
||||
template<typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<4, V1, P> const & v1,
|
||||
vec<4, V2, P> const & v2,
|
||||
vec<4, V3, P> const & v3);
|
||||
vec<4, V1, P> const& v1,
|
||||
vec<4, V2, P> const& v2,
|
||||
vec<4, V3, P> const& v3);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -111,59 +111,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const & m, typename mat<3, 4, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const& m, typename mat<3, 4, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const & v, mat<3, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const& v, mat<3, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<2, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<3, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -23,7 +23,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -54,9 +54,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -87,9 +87,9 @@ namespace glm
|
||||
template<typename V1, typename V2, typename V3>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
|
||||
(
|
||||
vec<4, V1, P> const & v1,
|
||||
vec<4, V2, P> const & v2,
|
||||
vec<4, V3, P> const & v3
|
||||
vec<4, V1, P> const& v1,
|
||||
vec<4, V2, P> const& v2,
|
||||
vec<4, V3, P> const& v3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
@ -101,7 +101,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -109,7 +109,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -117,7 +117,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -125,7 +125,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -133,7 +133,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -141,7 +141,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -149,7 +149,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -157,7 +157,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -165,7 +165,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -182,7 +182,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const& mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -192,7 +192,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -203,7 +203,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -223,7 +223,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -243,7 +243,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -310,13 +310,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
-m[0],
|
||||
@ -327,7 +327,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -336,7 +336,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -345,7 +345,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -354,7 +354,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -363,7 +363,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -372,7 +372,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -384,7 +384,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator*
|
||||
(
|
||||
mat<3, 4, T, P> const& m,
|
||||
typename mat<3, 4, T, P>::row_type const & v
|
||||
typename mat<3, 4, T, P>::row_type const& v
|
||||
)
|
||||
{
|
||||
return typename mat<3, 4, T, P>::col_type(
|
||||
@ -397,7 +397,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator*
|
||||
(
|
||||
typename mat<3, 4, T, P>::col_type const & v,
|
||||
typename mat<3, 4, T, P>::col_type const& v,
|
||||
mat<3, 4, T, P> const& m
|
||||
)
|
||||
{
|
||||
@ -408,7 +408,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
const T SrcA00 = m1[0][0];
|
||||
const T SrcA01 = m1[0][1];
|
||||
@ -457,7 +457,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<2, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -471,7 +471,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<3, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
|
||||
@ -489,7 +489,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -498,7 +498,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
scalar / m[0],
|
||||
@ -509,13 +509,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
|
||||
}
|
||||
|
@ -31,14 +31,14 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<4, 2, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<4, 2, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T scalar);
|
||||
GLM_FUNC_DECL mat(
|
||||
@ -47,10 +47,10 @@ namespace glm
|
||||
T x2, T y2,
|
||||
T x3, T y3);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -67,39 +67,39 @@ namespace glm
|
||||
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<2, V1, P> const & v1,
|
||||
vec<2, V2, P> const & v2,
|
||||
vec<2, V3, P> const & v3,
|
||||
vec<2, V4, P> const & v4);
|
||||
vec<2, V1, P> const& v1,
|
||||
vec<2, V2, P> const& v2,
|
||||
vec<2, V3, P> const& v3,
|
||||
vec<2, V4, P> const& v4);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -116,59 +116,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const& m, typename mat<4, 2, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const& v, mat<4, 2, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -24,7 +24,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -59,10 +59,10 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -97,10 +97,10 @@ namespace glm
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
|
||||
(
|
||||
vec<2, V1, P> const & v1,
|
||||
vec<2, V2, P> const & v2,
|
||||
vec<2, V3, P> const & v3,
|
||||
vec<2, V4, P> const & v4
|
||||
vec<2, V1, P> const& v1,
|
||||
vec<2, V2, P> const& v2,
|
||||
vec<2, V3, P> const& v3,
|
||||
vec<2, V4, P> const& v4
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
@ -113,7 +113,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -122,7 +122,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -131,7 +131,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -140,7 +140,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -149,7 +149,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -158,7 +158,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -167,7 +167,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -176,7 +176,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -185,7 +185,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -203,7 +203,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const& mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -213,7 +213,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -225,7 +225,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -247,7 +247,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -269,7 +269,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -341,13 +341,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
-m[0],
|
||||
@ -359,7 +359,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m[0] + scalar,
|
||||
@ -369,7 +369,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -379,7 +379,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m[0] - scalar,
|
||||
@ -389,7 +389,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -399,7 +399,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -409,7 +409,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m[0] * scalar,
|
||||
@ -419,7 +419,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const& m, typename mat<4, 2, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<4, 2, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
|
||||
@ -427,7 +427,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const& v, mat<4, 2, T, P> const& m)
|
||||
{
|
||||
return typename mat<4, 2, T, P>::row_type(
|
||||
v.x * m[0][0] + v.y * m[0][1],
|
||||
@ -437,7 +437,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
T const SrcA00 = m1[0][0];
|
||||
T const SrcA01 = m1[0][1];
|
||||
@ -466,7 +466,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -478,7 +478,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -492,7 +492,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
m[0] / scalar,
|
||||
@ -502,7 +502,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m)
|
||||
{
|
||||
return mat<4, 2, T, P>(
|
||||
scalar / m[0],
|
||||
@ -514,13 +514,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
|
||||
}
|
||||
|
@ -31,26 +31,26 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; }
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
GLM_FUNC_DECL mat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<4, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat(mat<4, 3, T, P> const& m) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const & m);
|
||||
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T const & x);
|
||||
GLM_FUNC_DECL explicit mat(T const& x);
|
||||
GLM_FUNC_DECL mat(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1,
|
||||
T const & x2, T const & y2, T const & z2,
|
||||
T const & x3, T const & y3, T const & z3);
|
||||
T const& x0, T const& y0, T const& z0,
|
||||
T const& x1, T const& y1, T const& z1,
|
||||
T const& x2, T const& y2, T const& z2,
|
||||
T const& x3, T const& y3, T const& z3);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -60,46 +60,46 @@ namespace glm
|
||||
typename X3, typename Y3, typename Z3,
|
||||
typename X4, typename Y4, typename Z4>
|
||||
GLM_FUNC_DECL mat(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3,
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4);
|
||||
X1 const& x1, Y1 const& y1, Z1 const& z1,
|
||||
X2 const& x2, Y2 const& y2, Z2 const& z2,
|
||||
X3 const& x3, Y3 const& y3, Z3 const& z3,
|
||||
X4 const& x4, Y4 const& y4, Z4 const& z4);
|
||||
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<3, V1, P> const & v1,
|
||||
vec<3, V2, P> const & v2,
|
||||
vec<3, V3, P> const & v3,
|
||||
vec<3, V4, P> const & v4);
|
||||
vec<3, V1, P> const& v1,
|
||||
vec<3, V2, P> const& v2,
|
||||
vec<3, V3, P> const& v3,
|
||||
vec<3, V4, P> const& v4);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -116,59 +116,59 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const & m, typename mat<4, 3, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const& m, typename mat<4, 3, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const & v, mat<4, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const& v, mat<4, 3, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -24,7 +24,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m.value[0];
|
||||
this->value[1] = m.value[1];
|
||||
@ -33,7 +33,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const& s)
|
||||
{
|
||||
this->value[0] = col_type(s, 0, 0);
|
||||
this->value[1] = col_type(0, s, 0);
|
||||
@ -44,10 +44,10 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0,
|
||||
T const & x1, T const & y1, T const & z1,
|
||||
T const & x2, T const & y2, T const & z2,
|
||||
T const & x3, T const & y3, T const & z3
|
||||
T const& x0, T const& y0, T const& z0,
|
||||
T const& x1, T const& y1, T const& z1,
|
||||
T const& x2, T const& y2, T const& z2,
|
||||
T const& x3, T const& y3, T const& z3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0);
|
||||
@ -59,10 +59,10 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -81,10 +81,10 @@ namespace glm
|
||||
typename X4, typename Y4, typename Z4>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3,
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4
|
||||
X1 const& x1, Y1 const& y1, Z1 const& z1,
|
||||
X2 const& x2, Y2 const& y2, Z2 const& z2,
|
||||
X3 const& x3, Y3 const& y3, Z3 const& z3,
|
||||
X4 const& x4, Y4 const& y4, Z4 const& z4
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(static_cast<T>(x1), value_type(y1), value_type(z1));
|
||||
@ -97,10 +97,10 @@ namespace glm
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
|
||||
(
|
||||
vec<3, V1, P> const & v1,
|
||||
vec<3, V2, P> const & v2,
|
||||
vec<3, V3, P> const & v3,
|
||||
vec<3, V4, P> const & v4
|
||||
vec<3, V1, P> const& v1,
|
||||
vec<3, V2, P> const& v2,
|
||||
vec<3, V3, P> const& v3,
|
||||
vec<3, V4, P> const& v4
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(v1);
|
||||
@ -113,7 +113,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -122,7 +122,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -131,7 +131,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -140,7 +140,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -149,7 +149,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -158,7 +158,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -167,7 +167,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -176,7 +176,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -185,7 +185,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
this->value[1] = col_type(m[1]);
|
||||
@ -203,7 +203,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const& mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -213,7 +213,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -225,7 +225,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -247,7 +247,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -269,7 +269,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -341,13 +341,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
-m[0],
|
||||
@ -359,7 +359,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m[0] + s,
|
||||
@ -369,7 +369,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -379,7 +379,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m[0] - s,
|
||||
@ -389,7 +389,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -399,7 +399,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m[0] * s,
|
||||
@ -409,7 +409,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m[0] * s,
|
||||
@ -422,7 +422,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator*
|
||||
(
|
||||
mat<4, 3, T, P> const& m,
|
||||
typename mat<4, 3, T, P>::row_type const & v)
|
||||
typename mat<4, 3, T, P>::row_type const& v)
|
||||
{
|
||||
return typename mat<4, 3, T, P>::col_type(
|
||||
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
|
||||
@ -433,7 +433,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator*
|
||||
(
|
||||
typename mat<4, 3, T, P>::col_type const & v,
|
||||
typename mat<4, 3, T, P>::col_type const& v,
|
||||
mat<4, 3, T, P> const& m)
|
||||
{
|
||||
return typename mat<4, 3, T, P>::row_type(
|
||||
@ -444,7 +444,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -456,7 +456,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
T const SrcA00 = m1[0][0];
|
||||
T const SrcA01 = m1[0][1];
|
||||
@ -498,7 +498,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -516,7 +516,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
m[0] / s,
|
||||
@ -526,7 +526,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m)
|
||||
{
|
||||
return mat<4, 3, T, P>(
|
||||
s / m[0],
|
||||
@ -538,13 +538,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
@ -39,17 +39,17 @@ namespace glm
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL explicit mat(T const & x);
|
||||
GLM_FUNC_DECL explicit mat(T const& x);
|
||||
GLM_FUNC_DECL mat(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1,
|
||||
T const & x2, T const & y2, T const & z2, T const & w2,
|
||||
T const & x3, T const & y3, T const & z3, T const & w3);
|
||||
T const& x0, T const& y0, T const& z0, T const& w0,
|
||||
T const& x1, T const& y1, T const& z1, T const& w1,
|
||||
T const& x2, T const& y2, T const& z2, T const& w2,
|
||||
T const& x3, T const& y3, T const& z3, T const& w3);
|
||||
GLM_FUNC_DECL mat(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3);
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3);
|
||||
|
||||
// -- Conversions --
|
||||
|
||||
@ -59,54 +59,54 @@ namespace glm
|
||||
typename X3, typename Y3, typename Z3, typename W3,
|
||||
typename X4, typename Y4, typename Z4, typename W4>
|
||||
GLM_FUNC_DECL mat(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
|
||||
X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1,
|
||||
X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2,
|
||||
X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3,
|
||||
X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4);
|
||||
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_DECL mat(
|
||||
vec<4, V1, P> const & v1,
|
||||
vec<4, V2, P> const & v2,
|
||||
vec<4, V3, P> const & v3,
|
||||
vec<4, V4, P> const & v4);
|
||||
vec<4, V1, P> const& v1,
|
||||
vec<4, V2, P> const& v2,
|
||||
vec<4, V3, P> const& v3,
|
||||
vec<4, V4, P> const& v4);
|
||||
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const & m);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const& m);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const& m);
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
@ -119,74 +119,74 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
|
||||
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
|
||||
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -15,7 +15,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -26,7 +26,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -35,7 +35,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const& s)
|
||||
{
|
||||
this->value[0] = col_type(s, 0, 0, 0);
|
||||
this->value[1] = col_type(0, s, 0, 0);
|
||||
@ -46,10 +46,10 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
|
||||
(
|
||||
T const & x0, T const & y0, T const & z0, T const & w0,
|
||||
T const & x1, T const & y1, T const & z1, T const & w1,
|
||||
T const & x2, T const & y2, T const & z2, T const & w2,
|
||||
T const & x3, T const & y3, T const & z3, T const & w3
|
||||
T const& x0, T const& y0, T const& z0, T const& w0,
|
||||
T const& x1, T const& y1, T const& z1, T const& w1,
|
||||
T const& x2, T const& y2, T const& z2, T const& w2,
|
||||
T const& x3, T const& y3, T const& z3, T const& w3
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(x0, y0, z0, w0);
|
||||
@ -61,10 +61,10 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
|
||||
(
|
||||
col_type const & v0,
|
||||
col_type const & v1,
|
||||
col_type const & v2,
|
||||
col_type const & v3
|
||||
col_type const& v0,
|
||||
col_type const& v1,
|
||||
col_type const& v2,
|
||||
col_type const& v3
|
||||
)
|
||||
{
|
||||
this->value[0] = v0;
|
||||
@ -77,7 +77,7 @@ namespace glm
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
|
||||
(
|
||||
mat<4, 4, U, Q> const & m
|
||||
mat<4, 4, U, Q> const& m
|
||||
)
|
||||
{
|
||||
this->value[0] = col_type(m[0]);
|
||||
@ -96,10 +96,10 @@ namespace glm
|
||||
typename X4, typename Y4, typename Z4, typename W4>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
|
||||
(
|
||||
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
|
||||
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
|
||||
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
|
||||
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4
|
||||
X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1,
|
||||
X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2,
|
||||
X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3,
|
||||
X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
@ -132,10 +132,10 @@ namespace glm
|
||||
template<typename V1, typename V2, typename V3, typename V4>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
|
||||
(
|
||||
vec<4, V1, P> const & v1,
|
||||
vec<4, V2, P> const & v2,
|
||||
vec<4, V3, P> const & v3,
|
||||
vec<4, V4, P> const & v4
|
||||
vec<4, V1, P> const& v1,
|
||||
vec<4, V2, P> const& v2,
|
||||
vec<4, V3, P> const& v3,
|
||||
vec<4, V4, P> const& v4
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
@ -152,7 +152,7 @@ namespace glm
|
||||
// -- Matrix conversions --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -161,7 +161,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -170,7 +170,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -179,7 +179,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -188,7 +188,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -197,7 +197,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0, 0);
|
||||
this->value[1] = col_type(m[1], 0, 0);
|
||||
@ -206,7 +206,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
this->value[0] = m[0];
|
||||
this->value[1] = m[1];
|
||||
@ -215,7 +215,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const& m)
|
||||
{
|
||||
this->value[0] = col_type(m[0], 0);
|
||||
this->value[1] = col_type(m[1], 0);
|
||||
@ -233,7 +233,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const& mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const
|
||||
{
|
||||
assert(i < this->length());
|
||||
return this->value[i];
|
||||
@ -243,7 +243,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
//memcpy could be faster
|
||||
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
|
||||
@ -257,7 +257,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const& m)
|
||||
{
|
||||
//memcpy could be faster
|
||||
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
|
||||
@ -281,7 +281,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] += m[0];
|
||||
this->value[1] += m[1];
|
||||
@ -303,7 +303,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const& m)
|
||||
{
|
||||
this->value[0] -= m[0];
|
||||
this->value[1] -= m[1];
|
||||
@ -325,7 +325,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const& m)
|
||||
{
|
||||
return (*this = *this * m);
|
||||
}
|
||||
@ -343,7 +343,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const& m)
|
||||
{
|
||||
return *this *= inverse(m);
|
||||
}
|
||||
@ -389,13 +389,13 @@ namespace glm
|
||||
// -- Unary constant operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
-m[0],
|
||||
@ -407,7 +407,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] + s,
|
||||
@ -417,7 +417,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] + s,
|
||||
@ -427,7 +427,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m1[0] + m2[0],
|
||||
@ -437,7 +437,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] - s,
|
||||
@ -447,7 +447,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
s - m[0],
|
||||
@ -457,7 +457,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m1[0] - m2[0],
|
||||
@ -467,7 +467,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const & s)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] * s,
|
||||
@ -477,7 +477,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] * s,
|
||||
@ -490,7 +490,7 @@ namespace glm
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator*
|
||||
(
|
||||
mat<4, 4, T, P> const& m,
|
||||
typename mat<4, 4, T, P>::row_type const & v
|
||||
typename mat<4, 4, T, P>::row_type const& v
|
||||
)
|
||||
{
|
||||
/*
|
||||
@ -537,7 +537,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator*
|
||||
(
|
||||
typename mat<4, 4, T, P>::col_type const & v,
|
||||
typename mat<4, 4, T, P>::col_type const& v,
|
||||
mat<4, 4, T, P> const& m
|
||||
)
|
||||
{
|
||||
@ -549,7 +549,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<2, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -563,7 +563,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
|
||||
{
|
||||
return mat<3, 4, T, P>(
|
||||
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
|
||||
@ -581,7 +581,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0];
|
||||
typename mat<4, 4, T, P>::col_type const SrcA1 = m1[1];
|
||||
@ -602,7 +602,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
m[0] / s,
|
||||
@ -612,7 +612,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const& m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return mat<4, 4, T, P>(
|
||||
s / m[0],
|
||||
@ -622,19 +622,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v)
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const& m, typename mat<4, 4, T, P>::row_type const& v)
|
||||
{
|
||||
return inverse(m) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const& v, mat<4, 4, T, P> const& m)
|
||||
{
|
||||
return v * inverse(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
mat<4, 4, T, P> m1_copy(m1);
|
||||
return m1_copy /= m2;
|
||||
@ -643,13 +643,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
|
||||
{
|
||||
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL T const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
@ -114,7 +114,7 @@ namespace glm
|
||||
/*
|
||||
# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
|
||||
template<int E0>
|
||||
GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that)
|
||||
GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const& that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
@ -122,7 +122,7 @@ namespace glm
|
||||
*/
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator=(vec<1, U, P> const& v);
|
||||
@ -198,102 +198,102 @@ namespace glm
|
||||
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const& v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, P> const& v)
|
||||
: x(v.x)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
@ -35,25 +35,25 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, U, Q> const& v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<2, U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<2, U, Q> const& v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<3, U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<3, U, Q> const& v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<4, U, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<4, U, Q> const& v)
|
||||
: x(static_cast<T>(v.x))
|
||||
{}
|
||||
|
||||
@ -67,7 +67,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T const & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER T const& vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
@ -77,7 +77,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const& v)
|
||||
{
|
||||
this->x = v.x;
|
||||
return *this;
|
||||
@ -86,7 +86,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x = static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -102,7 +102,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x += static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -118,7 +118,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x -= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -134,7 +134,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x *= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -150,7 +150,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x /= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -200,7 +200,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x %= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -216,7 +216,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x &= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -232,7 +232,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x |= U(v.x);
|
||||
return *this;
|
||||
@ -248,7 +248,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x ^= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -264,7 +264,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x <<= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -280,7 +280,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x >>= static_cast<T>(v.x);
|
||||
return *this;
|
||||
@ -289,13 +289,13 @@ namespace glm
|
||||
// -- Unary constant operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
-v.x);
|
||||
@ -304,21 +304,21 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x + scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar + v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x + v2.x);
|
||||
@ -326,63 +326,63 @@ namespace glm
|
||||
|
||||
//operator-
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x - scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar - v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x - v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x * scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar * v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x * v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x / scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar / v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x / v2.x);
|
||||
@ -391,133 +391,133 @@ namespace glm
|
||||
// -- Binary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x % scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar % v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x % v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x & scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar & v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x & v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x | scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar | v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x | v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x ^ scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar ^ v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x ^ v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
static_cast<T>(v.x << scalar));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar << v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x << v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v.x >> scalar);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
scalar >> v.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
v1.x >> v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const& v)
|
||||
{
|
||||
return vec<1, T, P>(
|
||||
~v.x);
|
||||
@ -526,25 +526,25 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return detail::compute_equal<T>::call(v1.x, v2.x);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return !(v1 == v2);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2)
|
||||
{
|
||||
return vec<1, bool, P>(v1.x && v2.x);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2)
|
||||
{
|
||||
return vec<1, bool, P>(v1.x || v2.x);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL vec& operator=(vec const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL vec& operator=(vec const& v) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec& operator=(vec<2, U, P> const& v);
|
||||
@ -169,217 +169,217 @@ namespace glm
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const& v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const& v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator==(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -85,7 +85,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T const & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER T const& vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
@ -469,7 +469,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x + v2.x,
|
||||
@ -477,7 +477,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x - scalar,
|
||||
@ -485,7 +485,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x - v2.x,
|
||||
@ -493,7 +493,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar - v.x,
|
||||
@ -501,7 +501,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x - v2.x,
|
||||
@ -509,7 +509,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x - v2.x,
|
||||
@ -517,7 +517,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x * scalar,
|
||||
@ -525,7 +525,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x * v2.x,
|
||||
@ -533,7 +533,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar * v.x,
|
||||
@ -541,7 +541,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x * v2.x,
|
||||
@ -549,7 +549,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x * v2.x,
|
||||
@ -557,7 +557,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x / scalar,
|
||||
@ -565,7 +565,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x / v2.x,
|
||||
@ -573,7 +573,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar / v.x,
|
||||
@ -581,7 +581,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x / v2.x,
|
||||
@ -589,7 +589,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x / v2.x,
|
||||
@ -599,7 +599,7 @@ namespace glm
|
||||
// -- Binary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x % scalar,
|
||||
@ -607,7 +607,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x % v2.x,
|
||||
@ -615,7 +615,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar % v.x,
|
||||
@ -623,7 +623,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x % v2.x,
|
||||
@ -631,7 +631,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x % v2.x,
|
||||
@ -639,7 +639,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x & scalar,
|
||||
@ -647,7 +647,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x & v2.x,
|
||||
@ -655,7 +655,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar & v.x,
|
||||
@ -663,7 +663,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x & v2.x,
|
||||
@ -671,7 +671,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x & v2.x,
|
||||
@ -679,7 +679,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x | scalar,
|
||||
@ -687,7 +687,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x | v2.x,
|
||||
@ -695,7 +695,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar | v.x,
|
||||
@ -703,7 +703,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x | v2.x,
|
||||
@ -711,7 +711,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x | v2.x,
|
||||
@ -719,7 +719,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x ^ scalar,
|
||||
@ -727,7 +727,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x ^ v2.x,
|
||||
@ -735,7 +735,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar ^ v.x,
|
||||
@ -743,7 +743,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x ^ v2.x,
|
||||
@ -751,7 +751,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x ^ v2.x,
|
||||
@ -759,7 +759,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x << scalar,
|
||||
@ -767,7 +767,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x << v2.x,
|
||||
@ -775,7 +775,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar << v.x,
|
||||
@ -783,7 +783,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x << v2.x,
|
||||
@ -791,7 +791,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x << v2.x,
|
||||
@ -799,7 +799,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v.x >> scalar,
|
||||
@ -807,7 +807,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x >> v2.x,
|
||||
@ -815,7 +815,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
scalar >> v.x,
|
||||
@ -823,7 +823,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x >> v2.x,
|
||||
@ -831,7 +831,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
v1.x >> v2.x,
|
||||
@ -839,7 +839,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const& v)
|
||||
{
|
||||
return vec<2, T, P>(
|
||||
~v.x,
|
||||
@ -849,7 +849,7 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return
|
||||
detail::compute_equal<T>::call(v1.x, v2.x) &&
|
||||
@ -857,19 +857,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const& v1, vec<2, T, P> const& v2)
|
||||
{
|
||||
return !(v1 == v2);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2)
|
||||
{
|
||||
return vec<2, bool, P>(v1.x && v2.x, v1.y && v2.y);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2)
|
||||
{
|
||||
return vec<2, bool, P>(v1.x || v2.x, v1.y || v2.y);
|
||||
}
|
||||
|
@ -82,14 +82,14 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL T const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, Q> const & v);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, Q> const& v);
|
||||
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
@ -129,19 +129,19 @@ namespace glm
|
||||
// -- Swizzle constructors --
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
template<int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & that)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const& that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
|
||||
template<int E0, int E1>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& scalar)
|
||||
{
|
||||
*this = vec(v(), scalar);
|
||||
}
|
||||
|
||||
template<int E0, int E1>
|
||||
GLM_FUNC_DECL vec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
|
||||
GLM_FUNC_DECL vec(T const& scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v)
|
||||
{
|
||||
*this = vec(scalar, v());
|
||||
}
|
||||
@ -149,34 +149,34 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator+=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator-=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator*=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator/=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const& v);
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
@ -190,217 +190,217 @@ namespace glm
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const & v);
|
||||
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const& v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(T const & scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(T const& scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const& v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator==(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -13,14 +13,14 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, P> const& v)
|
||||
: x(v.x), y(v.y), z(v.z)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(vec<3, T, Q> const& v)
|
||||
: x(v.x), y(v.y), z(v.z)
|
||||
{}
|
||||
|
||||
@ -114,7 +114,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T const & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER T const& vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
@ -124,7 +124,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, T, P> const& v)
|
||||
{
|
||||
this->x = v.x;
|
||||
this->y = v.y;
|
||||
@ -135,7 +135,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x = static_cast<T>(v.x);
|
||||
this->y = static_cast<T>(v.y);
|
||||
@ -155,7 +155,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x += static_cast<T>(v.x);
|
||||
this->y += static_cast<T>(v.x);
|
||||
@ -165,7 +165,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x += static_cast<T>(v.x);
|
||||
this->y += static_cast<T>(v.y);
|
||||
@ -185,7 +185,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x -= static_cast<T>(v.x);
|
||||
this->y -= static_cast<T>(v.x);
|
||||
@ -195,7 +195,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x -= static_cast<T>(v.x);
|
||||
this->y -= static_cast<T>(v.y);
|
||||
@ -215,7 +215,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x *= static_cast<T>(v.x);
|
||||
this->y *= static_cast<T>(v.x);
|
||||
@ -225,7 +225,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x *= static_cast<T>(v.x);
|
||||
this->y *= static_cast<T>(v.y);
|
||||
@ -245,7 +245,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x /= static_cast<T>(v.x);
|
||||
this->y /= static_cast<T>(v.x);
|
||||
@ -255,7 +255,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x /= static_cast<T>(v.x);
|
||||
this->y /= static_cast<T>(v.y);
|
||||
@ -313,7 +313,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x %= v.x;
|
||||
this->y %= v.x;
|
||||
@ -323,7 +323,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x %= v.x;
|
||||
this->y %= v.y;
|
||||
@ -343,7 +343,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x &= v.x;
|
||||
this->y &= v.x;
|
||||
@ -353,7 +353,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x &= v.x;
|
||||
this->y &= v.y;
|
||||
@ -373,7 +373,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x |= v.x;
|
||||
this->y |= v.x;
|
||||
@ -383,7 +383,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x |= v.x;
|
||||
this->y |= v.y;
|
||||
@ -403,7 +403,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x ^= v.x;
|
||||
this->y ^= v.x;
|
||||
@ -413,7 +413,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x ^= v.x;
|
||||
this->y ^= v.y;
|
||||
@ -433,7 +433,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x <<= static_cast<T>(v.x);
|
||||
this->y <<= static_cast<T>(v.x);
|
||||
@ -443,7 +443,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x <<= static_cast<T>(v.x);
|
||||
this->y <<= static_cast<T>(v.y);
|
||||
@ -463,7 +463,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<1, U, P> const& v)
|
||||
{
|
||||
this->x >>= static_cast<T>(v.x);
|
||||
this->y >>= static_cast<T>(v.x);
|
||||
@ -473,7 +473,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<3, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<3, U, P> const& v)
|
||||
{
|
||||
this->x >>= static_cast<T>(v.x);
|
||||
this->y >>= static_cast<T>(v.y);
|
||||
@ -484,13 +484,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
-v.x,
|
||||
@ -501,7 +501,7 @@ namespace glm
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x + scalar,
|
||||
@ -510,7 +510,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x + scalar.x,
|
||||
@ -519,7 +519,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar + v.x,
|
||||
@ -528,7 +528,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x + v.x,
|
||||
@ -537,7 +537,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x + v2.x,
|
||||
@ -546,7 +546,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x - scalar,
|
||||
@ -555,7 +555,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x - scalar.x,
|
||||
@ -564,7 +564,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar - v.x,
|
||||
@ -573,7 +573,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x - v.x,
|
||||
@ -582,7 +582,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x - v2.x,
|
||||
@ -591,7 +591,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x * scalar,
|
||||
@ -600,7 +600,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x * scalar.x,
|
||||
@ -609,7 +609,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar * v.x,
|
||||
@ -618,7 +618,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x * v.x,
|
||||
@ -627,7 +627,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x * v2.x,
|
||||
@ -636,7 +636,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x / scalar,
|
||||
@ -645,7 +645,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x / scalar.x,
|
||||
@ -654,7 +654,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar / v.x,
|
||||
@ -663,7 +663,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x / v.x,
|
||||
@ -672,7 +672,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x / v2.x,
|
||||
@ -683,7 +683,7 @@ namespace glm
|
||||
// -- Binary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x % scalar,
|
||||
@ -692,7 +692,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x % scalar.x,
|
||||
@ -701,7 +701,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar % v.x,
|
||||
@ -710,7 +710,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x % v.x,
|
||||
@ -719,7 +719,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x % v2.x,
|
||||
@ -728,7 +728,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x & scalar,
|
||||
@ -737,7 +737,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x & scalar.x,
|
||||
@ -746,7 +746,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar & v.x,
|
||||
@ -755,7 +755,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x & v.x,
|
||||
@ -764,7 +764,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x & v2.x,
|
||||
@ -773,7 +773,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x | scalar,
|
||||
@ -782,7 +782,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x | scalar.x,
|
||||
@ -791,7 +791,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar | v.x,
|
||||
@ -800,7 +800,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x | v.x,
|
||||
@ -809,7 +809,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x | v2.x,
|
||||
@ -818,7 +818,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x ^ scalar,
|
||||
@ -827,7 +827,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x ^ scalar.x,
|
||||
@ -836,7 +836,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar ^ v.x,
|
||||
@ -845,7 +845,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x ^ v.x,
|
||||
@ -854,7 +854,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x ^ v2.x,
|
||||
@ -863,7 +863,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x << scalar,
|
||||
@ -872,7 +872,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x << scalar.x,
|
||||
@ -881,7 +881,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar << v.x,
|
||||
@ -890,7 +890,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x << v.x,
|
||||
@ -899,7 +899,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x << v2.x,
|
||||
@ -908,7 +908,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x >> scalar,
|
||||
@ -917,7 +917,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v.x >> scalar.x,
|
||||
@ -926,7 +926,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(T scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar >> v.x,
|
||||
@ -935,7 +935,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<1, T, P> const& scalar, vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
scalar.x >> v.x,
|
||||
@ -944,7 +944,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
v1.x >> v2.x,
|
||||
@ -953,7 +953,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator~(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator~(vec<3, T, P> const& v)
|
||||
{
|
||||
return vec<3, T, P>(
|
||||
~v.x,
|
||||
@ -964,7 +964,7 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return
|
||||
detail::compute_equal<T>::call(v1.x, v2.x) &&
|
||||
@ -973,19 +973,19 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, P> const& v1, vec<3, T, P> const& v2)
|
||||
{
|
||||
return !(v1 == v2);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, bool, P> operator&&(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2)
|
||||
{
|
||||
return vec<3, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<3, bool, P> operator||(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2)
|
||||
{
|
||||
return vec<3, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL T const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
@ -150,43 +150,43 @@ namespace glm
|
||||
// -- Swizzle constructors --
|
||||
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
|
||||
template<int E0, int E1, int E2, int E3>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const & that)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const& that)
|
||||
{
|
||||
*this = that();
|
||||
}
|
||||
|
||||
template<int E0, int E1, int F0, int F1>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const& u)
|
||||
{
|
||||
*this = vec<4, T, P>(v(), u());
|
||||
}
|
||||
|
||||
template<int E0, int E1>
|
||||
GLM_FUNC_DECL vec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
|
||||
GLM_FUNC_DECL vec(T const& x, T const& y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v)
|
||||
{
|
||||
*this = vec<4, T, P>(x, y, v());
|
||||
}
|
||||
|
||||
template<int E0, int E1>
|
||||
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w)
|
||||
GLM_FUNC_DECL vec(T const& x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& w)
|
||||
{
|
||||
*this = vec<4, T, P>(x, v(), w);
|
||||
}
|
||||
|
||||
template<int E0, int E1>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const& v, T const& z, T const& w)
|
||||
{
|
||||
*this = vec<4, T, P>(v(), z, w);
|
||||
}
|
||||
|
||||
template<int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w)
|
||||
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const& v, T const& w)
|
||||
{
|
||||
*this = vec<4, T, P>(v(), w);
|
||||
}
|
||||
|
||||
template<int E0, int E1, int E2>
|
||||
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v)
|
||||
GLM_FUNC_DECL vec(T const& x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const& v)
|
||||
{
|
||||
*this = vec<4, T, P>(x, v());
|
||||
}
|
||||
@ -194,22 +194,22 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, T, P> const & v) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, T, P> const& v) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator+=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator-=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator*=(U scalar);
|
||||
template<typename U>
|
||||
@ -219,9 +219,9 @@ namespace glm
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator/=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<4, U, P> const& v);
|
||||
|
||||
// -- Increment and decrement operators --
|
||||
|
||||
@ -235,217 +235,217 @@ namespace glm
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const& v);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const& v);
|
||||
};
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, T scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const& v);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator==(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
|
||||
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2);
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
|
||||
GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2);
|
||||
}//namespace glm
|
||||
|
||||
#ifndef GLM_EXTERNAL_TEMPLATE
|
||||
|
@ -37,7 +37,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_vec4_add
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
|
||||
}
|
||||
@ -46,7 +46,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_vec4_sub
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
|
||||
}
|
||||
@ -55,7 +55,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_vec4_mul
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
|
||||
}
|
||||
@ -64,7 +64,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_vec4_div
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
|
||||
}
|
||||
@ -73,7 +73,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_vec4_mod
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w);
|
||||
}
|
||||
@ -82,7 +82,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_and
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w);
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_or
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w);
|
||||
}
|
||||
@ -100,7 +100,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_xor
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w);
|
||||
}
|
||||
@ -109,7 +109,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_shift_left
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w);
|
||||
}
|
||||
@ -118,7 +118,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_shift_right
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & a, vec<4, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
|
||||
{
|
||||
return vec<4, T, P>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w);
|
||||
}
|
||||
@ -127,7 +127,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_equal
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return
|
||||
detail::compute_equal<T>::call(v1.x, v2.x) &&
|
||||
@ -140,7 +140,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_nequal
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER static bool call(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return !compute_vec4_equal<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(v1, v2);
|
||||
}
|
||||
@ -149,7 +149,7 @@ namespace detail
|
||||
template<typename T, qualifier P, int IsInt, std::size_t Size, bool Aligned>
|
||||
struct compute_vec4_bitwise_not
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(~v.x, ~v.y, ~v.z, ~v.w);
|
||||
}
|
||||
@ -166,14 +166,14 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, P> const& v)
|
||||
: x(v.x), y(v.y), z(v.z), w(v.w)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, Q> const & v)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, P>::vec(vec<4, T, Q> const& v)
|
||||
: x(v.x), y(v.y), z(v.z), w(v.w)
|
||||
{}
|
||||
|
||||
@ -339,7 +339,7 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, T, P> const& v)
|
||||
{
|
||||
this->x = v.x;
|
||||
this->y = v.y;
|
||||
@ -351,7 +351,7 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P>& vec<4, T, P>::operator=(vec<4, U, P> const& v)
|
||||
{
|
||||
this->x = static_cast<T>(v.x);
|
||||
this->y = static_cast<T>(v.y);
|
||||
@ -369,14 +369,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_add<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v.x)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator+=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_add<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -390,14 +390,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_sub<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v.x)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator-=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_sub<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -411,14 +411,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_mul<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v.x)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator*=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_mul<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -432,14 +432,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_div<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v.x)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator/=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_div<T, P, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -514,14 +514,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_and<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator&=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_and<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -535,14 +535,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_or<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator|=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_or<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -556,14 +556,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_xor<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator^=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_xor<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -577,14 +577,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_shift_left<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator<<=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_shift_left<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -598,14 +598,14 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<1, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<1, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_shift_right<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<4, U, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> & vec<4, T, P>::operator>>=(vec<4, U, P> const& v)
|
||||
{
|
||||
return (*this = detail::compute_vec4_shift_right<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(*this, vec<4, T, P>(v)));
|
||||
}
|
||||
@ -613,13 +613,13 @@ namespace detail
|
||||
// -- Unary constant operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(0) -= v;
|
||||
}
|
||||
@ -627,121 +627,121 @@ namespace detail
|
||||
// -- Binary arithmetic operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) += scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) += v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(v) += scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v2) += v1;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) += v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) -= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) -= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) -= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) -= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) -= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) *= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) *= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(v) *= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v2) *= v1;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) *= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) /= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) /= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) /= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) /= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) /= v2;
|
||||
}
|
||||
@ -749,187 +749,187 @@ namespace detail
|
||||
// -- Binary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) %= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) %= v2.x;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) %= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<1, T, P> const& scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar.x) %= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) %= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) &= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v, vec<1, T, P> const& scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) &= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) &= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) &= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator&(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) &= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) |= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) |= v2.x;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) |= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) |= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) |= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) ^= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) ^= v2.x;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) ^= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) ^= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) ^= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) <<= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) <<= v2.x;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) <<= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) <<= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) <<= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v, T scalar)
|
||||
{
|
||||
return vec<4, T, P>(v) >>= scalar;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<1, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<1, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) >>= v2.x;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(T scalar, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(scalar) >>= v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<1, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<1, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1.x) >>= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return vec<4, T, P>(v1) >>= v2;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator~(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator~(vec<4, T, P> const& v)
|
||||
{
|
||||
return detail::compute_vec4_bitwise_not<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(v);
|
||||
}
|
||||
@ -937,25 +937,25 @@ namespace detail
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return detail::compute_vec4_equal<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(v1, v2);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(vec<4, T, P> const& v1, vec<4, T, P> const& v2)
|
||||
{
|
||||
return detail::compute_vec4_nequal<T, P, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<P>::value>::call(v1, v2);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> operator&&(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> operator&&(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2)
|
||||
{
|
||||
return vec<4, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w);
|
||||
}
|
||||
|
||||
template<qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> operator||(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> operator||(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2)
|
||||
{
|
||||
return vec<4, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_add<float, P, true>
|
||||
{
|
||||
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
|
||||
static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = _mm_add_ps(a.data, b.data);
|
||||
@ -66,7 +66,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_add<double, P, true>
|
||||
{
|
||||
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
|
||||
static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b)
|
||||
{
|
||||
vec<4, double, P> Result;
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
@ -78,7 +78,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_sub<float, P, true>
|
||||
{
|
||||
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
|
||||
static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = _mm_sub_ps(a.data, b.data);
|
||||
@ -90,7 +90,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_sub<double, P, true>
|
||||
{
|
||||
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
|
||||
static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b)
|
||||
{
|
||||
vec<4, double, P> Result;
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
@ -102,7 +102,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_mul<float, P, true>
|
||||
{
|
||||
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
|
||||
static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = _mm_mul_ps(a.data, b.data);
|
||||
@ -114,7 +114,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_mul<double, P, true>
|
||||
{
|
||||
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
|
||||
static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b)
|
||||
{
|
||||
vec<4, double, P> Result;
|
||||
Result.data = _mm256_mul_pd(a.data, b.data);
|
||||
@ -126,7 +126,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_div<float, P, true>
|
||||
{
|
||||
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
|
||||
static vec<4, float, P> call(vec<4, float, P> const& a, vec<4, float, P> const& b)
|
||||
{
|
||||
vec<4, float, P> Result;
|
||||
Result.data = _mm_div_ps(a.data, b.data);
|
||||
@ -138,7 +138,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_div<double, P, true>
|
||||
{
|
||||
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
|
||||
static vec<4, double, P> call(vec<4, double, P> const& a, vec<4, double, P> const& b)
|
||||
{
|
||||
vec<4, double, P> Result;
|
||||
Result.data = _mm256_div_pd(a.data, b.data);
|
||||
@ -150,7 +150,7 @@ namespace detail
|
||||
template<>
|
||||
struct compute_vec4_div<float, aligned_lowp, true>
|
||||
{
|
||||
static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & a, vec<4, float, aligned_lowp> const & b)
|
||||
static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& a, vec<4, float, aligned_lowp> const& b)
|
||||
{
|
||||
vec<4, float, aligned_lowp> Result;
|
||||
Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
|
||||
@ -281,7 +281,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 32, true>
|
||||
{
|
||||
static vec<4, T, P> call(vec<4, T, P> const & v)
|
||||
static vec<4, T, P> call(vec<4, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> Result;
|
||||
Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1));
|
||||
@ -293,7 +293,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 64, true>
|
||||
{
|
||||
static vec<4, T, P> call(vec<4, T, P> const & v)
|
||||
static vec<4, T, P> call(vec<4, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> Result;
|
||||
Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1));
|
||||
@ -305,7 +305,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_equal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
|
||||
static bool call(vec<4, float, P> const& v1, vec<4, float, P> const& v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
@ -314,7 +314,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_equal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
|
||||
static bool call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
@ -323,7 +323,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_nequal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
|
||||
static bool call(vec<4, float, P> const& v1, vec<4, float, P> const& v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
@ -332,7 +332,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_vec4_nequal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
|
||||
static bool call(vec<4, int32, P> const& v1, vec<4, int32, P> const& v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<typename T, qualifier P, template<typename, qualifier> class vecIUType>
|
||||
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
|
||||
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const& v);
|
||||
|
||||
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
|
||||
///
|
||||
@ -52,7 +52,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const & In, int Shift);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, 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.
|
||||
///
|
||||
@ -64,7 +64,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const & In, int Shift);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const& In, int Shift);
|
||||
|
||||
/// Set to 1 a range of bits.
|
||||
///
|
||||
@ -76,7 +76,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const & Value, int FirstBit, int BitCount);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const& Value, int FirstBit, int BitCount);
|
||||
|
||||
/// Set to 0 a range of bits.
|
||||
///
|
||||
@ -88,7 +88,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_bitfield
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, T, P> const & Value, int FirstBit, int BitCount);
|
||||
GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, 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.
|
||||
|
@ -248,7 +248,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const & In, int Shift)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const& In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
|
||||
|
@ -33,22 +33,22 @@ namespace glm
|
||||
/// Convert a linear color to sRGB color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const & ColorLinear);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear);
|
||||
|
||||
/// Convert a linear color to sRGB color using a custom gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const & ColorLinear, T Gamma);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear, T Gamma);
|
||||
|
||||
/// Convert a sRGB color to linear color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const & ColorSRGB);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB);
|
||||
|
||||
/// Convert a sRGB color to linear color using a custom gamma correction.
|
||||
// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const & ColorSRGB, T Gamma);
|
||||
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB, T Gamma);
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
|
@ -31,28 +31,28 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const & epsilon);
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, 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);
|
||||
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<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const & epsilon);
|
||||
GLM_FUNC_DECL vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T 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);
|
||||
GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -14,9 +14,9 @@ namespace glm
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
float const & x,
|
||||
float const & y,
|
||||
float const & epsilon
|
||||
float const& x,
|
||||
float const& y,
|
||||
float const& epsilon
|
||||
)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
@ -25,9 +25,9 @@ namespace glm
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
double const & x,
|
||||
double const & y,
|
||||
double const & epsilon
|
||||
double const& x,
|
||||
double const& y,
|
||||
double const& epsilon
|
||||
)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
@ -46,7 +46,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const & y, float const& epsilon)
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon)
|
||||
{
|
||||
return abs(x - y) >= epsilon;
|
||||
}
|
||||
@ -70,7 +70,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat<T, P> const& x, tquat<T, P> const & y, T const& epsilon)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat<T, P> const& x, tquat<T, P> const& y, T const& epsilon)
|
||||
{
|
||||
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
|
||||
return lessThan(abs(v), vec<4, T, P>(epsilon));
|
||||
|
@ -27,31 +27,31 @@ namespace glm
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::row_type row(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index);
|
||||
|
||||
/// Set a specific row to a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType row(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::row_type const & x);
|
||||
typename genType::row_type const& x);
|
||||
|
||||
/// Get a specific column of a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::col_type column(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index);
|
||||
|
||||
/// Set a specific column to a matrix.
|
||||
/// @see gtc_matrix_access
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType column(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::col_type const & x);
|
||||
typename genType::col_type const& x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -6,9 +6,9 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType row
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::row_type const & x
|
||||
typename genType::row_type const& x
|
||||
)
|
||||
{
|
||||
assert(index >= 0 && index < m[0].length());
|
||||
@ -22,7 +22,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER typename genType::row_type row
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index
|
||||
)
|
||||
{
|
||||
@ -37,9 +37,9 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType column
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index,
|
||||
typename genType::col_type const & x
|
||||
typename genType::col_type const& x
|
||||
)
|
||||
{
|
||||
assert(index >= 0 && index < m.length());
|
||||
@ -52,7 +52,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER typename genType::col_type column
|
||||
(
|
||||
genType const & m,
|
||||
genType const& m,
|
||||
length_t index
|
||||
)
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace glm
|
||||
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
|
||||
/// @see gtc_matrix_inverse
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType affineInverse(genType const & m);
|
||||
GLM_FUNC_DECL genType affineInverse(genType const& m);
|
||||
|
||||
/// Compute the inverse transpose of a matrix.
|
||||
///
|
||||
@ -41,7 +41,7 @@ namespace glm
|
||||
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate.
|
||||
/// @see gtc_matrix_inverse
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType inverseTranspose(genType const & m);
|
||||
GLM_FUNC_DECL genType inverseTranspose(genType const& m);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -4,7 +4,7 @@
|
||||
namespace glm
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m)));
|
||||
|
||||
@ -15,7 +15,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m)));
|
||||
|
||||
@ -27,7 +27,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const& m)
|
||||
{
|
||||
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
|
||||
|
||||
@ -41,7 +41,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
T Determinant =
|
||||
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
|
||||
@ -64,7 +64,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const& m)
|
||||
{
|
||||
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
|
||||
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
|
||||
|
@ -52,12 +52,12 @@ namespace glm
|
||||
/// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
|
||||
/// @endcode
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - translate(mat<4, 4, T, P> const & m, T x, T y, T z)
|
||||
/// @see - translate(vec<3, T, P> const & v)
|
||||
/// @see - translate(mat<4, 4, T, P> const& m, T x, T y, T z)
|
||||
/// @see - translate(vec<3, T, P> const& v)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> translate(
|
||||
mat<4, 4, T, P> const& m,
|
||||
vec<3, T, P> const & v);
|
||||
vec<3, T, P> const& v);
|
||||
|
||||
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
|
||||
///
|
||||
@ -66,13 +66,13 @@ namespace glm
|
||||
/// @param axis Rotation axis, recommended to be normalized.
|
||||
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - rotate(mat<4, 4, T, P> const & m, T angle, T x, T y, T z)
|
||||
/// @see - rotate(T angle, vec<3, T, P> const & v)
|
||||
/// @see - rotate(mat<4, 4, T, P> const& m, T angle, T x, T y, T z)
|
||||
/// @see - rotate(T angle, vec<3, T, P> const& v)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> rotate(
|
||||
mat<4, 4, T, P> const& m,
|
||||
T angle,
|
||||
vec<3, T, P> const & axis);
|
||||
vec<3, T, P> const& axis);
|
||||
|
||||
/// Builds a scale 4 * 4 matrix created from 3 scalars.
|
||||
///
|
||||
@ -80,12 +80,12 @@ namespace glm
|
||||
/// @param v Ratio of scaling for each axis.
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - scale(mat<4, 4, T, P> const & m, T x, T y, T z)
|
||||
/// @see - scale(vec<3, T, P> const & v)
|
||||
/// @see - scale(mat<4, 4, T, P> const& m, T x, T y, T z)
|
||||
/// @see - scale(vec<3, T, P> const& v)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> scale(
|
||||
mat<4, 4, T, P> const& m,
|
||||
vec<3, T, P> const & v);
|
||||
vec<3, T, P> const& v);
|
||||
|
||||
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
|
||||
///
|
||||
@ -97,7 +97,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
|
||||
T left,
|
||||
@ -117,7 +117,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH(
|
||||
T left,
|
||||
@ -137,7 +137,7 @@ namespace glm
|
||||
/// @param zFar
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH(
|
||||
T left,
|
||||
@ -155,7 +155,7 @@ namespace glm
|
||||
/// @param top
|
||||
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)
|
||||
/// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar)
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
|
||||
T left,
|
||||
@ -384,10 +384,10 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> project(
|
||||
vec<3, T, P> const & obj,
|
||||
vec<3, T, P> const& obj,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport);
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
|
||||
///
|
||||
@ -401,10 +401,10 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> unProject(
|
||||
vec<3, T, P> const & win,
|
||||
vec<3, T, P> const& win,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport);
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Define a picking region
|
||||
///
|
||||
@ -416,9 +416,9 @@ namespace glm
|
||||
/// @see gtc_matrix_transform
|
||||
template<typename T, qualifier P, typename U>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix(
|
||||
vec<2, T, P> const & center,
|
||||
vec<2, T, P> const & delta,
|
||||
vec<4, U, P> const & viewport);
|
||||
vec<2, T, P> const& center,
|
||||
vec<2, T, P> const& delta,
|
||||
vec<4, U, P> const& viewport);
|
||||
|
||||
/// Build a look at view matrix based on the default handedness.
|
||||
///
|
||||
@ -426,12 +426,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
|
||||
/// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> lookAt(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// Build a right handed look at view matrix.
|
||||
///
|
||||
@ -439,12 +439,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
|
||||
/// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// Build a left handed look at view matrix.
|
||||
///
|
||||
@ -452,12 +452,12 @@ namespace glm
|
||||
/// @param center Position where the camera is looking at
|
||||
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
|
||||
/// @see gtc_matrix_transform
|
||||
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
|
||||
/// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal)
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up);
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -8,7 +8,7 @@
|
||||
namespace glm
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
|
||||
{
|
||||
mat<4, 4, T, P> Result(m);
|
||||
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
|
||||
@ -16,7 +16,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const& m, T angle, vec<3, T, P> const& v)
|
||||
{
|
||||
T const a = angle;
|
||||
T const c = cos(a);
|
||||
@ -47,7 +47,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const& m, T angle, vec<3, T, P> const& v)
|
||||
{
|
||||
T const a = angle;
|
||||
T const c = cos(a);
|
||||
@ -76,7 +76,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
|
||||
{
|
||||
mat<4, 4, T, P> Result;
|
||||
Result[0] = m[0] * v[0];
|
||||
@ -87,7 +87,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
|
||||
{
|
||||
mat<4, 4, T, P> Result(T(1));
|
||||
Result[0][0] = v.x;
|
||||
@ -438,10 +438,10 @@ namespace glm
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> project
|
||||
(
|
||||
vec<3, T, P> const & obj,
|
||||
vec<3, T, P> const& obj,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport
|
||||
vec<4, U, P> const& viewport
|
||||
)
|
||||
{
|
||||
vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast<T>(1));
|
||||
@ -464,10 +464,10 @@ namespace glm
|
||||
template<typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
|
||||
(
|
||||
vec<3, T, P> const & win,
|
||||
vec<3, T, P> const& win,
|
||||
mat<4, 4, T, P> const& model,
|
||||
mat<4, 4, T, P> const& proj,
|
||||
vec<4, U, P> const & viewport
|
||||
vec<4, U, P> const& viewport
|
||||
)
|
||||
{
|
||||
mat<4, 4, T, P> Inverse = inverse(proj * model);
|
||||
@ -489,7 +489,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P, typename U>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const& center, vec<2, T, P> const& delta, vec<4, U, P> const& viewport)
|
||||
{
|
||||
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
|
||||
mat<4, 4, T, P> Result(static_cast<T>(1));
|
||||
@ -508,7 +508,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const& eye, vec<3, T, P> const& center, vec<3, T, P> const& up)
|
||||
{
|
||||
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
|
||||
return lookAtLH(eye, center, up);
|
||||
@ -520,9 +520,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
|
||||
(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up
|
||||
)
|
||||
{
|
||||
vec<3, T, P> const f(normalize(center - eye));
|
||||
@ -548,9 +548,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
|
||||
(
|
||||
vec<3, T, P> const & eye,
|
||||
vec<3, T, P> const & center,
|
||||
vec<3, T, P> const & up
|
||||
vec<3, T, P> const& eye,
|
||||
vec<3, T, P> const& center,
|
||||
vec<3, T, P> const& up
|
||||
)
|
||||
{
|
||||
vec<3, T, P> const f(normalize(center - eye));
|
||||
|
@ -10,7 +10,7 @@ namespace glm{
|
||||
namespace gtc
|
||||
{
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const & j, vec<4, T, P> const & ip)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const& j, vec<4, T, P> const& ip)
|
||||
{
|
||||
vec<3, T, P> pXYZ = floor(fract(vec<3, T, P>(j) * vec<3, T, P>(ip)) * T(7)) * ip[2] - T(1);
|
||||
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), vec<3, T, P>(1));
|
||||
@ -22,7 +22,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position)
|
||||
{
|
||||
vec<4, T, P> Pi = glm::floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
vec<4, T, P> Pf = glm::fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
@ -63,7 +63,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position)
|
||||
{
|
||||
vec<3, T, P> Pi0 = floor(Position); // Integer part for indexing
|
||||
vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@ -134,7 +134,7 @@ namespace gtc
|
||||
/*
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & P)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& P)
|
||||
{
|
||||
vec<3, T, P> Pi0 = floor(P); // Integer part for indexing
|
||||
vec<3, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@ -207,7 +207,7 @@ namespace gtc
|
||||
*/
|
||||
// Classic Perlin noise
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position)
|
||||
{
|
||||
vec<4, T, P> Pi0 = floor(Position); // Integer part for indexing
|
||||
vec<4, T, P> Pi1 = Pi0 + T(1); // Integer part + 1
|
||||
@ -343,7 +343,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic variant
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position, vec<2, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const& Position, vec<2, T, P> const& rep)
|
||||
{
|
||||
vec<4, T, P> Pi = floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
vec<4, T, P> Pf = fract(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
|
||||
@ -385,7 +385,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic variant
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position, vec<3, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const& Position, vec<3, T, P> const& rep)
|
||||
{
|
||||
vec<3, T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period
|
||||
vec<3, T, P> Pi1 = mod(Pi0 + vec<3, T, P>(T(1)), rep); // Integer part + 1, mod period
|
||||
@ -456,7 +456,7 @@ namespace gtc
|
||||
|
||||
// Classic Perlin noise, periodic version
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position, vec<4, T, P> const & rep)
|
||||
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const& Position, vec<4, T, P> const& rep)
|
||||
{
|
||||
vec<4, T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep
|
||||
vec<4, T, P> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep
|
||||
@ -589,7 +589,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> const C = vec<4, T, P>(
|
||||
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
|
||||
@ -646,7 +646,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const& v)
|
||||
{
|
||||
vec<2, T, P> const C(1.0 / 6.0, 1.0 / 3.0);
|
||||
vec<4, T, P> const D(0.0, 0.5, 1.0, 2.0);
|
||||
@ -721,7 +721,7 @@ namespace gtc
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const& v)
|
||||
{
|
||||
vec<4, T, P> const C(
|
||||
0.138196601125011, // (5 - sqrt(5))/20 G4
|
||||
|
@ -32,8 +32,8 @@ namespace glm
|
||||
/// packUnorm1x8: round(clamp(c, 0, +1) * 255.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm2x8(vec2 const & v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const & v)
|
||||
/// @see uint16 packUnorm2x8(vec2 const& v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint8 packUnorm1x8(float v);
|
||||
@ -60,11 +60,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm1x8(float const & v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const & v)
|
||||
/// @see uint8 packUnorm1x8(float const& v)
|
||||
/// @see uint32 packUnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v);
|
||||
|
||||
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
|
||||
@ -89,8 +89,8 @@ namespace glm
|
||||
/// packSnorm1x8: round(clamp(s, -1, +1) * 127.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm2x8(vec2 const & v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const & v)
|
||||
/// @see uint16 packSnorm2x8(vec2 const& v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint8 packSnorm1x8(float s);
|
||||
@ -118,11 +118,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packSnorm1x8(float const & v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const & v)
|
||||
/// @see uint8 packSnorm1x8(float const& v)
|
||||
/// @see uint32 packSnorm4x8(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const & v);
|
||||
GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v);
|
||||
|
||||
/// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector.
|
||||
@ -147,8 +147,8 @@ namespace glm
|
||||
/// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm1x16(float const & v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const & v)
|
||||
/// @see uint16 packSnorm1x16(float const& v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packUnorm1x16(float v);
|
||||
@ -176,11 +176,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm1x16(float const & v)
|
||||
/// @see uint32 packUnorm2x16(vec2 const & v)
|
||||
/// @see uint16 packUnorm1x16(float const& v)
|
||||
/// @see uint32 packUnorm2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@ -205,8 +205,8 @@ namespace glm
|
||||
/// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0)
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm2x16(vec2 const & v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const & v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const& v)
|
||||
/// @see uint64 packSnorm4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packSnorm1x16(float v);
|
||||
@ -234,11 +234,11 @@ namespace glm
|
||||
/// the last component will be written to the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packSnorm1x16(float const & v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const & v)
|
||||
/// @see uint16 packSnorm1x16(float const& v)
|
||||
/// @see uint32 packSnorm2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@ -261,8 +261,8 @@ namespace glm
|
||||
/// and then packing this 16-bit value into a 16-bit unsigned integer.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packHalf2x16(vec2 const & v)
|
||||
/// @see uint64 packHalf4x16(vec4 const & v)
|
||||
/// @see uint32 packHalf2x16(vec2 const& v)
|
||||
/// @see uint64 packHalf4x16(vec4 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint16 packHalf1x16(float v);
|
||||
@ -272,8 +272,8 @@ namespace glm
|
||||
/// and converting it to 32-bit floating-point values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec2 unpackHalf2x16(uint32 const & v)
|
||||
/// @see vec4 unpackHalf4x16(uint64 const & v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const& v)
|
||||
/// @see vec4 unpackHalf4x16(uint64 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL float unpackHalf1x16(uint16 v);
|
||||
@ -285,11 +285,11 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packHalf1x16(float const & v)
|
||||
/// @see uint32 packHalf2x16(vec2 const & v)
|
||||
/// @see uint16 packHalf1x16(float const& v)
|
||||
/// @see uint32 packHalf2x16(vec2 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const & v);
|
||||
GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v);
|
||||
|
||||
/// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values,
|
||||
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
|
||||
@ -298,8 +298,8 @@ namespace glm
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see float unpackHalf1x16(uint16 const & v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const & v)
|
||||
/// @see float unpackHalf1x16(uint16 const& v)
|
||||
/// @see vec2 unpackHalf2x16(uint32 const& v)
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p);
|
||||
@ -311,11 +311,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packI3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see ivec4 unpackI3x10_1x2(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const & v);
|
||||
/// @see uint32 packI3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see ivec4 unpackI3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v);
|
||||
|
||||
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers.
|
||||
///
|
||||
@ -323,9 +323,9 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p);
|
||||
GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p);
|
||||
|
||||
/// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector
|
||||
@ -335,11 +335,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see ivec4 unpackU3x10_1x2(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const & v);
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see ivec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v);
|
||||
|
||||
/// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers.
|
||||
///
|
||||
@ -347,9 +347,9 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p);
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p);
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p);
|
||||
GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values.
|
||||
@ -364,11 +364,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const & v);
|
||||
/// @see vec4 unpackSnorm3x10_1x2(uint32 const& p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@ -381,10 +381,10 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const & p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const& p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values.
|
||||
@ -399,11 +399,11 @@ namespace glm
|
||||
/// the forth component specifies the 2 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const & v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const & v);
|
||||
/// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)
|
||||
/// @see uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
/// @see uint32 packU3x10_1x2(uvec4 const& v)
|
||||
/// @see uint32 packI3x10_1x2(ivec4 const& v)
|
||||
GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers.
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector.
|
||||
@ -416,10 +416,10 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
/// @see vec4 unpackInorm3x10_1x2(uint32 const & p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const & p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const & p)
|
||||
/// @see uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
/// @see vec4 unpackInorm3x10_1x2(uint32 const& p))
|
||||
/// @see uvec4 unpackI3x10_1x2(uint32 const& p)
|
||||
/// @see uvec4 unpackU3x10_1x2(uint32 const& p)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p);
|
||||
|
||||
/// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values.
|
||||
@ -430,8 +430,8 @@ namespace glm
|
||||
/// the last component specifies the 10 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackF2x11_1x10(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const & v);
|
||||
/// @see vec3 unpackF2x11_1x10(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector.
|
||||
@ -440,7 +440,7 @@ namespace glm
|
||||
/// the last component will be extracted from the most significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packF2x11_1x10(vec3 const & v)
|
||||
/// @see uint32 packF2x11_1x10(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p);
|
||||
|
||||
|
||||
@ -454,8 +454,8 @@ namespace glm
|
||||
/// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackF3x9_E1x5(uint32 const & p)
|
||||
GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const & v);
|
||||
/// @see vec3 unpackF3x9_E1x5(uint32 const& p)
|
||||
GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v);
|
||||
|
||||
/// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value .
|
||||
/// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector.
|
||||
@ -466,7 +466,7 @@ namespace glm
|
||||
/// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint32 packF3x9_E1x5(vec3 const & v)
|
||||
/// @see uint32 packF3x9_E1x5(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p);
|
||||
|
||||
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
|
||||
@ -475,20 +475,20 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const & p)
|
||||
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const& p)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const & rgb);
|
||||
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const& rgb);
|
||||
|
||||
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const & v)
|
||||
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const& v)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm);
|
||||
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm);
|
||||
|
||||
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
|
||||
/// to the 16-bit floating-point representation found in the OpenGL Specification.
|
||||
@ -496,107 +496,107 @@ namespace glm
|
||||
/// the forth component specifies the 16 most-significant bits.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, float, P> unpackHalf(vec<L, uint16, P> const & p)
|
||||
/// @see vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uint16, P> packHalf(vec<L, float, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, uint16, P> packHalf(vec<L, float, P> const& v);
|
||||
|
||||
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
|
||||
/// The first component of the vector is obtained from the 16 least-significant bits of v;
|
||||
/// the forth component is obtained from the 16 most-significant bits of v.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, uint16, P> packHalf(vec<L, float, P> const & v)
|
||||
/// @see vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
|
||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, float, P> unpackHalf(vec<L, uint16, P> const & p);
|
||||
GLM_FUNC_DECL vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, floatType, P> unpackUnorm(vec<L, intType, P> const & p);
|
||||
/// @see vec<L, floatType, P> unpackUnorm(vec<L, intType, P> const& p);
|
||||
template<typename uintType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, intType, P> packUnorm(vec<L, floatType, P> const & v)
|
||||
/// @see vec<L, intType, P> packUnorm(vec<L, floatType, P> const& v)
|
||||
template<typename floatType, length_t L, typename uintType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into signed integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & p);
|
||||
/// @see vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& p);
|
||||
template<typename intType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
|
||||
/// @see vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
|
||||
template<typename floatType, length_t L, typename intType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec2 unpackUnorm2x4(uint8 p)
|
||||
GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const & v);
|
||||
GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm2x4(vec2 const & v)
|
||||
/// @see uint8 packUnorm2x4(vec2 const& v)
|
||||
GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm4x4(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm4x4(vec4 const & v)
|
||||
/// @see uint16 packUnorm4x4(vec4 const& v)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm1x5_1x6_1x5(vec3 const & v)
|
||||
/// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec4 unpackUnorm3x5_1x1(uint16 p)
|
||||
GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const & v);
|
||||
GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint16 packUnorm3x5_1x1(vec4 const & v)
|
||||
/// @see uint16 packUnorm3x5_1x1(vec4 const& v)
|
||||
GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p);
|
||||
|
||||
/// Convert each component of the normalized floating-point vector into unsigned integer values.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see vec3 unpackUnorm2x3_1x2(uint8 p)
|
||||
GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const & v);
|
||||
GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v);
|
||||
|
||||
/// Convert a packed integer to a normalized floating-point vector.
|
||||
///
|
||||
/// @see gtc_packing
|
||||
/// @see uint8 packUnorm2x3_1x2(vec3 const & v)
|
||||
/// @see uint8 packUnorm2x3_1x2(vec3 const& v)
|
||||
GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p);
|
||||
|
||||
|
||||
|
@ -278,7 +278,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<1, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const& v)
|
||||
{
|
||||
int16 const Unpack(detail::toFloat16(v.x));
|
||||
u16vec1 Packed;
|
||||
@ -286,7 +286,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const& v)
|
||||
{
|
||||
i16vec1 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@ -297,7 +297,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<2, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const& v)
|
||||
{
|
||||
vec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
|
||||
u16vec2 Packed;
|
||||
@ -305,7 +305,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const& v)
|
||||
{
|
||||
i16vec2 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@ -316,7 +316,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<3, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const& v)
|
||||
{
|
||||
vec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
|
||||
u16vec3 Packed;
|
||||
@ -324,7 +324,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const& v)
|
||||
{
|
||||
i16vec3 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@ -335,7 +335,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_half<4, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const& v)
|
||||
{
|
||||
vec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
|
||||
u16vec4 Packed;
|
||||
@ -343,7 +343,7 @@ namespace detail
|
||||
return Packed;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const& v)
|
||||
{
|
||||
i16vec4 Unpack;
|
||||
memcpy(&Unpack, &v, sizeof(Unpack));
|
||||
@ -363,7 +363,7 @@ namespace detail
|
||||
return Unpack * static_cast<float>(0.0039215686274509803921568627451); // 1 / 255
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v)
|
||||
{
|
||||
u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f));
|
||||
|
||||
@ -396,7 +396,7 @@ namespace detail
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v)
|
||||
{
|
||||
i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f));
|
||||
uint16 Packed = 0;
|
||||
@ -424,7 +424,7 @@ namespace detail
|
||||
return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const& v)
|
||||
{
|
||||
u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f));
|
||||
uint64 Packed = 0;
|
||||
@ -456,7 +456,7 @@ namespace detail
|
||||
-1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const& v)
|
||||
{
|
||||
i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f));
|
||||
uint64 Packed = 0;
|
||||
@ -488,7 +488,7 @@ namespace detail
|
||||
return detail::toFloat32(Unpack);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const& v)
|
||||
{
|
||||
i16vec4 const Unpack(
|
||||
detail::toFloat16(v.x),
|
||||
@ -511,7 +511,7 @@ namespace detail
|
||||
detail::toFloat32(Unpack.w));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const& v)
|
||||
{
|
||||
detail::i10i10i10i2 Result;
|
||||
Result.data.x = v.x;
|
||||
@ -532,7 +532,7 @@ namespace detail
|
||||
Unpack.data.w);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const& v)
|
||||
{
|
||||
detail::u10u10u10u2 Result;
|
||||
Result.data.x = v.x;
|
||||
@ -553,7 +553,7 @@ namespace detail
|
||||
Unpack.data.w);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const& v)
|
||||
{
|
||||
ivec4 const Pack(round(clamp(v,-1.0f, 1.0f) * vec4(511.f, 511.f, 511.f, 1.f)));
|
||||
|
||||
@ -575,7 +575,7 @@ namespace detail
|
||||
return clamp(Result * vec4(1.f / 511.f, 1.f / 511.f, 1.f / 511.f, 1.f), -1.0f, 1.0f);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const& v)
|
||||
{
|
||||
uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f)));
|
||||
|
||||
@ -596,7 +596,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const& v)
|
||||
{
|
||||
return
|
||||
((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) |
|
||||
@ -612,7 +612,7 @@ namespace detail
|
||||
detail::packed10bitToFloat(v >> 22));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const& v)
|
||||
{
|
||||
float const SharedExpMax = (pow(2.0f, 9.0f - 1.0f) / pow(2.0f, 9.0f)) * pow(2.0f, 31.f - 15.f);
|
||||
vec3 const Color = clamp(v, 0.0f, SharedExpMax);
|
||||
@ -642,7 +642,7 @@ namespace detail
|
||||
|
||||
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const& rgb)
|
||||
{
|
||||
vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
|
||||
T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast<T>(1e-6))), static_cast<T>(0), static_cast<T>(1));
|
||||
@ -651,19 +651,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm)
|
||||
{
|
||||
return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
|
||||
}
|
||||
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, uint16, P> packHalf(vec<L, float, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
|
||||
{
|
||||
return detail::compute_half<L, P>::pack(v);
|
||||
}
|
||||
|
||||
template<length_t L, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, float, P> unpackHalf(vec<L, uint16, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, float, P> unpackHalf(vec<L, uint16, P> const& v)
|
||||
{
|
||||
return detail::compute_half<L, P>::unpack(v);
|
||||
}
|
||||
@ -687,7 +687,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename intType, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
@ -696,7 +696,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename floatType, length_t L, typename intType, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
@ -704,7 +704,7 @@ namespace detail
|
||||
return clamp(vec<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v)
|
||||
{
|
||||
u32vec2 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f));
|
||||
detail::u4u4 Result;
|
||||
@ -721,7 +721,7 @@ namespace detail
|
||||
return vec2(Unpack.data.x, Unpack.data.y) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const& v)
|
||||
{
|
||||
u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f));
|
||||
detail::u4u4u4u4 Result;
|
||||
@ -740,7 +740,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const& v)
|
||||
{
|
||||
u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(31.f, 63.f, 31.f)));
|
||||
detail::u5u6u5 Result;
|
||||
@ -758,7 +758,7 @@ namespace detail
|
||||
return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const & v)
|
||||
GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const& v)
|
||||
{
|
||||
u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(31.f, 31.f, 31.f, 1.f)));
|
||||
detail::u5u5u5u1 Result;
|
||||
@ -777,7 +777,7 @@ namespace detail
|
||||
return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const & v)
|
||||
GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const& v)
|
||||
{
|
||||
u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(7.f, 7.f, 3.f)));
|
||||
detail::u3u3u2 Result;
|
||||
|
@ -73,7 +73,7 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
|
||||
|
||||
GLM_FUNC_DECL T & operator[](length_type i);
|
||||
GLM_FUNC_DECL T const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL T const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
@ -104,7 +104,7 @@ namespace glm
|
||||
/// @param v A second normalized axis
|
||||
/// @see gtc_quaternion
|
||||
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
|
||||
GLM_FUNC_DECL tquat(vec<3, T, P> const & u, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL tquat(vec<3, T, P> const& u, vec<3, T, P> const& v);
|
||||
|
||||
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const& eulerAngles);
|
||||
@ -140,39 +140,39 @@ namespace glm
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> operator*(T const& s, tquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const& q, T const& s);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2);
|
||||
|
||||
/// Returns the length of the quaternion.
|
||||
///
|
||||
@ -180,7 +180,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL T length(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL T length(tquat<T, P> const& q);
|
||||
|
||||
/// Returns the normalized quaternion.
|
||||
///
|
||||
@ -188,7 +188,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const& q);
|
||||
|
||||
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
|
||||
///
|
||||
@ -196,7 +196,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL T dot(tquat<T, P> const & x, tquat<T, P> const & y);
|
||||
GLM_FUNC_DECL T dot(tquat<T, P> const& x, tquat<T, P> const& y);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions.
|
||||
/// The interpolation is oriented and the rotation is performed at constant speed.
|
||||
@ -207,10 +207,10 @@ namespace glm
|
||||
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
|
||||
/// @tparam T Floating-point scalar types.
|
||||
///
|
||||
/// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
|
||||
/// @see - slerp(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Linear interpolation of two quaternions.
|
||||
/// The interpolation is oriented.
|
||||
@ -222,7 +222,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Spherical linear interpolation of two quaternions.
|
||||
/// The interpolation always take the short path and the rotation is performed at constant speed.
|
||||
@ -234,7 +234,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
|
||||
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
|
||||
|
||||
/// Returns the q conjugate.
|
||||
///
|
||||
@ -242,7 +242,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const& q);
|
||||
|
||||
/// Returns the q inverse.
|
||||
///
|
||||
@ -250,7 +250,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const& q);
|
||||
|
||||
/// Rotates a quaternion from a vector of 3 components axis and an angle.
|
||||
///
|
||||
@ -261,7 +261,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis);
|
||||
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& axis);
|
||||
|
||||
/// Returns euler angles, pitch as x, yaw as y, roll as z.
|
||||
/// The result is expressed in radians.
|
||||
@ -270,7 +270,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x);
|
||||
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const& x);
|
||||
|
||||
/// Returns roll value of euler angles expressed in radians.
|
||||
///
|
||||
|
@ -60,7 +60,7 @@ namespace detail
|
||||
template<typename T, qualifier P, bool Aligned>
|
||||
struct compute_quat_mul_vec4
|
||||
{
|
||||
static vec<4, T, P> call(tquat<T, P> const & q, vec<4, T, P> const & v)
|
||||
static vec<4, T, P> call(tquat<T, P> const& q, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(q * vec<3, T, P>(v), v.w);
|
||||
}
|
||||
@ -77,7 +77,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER T const& tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&x)[i];
|
||||
@ -93,7 +93,7 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const& q)
|
||||
: x(q.x), y(q.y), z(q.z), w(q.w)
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
@ -130,9 +130,9 @@ namespace detail
|
||||
//template<typename valType>
|
||||
//GLM_FUNC_QUALIFIER tquat<valType>::tquat
|
||||
//(
|
||||
// valType const & pitch,
|
||||
// valType const & yaw,
|
||||
// valType const & roll
|
||||
// valType const& pitch,
|
||||
// valType const& yaw,
|
||||
// valType const& roll
|
||||
//)
|
||||
//{
|
||||
// vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5));
|
||||
@ -200,7 +200,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const& q)
|
||||
{
|
||||
return conjugate(q) / dot(q, q);
|
||||
}
|
||||
@ -209,7 +209,7 @@ namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const& q)
|
||||
{
|
||||
this->w = q.w;
|
||||
this->x = q.x;
|
||||
@ -221,7 +221,7 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const& q)
|
||||
{
|
||||
this->w = static_cast<T>(q.w);
|
||||
this->x = static_cast<T>(q.x);
|
||||
@ -246,7 +246,7 @@ namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const& r)
|
||||
{
|
||||
tquat<T, P> const p(*this);
|
||||
tquat<T, P> const q(r);
|
||||
@ -275,13 +275,13 @@ namespace detail
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const& q)
|
||||
{
|
||||
return tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
|
||||
}
|
||||
@ -289,19 +289,19 @@ namespace detail
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p)
|
||||
{
|
||||
return tquat<T, P>(q) += p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p)
|
||||
{
|
||||
return tquat<T, P>(q) *= p;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v)
|
||||
{
|
||||
vec<3, T, P> const QuatVector(q.x, q.y, q.z);
|
||||
vec<3, T, P> const uv(glm::cross(QuatVector, v));
|
||||
@ -311,7 +311,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
@ -323,26 +323,26 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q.w * s, q.x * s, q.y * s, q.z * s);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const& s, tquat<T, P> const& q)
|
||||
{
|
||||
return q * s;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q.w / s, q.x / s, q.y / s, q.z / s);
|
||||
@ -351,13 +351,13 @@ namespace detail
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return all(epsilonEqual(q1, q2, epsilon<T>()));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return any(epsilonNotEqual(q1, q2, epsilon<T>()));
|
||||
}
|
||||
@ -365,13 +365,13 @@ namespace detail
|
||||
// -- Operations --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T length(tquat<T, P> const& q)
|
||||
{
|
||||
return glm::sqrt(dot(q, q));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const& q)
|
||||
{
|
||||
T len = length(q);
|
||||
if(len <= T(0)) // Problem
|
||||
@ -381,7 +381,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const& q1, tquat<T, P> const& q2)
|
||||
{
|
||||
return tquat<T, P>(
|
||||
q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,
|
||||
@ -392,7 +392,7 @@ namespace detail
|
||||
/*
|
||||
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
|
||||
{
|
||||
if(a <= T(0)) return x;
|
||||
if(a >= T(1)) return y;
|
||||
@ -431,9 +431,9 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix2
|
||||
(
|
||||
tquat<T, P> const & x,
|
||||
tquat<T, P> const & y,
|
||||
T const & a
|
||||
tquat<T, P> const& x,
|
||||
tquat<T, P> const& y,
|
||||
T const& a
|
||||
)
|
||||
{
|
||||
bool flip = false;
|
||||
@ -467,7 +467,7 @@ namespace detail
|
||||
*/
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
T cosTheta = dot(x, y);
|
||||
|
||||
@ -490,7 +490,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
// Lerp is only defined in [0, 1]
|
||||
assert(a >= static_cast<T>(0));
|
||||
@ -500,7 +500,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
|
||||
{
|
||||
tquat<T, P> z = y;
|
||||
|
||||
@ -533,7 +533,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& v)
|
||||
{
|
||||
vec<3, T, P> Tmp = v;
|
||||
|
||||
@ -555,19 +555,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const& x)
|
||||
{
|
||||
return vec<3, T, P>(pitch(x), yaw(x), roll(x));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const& q)
|
||||
{
|
||||
return static_cast<T>(atan(static_cast<T>(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const& q)
|
||||
{
|
||||
//return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
|
||||
const T y = static_cast<T>(2) * (q.y * q.z + q.w * q.x);
|
||||
@ -580,13 +580,13 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const& q)
|
||||
{
|
||||
return asin(clamp(static_cast<T>(-2) * (q.x * q.z - q.w * q.y), static_cast<T>(-1), static_cast<T>(1)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const& q)
|
||||
{
|
||||
mat<3, 3, T, P> Result(T(1));
|
||||
T qxx(q.x * q.x);
|
||||
@ -614,13 +614,13 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const& q)
|
||||
{
|
||||
return mat<4, 4, T, P>(mat3_cast(q));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const& m)
|
||||
{
|
||||
T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
|
||||
T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
|
||||
@ -684,19 +684,19 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const & m4)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const& m4)
|
||||
{
|
||||
return quat_cast(mat<3, 3, T, P>(m4));
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const& x)
|
||||
{
|
||||
return acos(x.w) * static_cast<T>(2);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const& x)
|
||||
{
|
||||
T tmp1 = static_cast<T>(1) - x.w * x.w;
|
||||
if(tmp1 <= static_cast<T>(0))
|
||||
@ -706,7 +706,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const& angle, vec<3, T, P> const& v)
|
||||
{
|
||||
tquat<T, P> Result;
|
||||
|
||||
@ -721,7 +721,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@ -730,7 +730,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@ -739,7 +739,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
@ -748,7 +748,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
|
||||
{
|
||||
vec<4, bool, P> Result;
|
||||
for(length_t i = 0; i < x.length(); ++i)
|
||||
|
@ -85,7 +85,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_quat_add<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
static tquat<double, P> call(tquat<double, P> const& a, tquat<double, P> const& b)
|
||||
{
|
||||
tquat<double, P> Result;
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
@ -109,7 +109,7 @@ namespace detail
|
||||
template<qualifier P>
|
||||
struct compute_quat_sub<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
static tquat<double, P> call(tquat<double, P> const& a, tquat<double, P> const& b)
|
||||
{
|
||||
tquat<double, P> Result;
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
|
@ -142,7 +142,7 @@ namespace detail
|
||||
template<length_t L, qualifier P>
|
||||
struct compute_linearRand<L, int32, P>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, int32, P> call(vec<L, int32, P> const & Min, vec<L, int32, P> const& Max)
|
||||
GLM_FUNC_QUALIFIER static vec<L, int32, P> call(vec<L, int32, P> const& Min, vec<L, int32, P> const& Max)
|
||||
{
|
||||
return (vec<L, int32, P>(compute_rand<L, uint32, P>::call() % vec<L, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
|
||||
}
|
||||
@ -266,7 +266,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> linearRand(vec<L, T, P> const & Min, vec<L, T, P> const& Max)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> linearRand(vec<L, T, P> const& Min, vec<L, T, P> const& Max)
|
||||
{
|
||||
return detail::compute_linearRand<L, T, P>::call(Min, Max);
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sec(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sec(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(sec, x);
|
||||
@ -30,7 +30,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csc(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csc(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(csc, x);
|
||||
@ -47,7 +47,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> cot(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> cot(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(cot, x);
|
||||
@ -62,7 +62,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asec(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asec(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(asec, x);
|
||||
@ -77,7 +77,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsc(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsc(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acsc, x);
|
||||
@ -94,7 +94,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acot(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acot(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acot, x);
|
||||
@ -109,7 +109,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sech(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> sech(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(sech, x);
|
||||
@ -124,7 +124,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csch(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> csch(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(csch, x);
|
||||
@ -139,7 +139,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> coth(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> coth(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(coth, x);
|
||||
@ -154,7 +154,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asech(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> asech(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(asech, x);
|
||||
@ -169,7 +169,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsch(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acsch(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acsch, x);
|
||||
@ -184,7 +184,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acoth(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> acoth(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs");
|
||||
return detail::functor1<L, T, T, P>::call(acoth, x);
|
||||
|
@ -116,7 +116,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtc_round
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const & Source, vec<L, T, P> const& Multiple);
|
||||
GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
|
||||
|
||||
/// Lower multiple number of Source.
|
||||
///
|
||||
|
@ -220,7 +220,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const & Value)
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const& Value)
|
||||
{
|
||||
vec<L, T, P> const Result(abs(Value));
|
||||
return equal(Result & (Result - 1), vec<L, T, P>(0));
|
||||
@ -251,7 +251,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const& v)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(floorPowerOfTwo, v);
|
||||
}
|
||||
@ -271,7 +271,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const& v)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(roundPowerOfTwo, v);
|
||||
}
|
||||
@ -286,7 +286,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const & Value, T Multiple)
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, T Multiple)
|
||||
{
|
||||
return (Value % Multiple) == vec<L, T, P>(0);
|
||||
}
|
||||
|
@ -31,32 +31,32 @@ namespace glm
|
||||
/// Return the next ULP value(s) after the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType next_float(genType const & x);
|
||||
GLM_FUNC_DECL genType next_float(genType const& x);
|
||||
|
||||
/// Return the previous ULP value(s) before the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType prev_float(genType const & x);
|
||||
GLM_FUNC_DECL genType prev_float(genType const& x);
|
||||
|
||||
/// Return the value(s) ULP distance after the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance);
|
||||
GLM_FUNC_DECL genType next_float(genType const& x, uint const& Distance);
|
||||
|
||||
/// Return the value(s) ULP distance before the input value(s).
|
||||
/// @see gtc_ulp
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance);
|
||||
GLM_FUNC_DECL genType prev_float(genType const& x, uint const& Distance);
|
||||
|
||||
/// Return the distance in the number of ULP between 2 scalars.
|
||||
/// @see gtc_ulp
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL uint float_distance(T const & x, T const & y);
|
||||
GLM_FUNC_DECL uint float_distance(T const& x, T const& y);
|
||||
|
||||
/// Return the distance in the number of ULP between 2 vectors.
|
||||
/// @see gtc_ulp
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const & x, vec<2, T, Q> const & y);
|
||||
GLM_FUNC_DECL vec<2, uint, Q> float_distance(vec<2, T, Q> const& x, vec<2, T, Q> const& y);
|
||||
|
||||
/// @}
|
||||
}// namespace glm
|
||||
|
@ -190,7 +190,7 @@ namespace detail
|
||||
namespace glm
|
||||
{
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER float next_float(float const & x)
|
||||
GLM_FUNC_QUALIFIER float next_float(float const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<float>::max());
|
||||
@ -204,7 +204,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER double next_float(double const & x)
|
||||
GLM_FUNC_QUALIFIER double next_float(double const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<double>::max());
|
||||
@ -218,7 +218,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@ -226,7 +226,7 @@ namespace glm
|
||||
return Result;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER float prev_float(float const & x)
|
||||
GLM_FUNC_QUALIFIER float prev_float(float const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<float>::min());
|
||||
@ -239,7 +239,7 @@ namespace glm
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER double prev_float(double const & x)
|
||||
GLM_FUNC_QUALIFIER double prev_float(double const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::nextafter(x, std::numeric_limits<double>::min());
|
||||
@ -253,7 +253,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@ -262,7 +262,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps)
|
||||
GLM_FUNC_QUALIFIER T next_float(T const& x, uint const& ulps)
|
||||
{
|
||||
T temp = x;
|
||||
for(uint i = 0; i < ulps; ++i)
|
||||
@ -271,7 +271,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const & x, vec<L, uint, P> const & ulps)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@ -280,7 +280,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps)
|
||||
GLM_FUNC_QUALIFIER T prev_float(T const& x, uint const& ulps)
|
||||
{
|
||||
T temp = x;
|
||||
for(uint i = 0; i < ulps; ++i)
|
||||
@ -289,7 +289,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const & x, vec<L, uint, P> const & ulps)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
@ -298,7 +298,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y)
|
||||
GLM_FUNC_QUALIFIER uint float_distance(T const& x, T const& y)
|
||||
{
|
||||
uint ulp = 0;
|
||||
|
||||
@ -329,7 +329,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, uint, P> float_distance(vec<L, T, P> const & x, vec<L, T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<L, uint, P> float_distance(vec<L, T, P> const& x, vec<L, T, P> const& y)
|
||||
{
|
||||
vec<L, uint, P> Result;
|
||||
for(length_t i = 0, n = Result.length(); i < n; ++i)
|
||||
|
@ -37,8 +37,8 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, U, P> associatedMin(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b);
|
||||
|
||||
/// Minimum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
@ -66,9 +66,9 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMin(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c);
|
||||
|
||||
/// Minimum comparison between 4 variables and returns 4 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
@ -83,19 +83,19 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMin(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const & d);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const& d);
|
||||
|
||||
/// Minimum comparison between 4 variables and returns 4 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMin(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c,
|
||||
T w, vec<L, U, P> const & d);
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c,
|
||||
T w, vec<L, U, P> const& d);
|
||||
|
||||
/// Minimum comparison between 4 variables and returns 4 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
@ -115,15 +115,15 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, U, P> associatedMax(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b);
|
||||
|
||||
/// Maximum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> associatedMax(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b);
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b);
|
||||
|
||||
/// Maximum comparison between 2 variables and returns 2 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
@ -144,17 +144,17 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMax(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c);
|
||||
|
||||
/// Maximum comparison between 3 variables and returns 3 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> associatedMax(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c);
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c);
|
||||
|
||||
/// Maximum comparison between 3 variables and returns 3 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
@ -177,19 +177,19 @@ namespace glm
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMax(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const & d);
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const& d);
|
||||
|
||||
/// Maximum comparison between 4 variables and returns 4 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, U, P> associatedMax(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c,
|
||||
T w, vec<L, U, P> const & d);
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c,
|
||||
T w, vec<L, U, P> const& d);
|
||||
|
||||
/// Maximum comparison between 4 variables and returns 4 associated variable values
|
||||
/// @see gtx_associated_min_max
|
||||
|
@ -13,8 +13,8 @@ GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b)
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMin
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -65,9 +65,9 @@ GLM_FUNC_QUALIFIER U associatedMin
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -98,10 +98,10 @@ GLM_FUNC_QUALIFIER U associatedMin
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const & d
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const& d
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -120,10 +120,10 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
|
||||
(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c,
|
||||
T w, vec<L, U, P> const & d
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c,
|
||||
T w, vec<L, U, P> const& d
|
||||
)
|
||||
{
|
||||
T Test1 = min(x, y);
|
||||
@ -172,8 +172,8 @@ GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b)
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -186,8 +186,8 @@ GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> associatedMax
|
||||
(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -227,9 +227,9 @@ GLM_FUNC_QUALIFIER U associatedMax
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -242,9 +242,9 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> associatedMax
|
||||
(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -290,10 +290,10 @@ GLM_FUNC_QUALIFIER U associatedMax
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
|
||||
(
|
||||
vec<L, T, P> const& x, vec<L, U, P> const & a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const & b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const & c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const & d
|
||||
vec<L, T, P> const& x, vec<L, U, P> const& a,
|
||||
vec<L, T, P> const& y, vec<L, U, P> const& b,
|
||||
vec<L, T, P> const& z, vec<L, U, P> const& c,
|
||||
vec<L, T, P> const& w, vec<L, U, P> const& d
|
||||
)
|
||||
{
|
||||
vec<L, U, P> Result;
|
||||
@ -312,10 +312,10 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
|
||||
template<length_t L, typename T, typename U, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
|
||||
(
|
||||
T x, vec<L, U, P> const & a,
|
||||
T y, vec<L, U, P> const & b,
|
||||
T z, vec<L, U, P> const & c,
|
||||
T w, vec<L, U, P> const & d
|
||||
T x, vec<L, U, P> const& a,
|
||||
T y, vec<L, U, P> const& b,
|
||||
T z, vec<L, U, P> const& c,
|
||||
T w, vec<L, U, P> const& d
|
||||
)
|
||||
{
|
||||
T Test1 = max(x, y);
|
||||
|
@ -20,7 +20,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> highestBitValue(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> highestBitValue(vec<L, T, P> const& v)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(highestBitValue, v);
|
||||
}
|
||||
|
@ -32,16 +32,16 @@ namespace glm
|
||||
/// @see gtx_closest_point
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> closestPointOnLine(
|
||||
vec<3, T, P> const & point,
|
||||
vec<3, T, P> const & a,
|
||||
vec<3, T, P> const & b);
|
||||
vec<3, T, P> const& point,
|
||||
vec<3, T, P> const& a,
|
||||
vec<3, T, P> const& b);
|
||||
|
||||
/// 2d lines work as well
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<2, T, P> closestPointOnLine(
|
||||
vec<2, T, P> const & point,
|
||||
vec<2, T, P> const & a,
|
||||
vec<2, T, P> const & b);
|
||||
vec<2, T, P> const& point,
|
||||
vec<2, T, P> const& a,
|
||||
vec<2, T, P> const& b);
|
||||
|
||||
/// @}
|
||||
}// namespace glm
|
||||
|
@ -6,9 +6,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> closestPointOnLine
|
||||
(
|
||||
vec<3, T, P> const & point,
|
||||
vec<3, T, P> const & a,
|
||||
vec<3, T, P> const & b
|
||||
vec<3, T, P> const& point,
|
||||
vec<3, T, P> const& a,
|
||||
vec<3, T, P> const& b
|
||||
)
|
||||
{
|
||||
T LineLength = distance(a, b);
|
||||
@ -26,9 +26,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> closestPointOnLine
|
||||
(
|
||||
vec<2, T, P> const & point,
|
||||
vec<2, T, P> const & a,
|
||||
vec<2, T, P> const & b
|
||||
vec<2, T, P> const& point,
|
||||
vec<2, T, P> const& a,
|
||||
vec<2, T, P> const& b
|
||||
)
|
||||
{
|
||||
T LineLength = distance(a, b);
|
||||
|
@ -32,13 +32,13 @@ namespace glm
|
||||
/// @see gtx_color_space
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> rgbColor(
|
||||
vec<3, T, P> const & hsvValue);
|
||||
vec<3, T, P> const& hsvValue);
|
||||
|
||||
/// Converts a color from RGB color space to its color in HSV color space.
|
||||
/// @see gtx_color_space
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> hsvColor(
|
||||
vec<3, T, P> const & rgbValue);
|
||||
vec<3, T, P> const& rgbValue);
|
||||
|
||||
/// Build a saturation matrix.
|
||||
/// @see gtx_color_space
|
||||
@ -51,20 +51,20 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> saturation(
|
||||
T const s,
|
||||
vec<3, T, P> const & color);
|
||||
vec<3, T, P> const& color);
|
||||
|
||||
/// Modify the saturation of a color.
|
||||
/// @see gtx_color_space
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> saturation(
|
||||
T const s,
|
||||
vec<4, T, P> const & color);
|
||||
vec<4, T, P> const& color);
|
||||
|
||||
/// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
|
||||
/// @see gtx_color_space
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL T luminosity(
|
||||
vec<3, T, P> const & color);
|
||||
vec<3, T, P> const& color);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -32,27 +32,27 @@ namespace glm
|
||||
/// @see gtx_color_space_YCoCg
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> rgb2YCoCg(
|
||||
vec<3, T, P> const & rgbColor);
|
||||
vec<3, T, P> const& rgbColor);
|
||||
|
||||
/// Convert a color from YCoCg color space to RGB color space.
|
||||
/// @see gtx_color_space_YCoCg
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> YCoCg2rgb(
|
||||
vec<3, T, P> const & YCoCgColor);
|
||||
vec<3, T, P> const& YCoCgColor);
|
||||
|
||||
/// Convert a color from RGB color space to YCoCgR color space.
|
||||
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
|
||||
/// @see gtx_color_space_YCoCg
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> rgb2YCoCgR(
|
||||
vec<3, T, P> const & rgbColor);
|
||||
vec<3, T, P> const& rgbColor);
|
||||
|
||||
/// Convert a color from YCoCgR color space to RGB color space.
|
||||
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
|
||||
/// @see gtx_color_space_YCoCg
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> YCoCgR2rgb(
|
||||
vec<3, T, P> const & YCoCgColor);
|
||||
vec<3, T, P> const& YCoCgColor);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -6,7 +6,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCg
|
||||
(
|
||||
vec<3, T, P> const & rgbColor
|
||||
vec<3, T, P> const& rgbColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -19,7 +19,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> YCoCg2rgb
|
||||
(
|
||||
vec<3, T, P> const & YCoCgColor
|
||||
vec<3, T, P> const& YCoCgColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -34,7 +34,7 @@ namespace glm
|
||||
public:
|
||||
static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
|
||||
(
|
||||
vec<3, T, P> const & rgbColor
|
||||
vec<3, T, P> const& rgbColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -46,7 +46,7 @@ namespace glm
|
||||
|
||||
static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
|
||||
(
|
||||
vec<3, T, P> const & YCoCgRColor
|
||||
vec<3, T, P> const& YCoCgRColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -63,7 +63,7 @@ namespace glm
|
||||
public:
|
||||
static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
|
||||
(
|
||||
vec<3, T, P> const & rgbColor
|
||||
vec<3, T, P> const& rgbColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -76,7 +76,7 @@ namespace glm
|
||||
|
||||
static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
|
||||
(
|
||||
vec<3, T, P> const & YCoCgRColor
|
||||
vec<3, T, P> const& YCoCgRColor
|
||||
)
|
||||
{
|
||||
vec<3, T, P> result;
|
||||
@ -91,7 +91,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
|
||||
(
|
||||
vec<3, T, P> const & rgbColor
|
||||
vec<3, T, P> const& rgbColor
|
||||
)
|
||||
{
|
||||
return compute_YCoCgR<T, P, std::numeric_limits<T>::is_integer>::rgb2YCoCgR(rgbColor);
|
||||
@ -100,7 +100,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
|
||||
(
|
||||
vec<3, T, P> const & YCoCgRColor
|
||||
vec<3, T, P> const& YCoCgRColor
|
||||
)
|
||||
{
|
||||
return compute_YCoCgR<T, P, std::numeric_limits<T>::is_integer>::YCoCgR2rgb(YCoCgRColor);
|
||||
|
@ -40,7 +40,7 @@ namespace glm
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan 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 genType>
|
||||
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x);
|
||||
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const& x);
|
||||
|
||||
/// Similar to 'mod' but with a different rounding and integer support.
|
||||
/// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
|
||||
@ -48,7 +48,7 @@ namespace glm
|
||||
/// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a>
|
||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fmod(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, T, P> fmod(vec<L, T, P> const& v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -11,7 +11,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier P, bool isFloat = true>
|
||||
struct compute_fmod
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const & a, vec<L, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& a, vec<L, T, P> const& b)
|
||||
{
|
||||
return detail::functor2<L, T, P>::call(std::fmod, a, b);
|
||||
}
|
||||
@ -20,7 +20,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier P>
|
||||
struct compute_fmod<L, T, P, false>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const & a, vec<L, T, P> const & b)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& a, vec<L, T, P> const& b)
|
||||
{
|
||||
return a % b;
|
||||
}
|
||||
@ -28,7 +28,7 @@ namespace detail
|
||||
}//namespace detail
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER bool isdenormal(T const & x)
|
||||
GLM_FUNC_QUALIFIER bool isdenormal(T const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
@ -42,7 +42,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename vec<1, T, P>::bool_type isdenormal
|
||||
(
|
||||
vec<1, T, P> const & x
|
||||
vec<1, T, P> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
|
||||
@ -54,7 +54,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename vec<2, T, P>::bool_type isdenormal
|
||||
(
|
||||
vec<2, T, P> const & x
|
||||
vec<2, T, P> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
|
||||
@ -67,7 +67,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename vec<3, T, P>::bool_type isdenormal
|
||||
(
|
||||
vec<3, T, P> const & x
|
||||
vec<3, T, P> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
|
||||
@ -81,7 +81,7 @@ namespace detail
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename vec<4, T, P>::bool_type isdenormal
|
||||
(
|
||||
vec<4, T, P> const & x
|
||||
vec<4, T, P> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
|
||||
@ -101,13 +101,13 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const & x, T y)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const& x, T y)
|
||||
{
|
||||
return detail::compute_fmod<L, T, P, std::numeric_limits<T>::is_iec559>::call(x, vec<L, T, P>(y));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const & x, vec<L, T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const& x, vec<L, T, P> const& y)
|
||||
{
|
||||
return detail::compute_fmod<L, T, P, std::numeric_limits<T>::is_iec559>::call(x, y);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace glm
|
||||
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<3, T, P> atan2(const vec<3, T, P>& x, const vec<3, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<4, T, P> atan2(const vec<4, T, P>& x, const vec<4, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
|
||||
|
||||
template<typename genType> GLM_FUNC_DECL bool isfinite(genType const & x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
|
||||
template<typename genType> GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier P> GLM_FUNC_DECL vec<1, bool, P> isfinite(const vec<1, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier P> GLM_FUNC_DECL vec<2, bool, P> isfinite(const vec<2, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
|
||||
template<typename T, qualifier P> GLM_FUNC_DECL vec<3, bool, P> isfinite(const vec<3, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
|
||||
|
@ -8,7 +8,7 @@ namespace glm
|
||||
// isfinite
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER bool isfinite(
|
||||
genType const & x)
|
||||
genType const& x)
|
||||
{
|
||||
# if GLM_HAS_CXX11_STL
|
||||
return std::isfinite(x) != 0;
|
||||
@ -26,7 +26,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<1, bool, P> isfinite(
|
||||
vec<1, T, P> const & x)
|
||||
vec<1, T, P> const& x)
|
||||
{
|
||||
return vec<1, bool, P>(
|
||||
isfinite(x.x));
|
||||
@ -34,7 +34,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, bool, P> isfinite(
|
||||
vec<2, T, P> const & x)
|
||||
vec<2, T, P> const& x)
|
||||
{
|
||||
return vec<2, bool, P>(
|
||||
isfinite(x.x),
|
||||
@ -43,7 +43,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, bool, P> isfinite(
|
||||
vec<3, T, P> const & x)
|
||||
vec<3, T, P> const& x)
|
||||
{
|
||||
return vec<3, bool, P>(
|
||||
isfinite(x.x),
|
||||
@ -53,7 +53,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, P> isfinite(
|
||||
vec<4, T, P> const & x)
|
||||
vec<4, T, P> const& x)
|
||||
{
|
||||
return vec<4, bool, P>(
|
||||
isfinite(x.x),
|
||||
|
@ -35,33 +35,33 @@ namespace glm
|
||||
/// If the parameter value type is already a floating qualifier type, the value is passed through.
|
||||
/// @see gtx_component_wise
|
||||
template<typename floatType, length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, floatType, P> compNormalize(vec<L, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, floatType, P> compNormalize(vec<L, T, P> const& v);
|
||||
|
||||
/// Convert a normalized float vector to an integer vector.
|
||||
/// If the parameter value type is already a floating qualifier type, the value is passed through.
|
||||
/// @see gtx_component_wise
|
||||
template<length_t L, typename T, typename floatType, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> compScale(vec<L, floatType, P> const & v);
|
||||
GLM_FUNC_DECL vec<L, T, P> compScale(vec<L, floatType, P> const& v);
|
||||
|
||||
/// Add all vector components together.
|
||||
/// @see gtx_component_wise
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type compAdd(genType const & v);
|
||||
GLM_FUNC_DECL typename genType::value_type compAdd(genType const& v);
|
||||
|
||||
/// Multiply all vector components together.
|
||||
/// @see gtx_component_wise
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type compMul(genType const & v);
|
||||
GLM_FUNC_DECL typename genType::value_type compMul(genType const& v);
|
||||
|
||||
/// Find the minimum value between single vector components.
|
||||
/// @see gtx_component_wise
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type compMin(genType const & v);
|
||||
GLM_FUNC_DECL typename genType::value_type compMin(genType const& v);
|
||||
|
||||
/// Find the maximum value between single vector components.
|
||||
/// @see gtx_component_wise
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL typename genType::value_type compMax(genType const & v);
|
||||
GLM_FUNC_DECL typename genType::value_type compMax(genType const& v);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -13,7 +13,7 @@ namespace detail
|
||||
template<length_t L, typename T, typename floatType, qualifier P>
|
||||
struct compute_compNormalize<L, T, floatType, P, true, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const& v)
|
||||
{
|
||||
floatType const Min = static_cast<floatType>(std::numeric_limits<T>::min());
|
||||
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max());
|
||||
@ -24,7 +24,7 @@ namespace detail
|
||||
template<length_t L, typename T, typename floatType, qualifier P>
|
||||
struct compute_compNormalize<L, T, floatType, P, true, false>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const& v)
|
||||
{
|
||||
return vec<L, floatType, P>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
|
||||
}
|
||||
@ -58,7 +58,7 @@ namespace detail
|
||||
template<length_t L, typename T, typename floatType, qualifier P>
|
||||
struct compute_compScale<L, T, floatType, P, true, false>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const& v)
|
||||
{
|
||||
return vec<L, T, P>(vec<L, floatType, P>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
|
||||
}
|
||||
@ -67,7 +67,7 @@ namespace detail
|
||||
template<length_t L, typename T, typename floatType, qualifier P>
|
||||
struct compute_compScale<L, T, floatType, P, false, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const& v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
@ -75,7 +75,7 @@ namespace detail
|
||||
}//namespace detail
|
||||
|
||||
template<typename floatType, length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> compNormalize(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, P> compNormalize(vec<L, T, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter");
|
||||
|
||||
@ -83,7 +83,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<typename T, length_t L, typename floatType, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> compScale(vec<L, floatType, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> compScale(vec<L, floatType, P> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter");
|
||||
|
||||
@ -100,7 +100,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T compMul(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T compMul(vec<L, T, P> const& v)
|
||||
{
|
||||
T Result(1);
|
||||
for(length_t i = 0, n = v.length(); i < n; ++i)
|
||||
@ -109,7 +109,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T compMin(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T compMin(vec<L, T, P> const& v)
|
||||
{
|
||||
T Result(v[0]);
|
||||
for(length_t i = 1, n = v.length(); i < n; ++i)
|
||||
@ -118,7 +118,7 @@ namespace detail
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T compMax(vec<L, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER T compMax(vec<L, T, P> const& v)
|
||||
{
|
||||
T Result(v[0]);
|
||||
for(length_t i = 1, n = v.length(); i < n; ++i)
|
||||
|
@ -52,35 +52,35 @@ namespace glm
|
||||
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;}
|
||||
|
||||
GLM_FUNC_DECL part_type & operator[](length_type i);
|
||||
GLM_FUNC_DECL part_type const & operator[](length_type i) const;
|
||||
GLM_FUNC_DECL part_type const& operator[](length_type i) const;
|
||||
|
||||
// -- Implicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const & d) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const& d) GLM_DEFAULT;
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const & d);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d);
|
||||
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const & real);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const & orientation, vec<3, T, P> const & translation);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const & real, tquat<T, P> const & dual);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& real);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& orientation, vec<3, T, P> const& translation);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& real, tquat<T, P> const& dual);
|
||||
|
||||
// -- Conversion constructors --
|
||||
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat<U, Q> const & q);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat<U, Q> const& q);
|
||||
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, P> const & holder_mat);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, P> const & aug_mat);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, P> const& holder_mat);
|
||||
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, P> const& aug_mat);
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const & m) GLM_DEFAULT;
|
||||
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const& m) GLM_DEFAULT;
|
||||
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const & m);
|
||||
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const& m);
|
||||
template<typename U>
|
||||
GLM_FUNC_DECL tdualquat<T, P> & operator*=(U s);
|
||||
template<typename U>
|
||||
@ -90,47 +90,47 @@ namespace glm
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator-(tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator-(tdualquat<T, P> const& q);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const & q, tdualquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const& q, tdualquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const & q, tdualquat<T, P> const & p);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const& q, tdualquat<T, P> const& p);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tdualquat<T, P> const & q, vec<3, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(tdualquat<T, P> const& q, vec<3, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tdualquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tdualquat<T, P> const & q, vec<4, T, P> const & v);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(tdualquat<T, P> const& q, vec<4, T, P> const& v);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tdualquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const& q, T const& s);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(T const & s, tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator*(T const& s, tdualquat<T, P> const& q);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator/(tdualquat<T, P> const & q, T const & s);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator/(tdualquat<T, P> const& q, T const& s);
|
||||
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator==(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator==(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2);
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL bool operator!=(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2);
|
||||
GLM_FUNC_DECL bool operator!=(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2);
|
||||
|
||||
/// Creates an identity dual quaternion.
|
||||
///
|
||||
@ -142,43 +142,43 @@ namespace glm
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> normalize(tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> normalize(tdualquat<T, P> const& q);
|
||||
|
||||
/// Returns the linear interpolation of two dual quaternion.
|
||||
///
|
||||
/// @see gtc_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> lerp(tdualquat<T, P> const & x, tdualquat<T, P> const & y, T const & a);
|
||||
GLM_FUNC_DECL tdualquat<T, P> lerp(tdualquat<T, P> const& x, tdualquat<T, P> const& y, T const& a);
|
||||
|
||||
/// Returns the q inverse.
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> inverse(tdualquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> inverse(tdualquat<T, P> const& q);
|
||||
|
||||
/// Converts a quaternion to a 2 * 4 matrix.
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> mat2x4_cast(tdualquat<T, P> const & x);
|
||||
GLM_FUNC_DECL mat<2, 4, T, P> mat2x4_cast(tdualquat<T, P> const& x);
|
||||
|
||||
/// Converts a quaternion to a 3 * 4 matrix.
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> mat3x4_cast(tdualquat<T, P> const & x);
|
||||
GLM_FUNC_DECL mat<3, 4, T, P> mat3x4_cast(tdualquat<T, P> const& x);
|
||||
|
||||
/// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion.
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<2, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<2, 4, T, P> const& x);
|
||||
|
||||
/// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion.
|
||||
///
|
||||
/// @see gtx_dual_quaternion
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<3, 4, T, P> const & x);
|
||||
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<3, 4, T, P> const& x);
|
||||
|
||||
|
||||
/// Dual-quaternion of low single-qualifier floating-point numbers.
|
||||
|
@ -16,7 +16,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const & tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i) const
|
||||
GLM_FUNC_QUALIFIER typename tdualquat<T, P>::part_type const& tdualquat<T, P>::operator[](typename tdualquat<T, P>::length_type i) const
|
||||
{
|
||||
assert(i >= 0 && i < this->length());
|
||||
return (&real)[i];
|
||||
@ -32,7 +32,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, P> const & d)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, P> const& d)
|
||||
: real(d.real)
|
||||
, dual(d.dual)
|
||||
{}
|
||||
@ -40,7 +40,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, Q> const & d)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<T, Q> const& d)
|
||||
: real(d.real)
|
||||
, dual(d.dual)
|
||||
{}
|
||||
@ -48,12 +48,12 @@ namespace glm
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const & r)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const& r)
|
||||
: real(r), dual(tquat<T, P>(0, 0, 0, 0))
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const & q, vec<3, T, P> const& p)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const& q, vec<3, T, P> const& p)
|
||||
: real(q), dual(
|
||||
T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z),
|
||||
T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y),
|
||||
@ -62,7 +62,7 @@ namespace glm
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const & r, tquat<T, P> const & d)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tquat<T, P> const& r, tquat<T, P> const& d)
|
||||
: real(r), dual(d)
|
||||
{}
|
||||
|
||||
@ -70,19 +70,19 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<U, Q> const & q)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, P>::tdualquat(tdualquat<U, Q> const& q)
|
||||
: real(q.real)
|
||||
, dual(q.dual)
|
||||
{}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(mat<2, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(mat<2, 4, T, P> const& m)
|
||||
{
|
||||
*this = dualquat_cast(m);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(mat<3, 4, T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(mat<3, 4, T, P> const& m)
|
||||
{
|
||||
*this = dualquat_cast(m);
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace glm
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<T, P> const& q)
|
||||
{
|
||||
this->real = q.real;
|
||||
this->dual = q.dual;
|
||||
@ -101,7 +101,7 @@ namespace glm
|
||||
|
||||
template<typename T, qualifier P>
|
||||
template<typename U>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<U, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> & tdualquat<T, P>::operator=(tdualquat<U, P> const& q)
|
||||
{
|
||||
this->real = q.real;
|
||||
this->dual = q.dual;
|
||||
@ -129,13 +129,13 @@ namespace glm
|
||||
// -- Unary bit operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator+(tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator+(tdualquat<T, P> const& q)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator-(tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator-(tdualquat<T, P> const& q)
|
||||
{
|
||||
return tdualquat<T, P>(-q.real, -q.dual);
|
||||
}
|
||||
@ -143,19 +143,19 @@ namespace glm
|
||||
// -- Binary operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator+(tdualquat<T, P> const & q, tdualquat<T, P> const & p)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator+(tdualquat<T, P> const& q, tdualquat<T, P> const& p)
|
||||
{
|
||||
return tdualquat<T, P>(q.real + p.real,q.dual + p.dual);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const & p, tdualquat<T, P> const & o)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const& p, tdualquat<T, P> const& o)
|
||||
{
|
||||
return tdualquat<T, P>(p.real * o.real,p.real * o.dual + p.dual * o.real);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tdualquat<T, P> const & q, vec<3, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tdualquat<T, P> const& q, vec<3, T, P> const& v)
|
||||
{
|
||||
vec<3, T, P> const real_v3(q.real.x,q.real.y,q.real.z);
|
||||
vec<3, T, P> const dual_v3(q.dual.x,q.dual.y,q.dual.z);
|
||||
@ -163,37 +163,37 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tdualquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tdualquat<T, P> const & q, vec<4, T, P> const & v)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tdualquat<T, P> const& q, vec<4, T, P> const& v)
|
||||
{
|
||||
return vec<4, T, P>(q * vec<3, T, P>(v), v.w);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tdualquat<T, P> const& q)
|
||||
{
|
||||
return glm::inverse(q) * v;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(tdualquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tdualquat<T, P>(q.real * s, q.dual * s);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(T const & s, tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator*(T const& s, tdualquat<T, P> const& q)
|
||||
{
|
||||
return q * s;
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator/(tdualquat<T, P> const & q, T const & s)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator/(tdualquat<T, P> const& q, T const& s)
|
||||
{
|
||||
return tdualquat<T, P>(q.real / s, q.dual / s);
|
||||
}
|
||||
@ -201,13 +201,13 @@ namespace glm
|
||||
// -- Boolean operators --
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator==(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator==(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2)
|
||||
{
|
||||
return (q1.real == q2.real) && (q1.dual == q2.dual);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2)
|
||||
GLM_FUNC_QUALIFIER bool operator!=(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2)
|
||||
{
|
||||
return (q1.real != q2.real) || (q1.dual != q2.dual);
|
||||
}
|
||||
@ -223,13 +223,13 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> normalize(tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> normalize(tdualquat<T, P> const& q)
|
||||
{
|
||||
return q / length(q.real);
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> lerp(tdualquat<T, P> const & x, tdualquat<T, P> const & y, T const & a)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> lerp(tdualquat<T, P> const& x, tdualquat<T, P> const& y, T const& a)
|
||||
{
|
||||
// Dual Quaternion Linear blend aka DLB:
|
||||
// Lerp is only defined in [0, 1]
|
||||
@ -241,7 +241,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> inverse(tdualquat<T, P> const & q)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> inverse(tdualquat<T, P> const& q)
|
||||
{
|
||||
const glm::tquat<T, P> real = conjugate(q.real);
|
||||
const glm::tquat<T, P> dual = conjugate(q.dual);
|
||||
@ -249,13 +249,13 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat2x4_cast(tdualquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat2x4_cast(tdualquat<T, P> const& x)
|
||||
{
|
||||
return mat<2, 4, T, P>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w );
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat3x4_cast(tdualquat<T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat3x4_cast(tdualquat<T, P> const& x)
|
||||
{
|
||||
tquat<T, P> r = x.real / length2(x.real);
|
||||
|
||||
@ -291,7 +291,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(mat<2, 4, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(mat<2, 4, T, P> const& x)
|
||||
{
|
||||
return tdualquat<T, P>(
|
||||
tquat<T, P>( x[0].w, x[0].x, x[0].y, x[0].z ),
|
||||
@ -299,7 +299,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(mat<3, 4, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> dualquat_cast(mat<3, 4, T, P> const& x)
|
||||
{
|
||||
tquat<T, P> real;
|
||||
|
||||
|
@ -32,110 +32,110 @@ namespace glm
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleX(
|
||||
T const & angleX);
|
||||
T const& angleX);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleY(
|
||||
T const & angleY);
|
||||
T const& angleY);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZ(
|
||||
T const & angleZ);
|
||||
T const& angleZ);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXY(
|
||||
T const & angleX,
|
||||
T const & angleY);
|
||||
T const& angleX,
|
||||
T const& angleY);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYX(
|
||||
T const & angleY,
|
||||
T const & angleX);
|
||||
T const& angleY,
|
||||
T const& angleX);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZ(
|
||||
T const & angleX,
|
||||
T const & angleZ);
|
||||
T const& angleX,
|
||||
T const& angleZ);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZX(
|
||||
T const & angle,
|
||||
T const & angleX);
|
||||
T const& angle,
|
||||
T const& angleX);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZ(
|
||||
T const & angleY,
|
||||
T const & angleZ);
|
||||
T const& angleY,
|
||||
T const& angleZ);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZY(
|
||||
T const & angleZ,
|
||||
T const & angleY);
|
||||
T const& angleZ,
|
||||
T const& angleY);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYZ(
|
||||
T const & t1,
|
||||
T const & t2,
|
||||
T const & t3);
|
||||
T const& t1,
|
||||
T const& t2,
|
||||
T const& t3);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXZ(
|
||||
T const & yaw,
|
||||
T const & pitch,
|
||||
T const & roll);
|
||||
T const& yaw,
|
||||
T const& pitch,
|
||||
T const& roll);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<4, 4, T, defaultp> yawPitchRoll(
|
||||
T const & yaw,
|
||||
T const & pitch,
|
||||
T const & roll);
|
||||
T const& yaw,
|
||||
T const& pitch,
|
||||
T const& roll);
|
||||
|
||||
/// Creates a 2D 2 * 2 rotation matrix from an euler angle.
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<2, 2, T, defaultp> orientate2(T const & angle);
|
||||
GLM_FUNC_DECL mat<2, 2, T, defaultp> orientate2(T const& angle);
|
||||
|
||||
/// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL mat<3, 3, T, defaultp> orientate3(T const & angle);
|
||||
GLM_FUNC_DECL mat<3, 3, T, defaultp> orientate3(T const& angle);
|
||||
|
||||
/// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> orientate3(vec<3, T, P> const & angles);
|
||||
GLM_FUNC_DECL mat<3, 3, T, P> orientate3(vec<3, T, P> const& angles);
|
||||
|
||||
/// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> orientate4(vec<3, T, P> const & angles);
|
||||
GLM_FUNC_DECL mat<4, 4, T, P> orientate4(vec<3, T, P> const& angles);
|
||||
|
||||
/// Extracts the (X * Y * Z) Euler angles from the rotation matrix M
|
||||
/// @see gtx_euler_angles
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const & M,
|
||||
GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M,
|
||||
T & t1,
|
||||
T & t2,
|
||||
T & t3);
|
||||
|
@ -8,7 +8,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleX
|
||||
(
|
||||
T const & angleX
|
||||
T const& angleX
|
||||
)
|
||||
{
|
||||
T cosX = glm::cos(angleX);
|
||||
@ -24,7 +24,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleY
|
||||
(
|
||||
T const & angleY
|
||||
T const& angleY
|
||||
)
|
||||
{
|
||||
T cosY = glm::cos(angleY);
|
||||
@ -40,7 +40,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZ
|
||||
(
|
||||
T const & angleZ
|
||||
T const& angleZ
|
||||
)
|
||||
{
|
||||
T cosZ = glm::cos(angleZ);
|
||||
@ -56,8 +56,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXY
|
||||
(
|
||||
T const & angleX,
|
||||
T const & angleY
|
||||
T const& angleX,
|
||||
T const& angleY
|
||||
)
|
||||
{
|
||||
T cosX = glm::cos(angleX);
|
||||
@ -75,8 +75,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYX
|
||||
(
|
||||
T const & angleY,
|
||||
T const & angleX
|
||||
T const& angleY,
|
||||
T const& angleX
|
||||
)
|
||||
{
|
||||
T cosX = glm::cos(angleX);
|
||||
@ -94,8 +94,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZ
|
||||
(
|
||||
T const & angleX,
|
||||
T const & angleZ
|
||||
T const& angleX,
|
||||
T const& angleZ
|
||||
)
|
||||
{
|
||||
return eulerAngleX(angleX) * eulerAngleZ(angleZ);
|
||||
@ -104,8 +104,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZX
|
||||
(
|
||||
T const & angleZ,
|
||||
T const & angleX
|
||||
T const& angleZ,
|
||||
T const& angleX
|
||||
)
|
||||
{
|
||||
return eulerAngleZ(angleZ) * eulerAngleX(angleX);
|
||||
@ -114,8 +114,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZ
|
||||
(
|
||||
T const & angleY,
|
||||
T const & angleZ
|
||||
T const& angleY,
|
||||
T const& angleZ
|
||||
)
|
||||
{
|
||||
return eulerAngleY(angleY) * eulerAngleZ(angleZ);
|
||||
@ -124,8 +124,8 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZY
|
||||
(
|
||||
T const & angleZ,
|
||||
T const & angleY
|
||||
T const& angleZ,
|
||||
T const& angleY
|
||||
)
|
||||
{
|
||||
return eulerAngleZ(angleZ) * eulerAngleY(angleY);
|
||||
@ -134,9 +134,9 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYZ
|
||||
(
|
||||
T const & t1,
|
||||
T const & t2,
|
||||
T const & t3
|
||||
T const& t1,
|
||||
T const& t2,
|
||||
T const& t3
|
||||
)
|
||||
{
|
||||
T c1 = glm::cos(-t1);
|
||||
@ -169,9 +169,9 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXZ
|
||||
(
|
||||
T const & yaw,
|
||||
T const & pitch,
|
||||
T const & roll
|
||||
T const& yaw,
|
||||
T const& pitch,
|
||||
T const& roll
|
||||
)
|
||||
{
|
||||
T tmp_ch = glm::cos(yaw);
|
||||
@ -204,9 +204,9 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> yawPitchRoll
|
||||
(
|
||||
T const & yaw,
|
||||
T const & pitch,
|
||||
T const & roll
|
||||
T const& yaw,
|
||||
T const& pitch,
|
||||
T const& roll
|
||||
)
|
||||
{
|
||||
T tmp_ch = glm::cos(yaw);
|
||||
@ -239,7 +239,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> orientate2
|
||||
(
|
||||
T const & angle
|
||||
T const& angle
|
||||
)
|
||||
{
|
||||
T c = glm::cos(angle);
|
||||
@ -256,7 +256,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> orientate3
|
||||
(
|
||||
T const & angle
|
||||
T const& angle
|
||||
)
|
||||
{
|
||||
T c = glm::cos(angle);
|
||||
@ -278,7 +278,7 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<3, 3, T, P> orientate3
|
||||
(
|
||||
vec<3, T, P> const & angles
|
||||
vec<3, T, P> const& angles
|
||||
)
|
||||
{
|
||||
return mat<3, 3, T, P>(yawPitchRoll(angles.z, angles.x, angles.y));
|
||||
@ -287,14 +287,14 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER mat<4, 4, T, P> orientate4
|
||||
(
|
||||
vec<3, T, P> const & angles
|
||||
vec<3, T, P> const& angles
|
||||
)
|
||||
{
|
||||
return yawPitchRoll(angles.z, angles.x, angles.y);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const & M,
|
||||
GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M,
|
||||
T & t1,
|
||||
T & t2,
|
||||
T & t3)
|
||||
|
@ -32,8 +32,8 @@ namespace glm
|
||||
/// @see gtx_extend
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType extend(
|
||||
genType const & Origin,
|
||||
genType const & Source,
|
||||
genType const& Origin,
|
||||
genType const& Source,
|
||||
typename genType::value_type const Length);
|
||||
|
||||
/// @}
|
||||
|
@ -6,9 +6,9 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType extend
|
||||
(
|
||||
genType const & Origin,
|
||||
genType const & Source,
|
||||
genType const & Distance
|
||||
genType const& Origin,
|
||||
genType const& Source,
|
||||
genType const& Distance
|
||||
)
|
||||
{
|
||||
return Origin + (Source - Origin) * Distance;
|
||||
@ -17,9 +17,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<2, T, P> extend
|
||||
(
|
||||
vec<2, T, P> const & Origin,
|
||||
vec<2, T, P> const & Source,
|
||||
T const & Distance
|
||||
vec<2, T, P> const& Origin,
|
||||
vec<2, T, P> const& Source,
|
||||
T const& Distance
|
||||
)
|
||||
{
|
||||
return Origin + (Source - Origin) * Distance;
|
||||
@ -28,9 +28,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<3, T, P> extend
|
||||
(
|
||||
vec<3, T, P> const & Origin,
|
||||
vec<3, T, P> const & Source,
|
||||
T const & Distance
|
||||
vec<3, T, P> const& Origin,
|
||||
vec<3, T, P> const& Source,
|
||||
T const& Distance
|
||||
)
|
||||
{
|
||||
return Origin + (Source - Origin) * Distance;
|
||||
@ -39,9 +39,9 @@ namespace glm
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<4, T, P> extend
|
||||
(
|
||||
vec<4, T, P> const & Origin,
|
||||
vec<4, T, P> const & Source,
|
||||
T const & Distance
|
||||
vec<4, T, P> const& Origin,
|
||||
vec<4, T, P> const& Source,
|
||||
T const& Distance
|
||||
)
|
||||
{
|
||||
return Origin + (Source - Origin) * Distance;
|
||||
|
@ -32,103 +32,103 @@ namespace glm
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z);
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z);
|
||||
|
||||
/// Return the minimum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z);
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z);
|
||||
|
||||
/// Return the minimum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z);
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w);
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z,
|
||||
T const& w);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w);
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z,
|
||||
typename C<T>::T const& w);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w);
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z,
|
||||
C<T> const& w);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z);
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z);
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z);
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T>
|
||||
GLM_FUNC_DECL T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w);
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z,
|
||||
T const& w);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w);
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z,
|
||||
typename C<T>::T const& w);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w);
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z,
|
||||
C<T> const& w);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -5,9 +5,9 @@ namespace glm
|
||||
{
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z)
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
}
|
||||
@ -15,9 +15,9 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
@ -26,9 +26,9 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
@ -37,10 +37,10 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T min
|
||||
(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z,
|
||||
T const& w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
@ -49,10 +49,10 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z,
|
||||
typename C<T>::T const& w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
@ -61,10 +61,10 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z,
|
||||
C<T> const& w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
@ -72,9 +72,9 @@ namespace glm
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z)
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
}
|
||||
@ -82,9 +82,9 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
@ -93,9 +93,9 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
@ -104,10 +104,10 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T max
|
||||
(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w
|
||||
T const& x,
|
||||
T const& y,
|
||||
T const& z,
|
||||
T const& w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
@ -116,10 +116,10 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w
|
||||
C<T> const& x,
|
||||
typename C<T>::T const& y,
|
||||
typename C<T>::T const& z,
|
||||
typename C<T>::T const& w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
@ -128,10 +128,10 @@ namespace glm
|
||||
template<typename T, template<typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w
|
||||
C<T> const& x,
|
||||
C<T> const& y,
|
||||
C<T> const& z,
|
||||
C<T> const& w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
|
@ -19,7 +19,7 @@ namespace detail
|
||||
}//namespace detail
|
||||
|
||||
template<typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T cross(vec<2, T, P> const & x, vec<2, T, P> const & y)
|
||||
GLM_FUNC_QUALIFIER T cross(vec<2, T, P> const& x, vec<2, T, P> const& y)
|
||||
{
|
||||
return detail::compute_cross_vec2<T, P, detail::is_aligned<P>::value>::call(x, y);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ namespace glm
|
||||
/// Faster than the common pow function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastPow(vec<L, T, P> const & x, vec<L, T, P> const & y);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastPow(vec<L, T, P> const& x, vec<L, T, P> const& y);
|
||||
|
||||
/// Faster than the common pow function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
@ -47,7 +47,7 @@ namespace glm
|
||||
/// Faster than the common pow function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastPow(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastPow(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common exp function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
@ -57,7 +57,7 @@ namespace glm
|
||||
/// Faster than the common exp function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastExp(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastExp(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common log function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
@ -67,7 +67,7 @@ namespace glm
|
||||
/// Faster than the common exp2 function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastLog(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastLog(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common exp2 function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
@ -77,7 +77,7 @@ namespace glm
|
||||
/// Faster than the common exp2 function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastExp2(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastExp2(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common log2 function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
@ -87,7 +87,7 @@ namespace glm
|
||||
/// Faster than the common log2 function but less accurate.
|
||||
/// @see gtx_fast_exponential
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastLog2(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastLog2(vec<L, T, P> const& x);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
@ -26,7 +26,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastPow(vec<L, T, P> const & x, vec<L, int, P> const & y)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastPow(vec<L, T, P> const& x, vec<L, int, P> const& y)
|
||||
{
|
||||
vec<L, T, P> Result;
|
||||
for(length_t i = 0, n = x.length(); i < n; ++i)
|
||||
|
@ -42,7 +42,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtx_fast_square_root extension.
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastSqrt(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastSqrt(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common inversesqrt function but less accurate.
|
||||
///
|
||||
@ -54,7 +54,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtx_fast_square_root extension.
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL vec<L, T, P> fastInverseSqrt(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL vec<L, T, P> fastInverseSqrt(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common length function but less accurate.
|
||||
///
|
||||
@ -66,7 +66,7 @@ namespace glm
|
||||
///
|
||||
/// @see gtx_fast_square_root extension.
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL T fastLength(vec<L, T, P> const & x);
|
||||
GLM_FUNC_DECL T fastLength(vec<L, T, P> const& x);
|
||||
|
||||
/// Faster than the common distance function but less accurate.
|
||||
///
|
||||
@ -78,13 +78,13 @@ namespace glm
|
||||
///
|
||||
/// @see gtx_fast_square_root extension.
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_DECL T fastDistance(vec<L, T, P> const & x, vec<L, T, P> const & y);
|
||||
GLM_FUNC_DECL T fastDistance(vec<L, T, P> const& x, vec<L, T, P> const& y);
|
||||
|
||||
/// Faster than the common normalize function but less accurate.
|
||||
///
|
||||
/// @see gtx_fast_square_root extension.
|
||||
template<typename genType>
|
||||
GLM_FUNC_DECL genType fastNormalize(genType const & x);
|
||||
GLM_FUNC_DECL genType fastNormalize(genType const& x);
|
||||
|
||||
/// @}
|
||||
}// namespace glm
|
||||
|
@ -13,7 +13,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastSqrt(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastSqrt(vec<L, T, P> const& x)
|
||||
{
|
||||
return detail::functor1<L, T, T, P>::call(fastSqrt, x);
|
||||
}
|
||||
@ -31,7 +31,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastInverseSqrt(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER vec<L, T, P> fastInverseSqrt(vec<L, T, P> const& x)
|
||||
{
|
||||
return detail::compute_inversesqrt<L, T, P, detail::is_aligned<P>::value>::call(x);
|
||||
}
|
||||
@ -46,7 +46,7 @@ namespace glm
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier P>
|
||||
GLM_FUNC_QUALIFIER T fastLength(vec<L, T, P> const & x)
|
||||
GLM_FUNC_QUALIFIER T fastLength(vec<L, T, P> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fastLength' only accept floating-point inputs");
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user