remove_unneccessary_overloads

Removed many overloads by using templates and delegating to already existing operators
This commit is contained in:
ZXShady 2024-10-05 15:34:38 +01:00
parent 33b4a621a6
commit bb563dc6b0
42 changed files with 1422 additions and 5319 deletions

View File

@ -17,20 +17,8 @@ namespace detail
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
template<length_t L,typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> permute(vec<L, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
@ -41,38 +29,14 @@ namespace detail
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
template<length_t L,typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> taylorInvSqrt(vec<L, T, Q> const& r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
{
return static_cast<T>(1.79284291400159) - static_cast<T>(0.85373472095314) * r;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
template<length_t L,typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> fade(vec<L, T, Q> const& t)
{
return (t * t * t) * (t * (t * static_cast<T>(6) - static_cast<T>(15)) + static_cast<T>(10));
}

View File

@ -0,0 +1,53 @@
#pragma once
#include "qualifier.hpp"
#include "mat_common_ops.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, R, T, Q> operator-(mat<2, R, T, Q> const& m1);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator++(mat<2, R, T, Q>& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator--(mat<2, R, T, Q>& m);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator+=(mat<2, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator-=(mat<2, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator*=(mat<2, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator/=(mat<2, R, T, Q>& m, U scalar);
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator+=(mat<2, R, T, Q>& m1, mat<2,R,U,Q> const& m2);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, R, T, Q>& operator-=(mat<2, R, T, Q>& m1, mat<2,R,U,Q> const& m2);
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, R, T, Q> operator+(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, R, T, Q> operator-(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, R, T, Q> operator-(T scalar, mat<2, R, T, Q> const& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, R, T, Q> operator/(T scalar, mat<2, R, T, Q>const& m);
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2);
}
#ifndef GLM_EXTERNAL_TEMPLATE
#include "mat2xn_common_ops.inl"
#endif//!GLM_EXTERNAL_TEMPLATE

View File

@ -0,0 +1,106 @@
#include "qualifier.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator++(mat<2, R, T, Q>& m) {
++m[0];
++m[1];
return m;
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator--(mat<2, R, T, Q>& m) {
--m[0];
--m[1];
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator+=(mat<2, R, T, Q>& m, U scalar) {
m[0] += scalar;
m[1] += scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator-=(mat<2, R, T, Q>& m, U scalar) {
m[0] -= scalar;
m[1] -= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator*=(mat<2, R, T, Q>& m, U scalar) {
m[0] *= scalar;
m[1] *= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator/=(mat<2, R, T, Q>& m, U scalar) {
m[0] /= scalar;
m[1] /= scalar;
return m;
}
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator+=(mat<2, R, T, Q>& m1, mat<2, R, U, Q> const& m2) {
m1[0] += m2[0];
m1[1] += m2[1];
return m1;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q>& operator-=(mat<2, R, T, Q>& m1, mat<2, R, U, Q> const& m2) {
m1[0] -= m2[0];
m1[1] -= m2[1];
return m1;
}
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q> operator+(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2) {
return mat<2, R, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q> operator-(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2) {
return mat<2, R, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
// Scalars
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q> operator-(T scalar, mat<2, R, T, Q> const& m) {
return mat<2, R, T, Q>(
scalar - m[0],
scalar - m[1]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q> operator/(T scalar, mat<2, R, T, Q> const& m) {
return mat<2, R, T, Q>(
scalar / m[0],
scalar / m[1]);
}
template<length_t R,typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, R, T, Q> operator-(mat<2, R, T, Q> const& m)
{
return mat<2, R, T, Q>(
-m[0],
-m[1]);
}
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, R, T, Q> const& m1, mat<2, R, T, Q> const& m2) {
return m1[0] == m2[0]
&& m1[1] == m2[1];
}
}

View File

@ -0,0 +1,54 @@
#pragma once
#include "qualifier.hpp"
#include "mat_common_ops.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, R, T, Q> operator-(mat<3, R, T, Q> const& m1);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator++(mat<3, R, T, Q>& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator--(mat<3, R, T, Q>& m);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator+=(mat<3, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator-=(mat<3, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator*=(mat<3, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator/=(mat<3, R, T, Q>& m, U scalar);
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator+=(mat<3, R, T, Q>& m1, mat<3, R, U, Q> const& m2);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, R, T, Q>& operator-=(mat<3, R, T, Q>& m1, mat<3, R, U, Q> const& m2);
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, R, T, Q> operator+(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m2);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, R, T, Q> operator-(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m2);
// Scalars
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, R, T, Q> operator-(T scalar, mat<3, R, T, Q> const& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, R, T, Q> operator/(T scalar, mat<3, R, T, Q>const& m);
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m3);
}
#ifndef GLM_EXTERNAL_TEMPLATE
#include "mat3xn_common_ops.inl"
#endif//!GLM_EXTERNAL_TEMPLATE

View File

@ -0,0 +1,117 @@
#include "qualifier.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator++(mat<3, R, T, Q>& m) {
++m[0];
++m[1];
++m[2];
return m;
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator--(mat<3, R, T, Q>& m) {
--m[0];
--m[1];
--m[2];
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator+=(mat<3, R, T, Q>& m, U scalar) {
m[0] += scalar;
m[1] += scalar;
m[2] += scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator-=(mat<3, R, T, Q>& m, U scalar) {
m[0] -= scalar;
m[1] -= scalar;
m[2] -= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator*=(mat<3, R, T, Q>& m, U scalar) {
m[0] *= scalar;
m[1] *= scalar;
m[2] *= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator/=(mat<3, R, T, Q>& m, U scalar) {
m[0] /= scalar;
m[1] /= scalar;
m[2] /= scalar;
return m;
}
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator+=(mat<3, R, T, Q>& m1, mat<3, R, U, Q> const& m2) {
m1[0] += m2[0];
m1[1] += m2[1];
m1[2] += m2[2];
return m1;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q>& operator-=(mat<3, R, T, Q>& m1, mat<3, R, U, Q> const& m2) {
m1[0] -= m2[0];
m1[1] -= m2[1];
m1[2] -= m2[2];
return m1;
}
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q> operator+(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m2) {
return mat<3, R, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q> operator-(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m2) {
return mat<3, R, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
// Scalars
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q> operator-(T scalar, mat<3, R, T, Q> const& m) {
return mat<3, R, T, Q>(
scalar - m[0],
scalar - m[1],
scalar - m[2]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q> operator/(T scalar, mat<3, R, T, Q> const& m) {
return mat<3, R, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, R, T, Q> operator-(mat<3, R, T, Q> const& m)
{
return mat<3, R, T, Q>(
-m[0],
-m[1],
-m[2]);
}
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, R, T, Q> const& m1, mat<3, R, T, Q> const& m2) {
return m1[0] == m2[0]
&& m1[1] == m2[1]
&& m1[2] == m2[2];
}
}

View File

@ -0,0 +1,52 @@
#pragma once
#include "qualifier.hpp"
#include "mat_common_ops.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, R, T, Q> operator-(mat<4, R, T, Q> const& m1);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator++(mat<4, R, T, Q>& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator--(mat<4, R, T, Q>& m);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator+=(mat<4, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator-=(mat<4, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator*=(mat<4, R, T, Q>& m, U scalar);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator/=(mat<4, R, T, Q>& m, U scalar);
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator+=(mat<4, R, T, Q>& m1, mat<4, R, U, Q> const& m2);
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, R, T, Q>& operator-=(mat<4, R, T, Q>& m1, mat<4, R, U, Q> const& m2);
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, R, T, Q> operator+(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m2);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, R, T, Q> operator-(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m2);
// Scalars
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, R, T, Q> operator-(T scalar, mat<4, R, T, Q> const& m);
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, R, T, Q> operator/(T scalar, mat<4, R, T, Q> const& m);
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m4);
}
#ifndef GLM_EXTERNAL_TEMPLATE
#include "mat4xn_common_ops.inl"
#endif//!GLM_EXTERNAL_TEMPLATE

View File

@ -0,0 +1,131 @@
#include "qualifier.hpp"
namespace glm {
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator++(mat<4, R, T, Q>& m) {
++m[0];
++m[1];
++m[2];
++m[3];
return m;
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator--(mat<4, R, T, Q>& m) {
--m[0];
--m[1];
--m[2];
--m[3];
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator+=(mat<4, R, T, Q>& m, U scalar) {
m[0] += scalar;
m[1] += scalar;
m[2] += scalar;
m[3] += scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator-=(mat<4, R, T, Q>& m, U scalar) {
m[0] -= scalar;
m[1] -= scalar;
m[2] -= scalar;
m[3] -= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator*=(mat<4, R, T, Q>& m, U scalar) {
m[0] *= scalar;
m[1] *= scalar;
m[2] *= scalar;
m[3] *= scalar;
return m;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator/=(mat<4, R, T, Q>& m, U scalar) {
m[0] /= scalar;
m[1] /= scalar;
m[2] /= scalar;
m[3] /= scalar;
return m;
}
// Matrices
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator+=(mat<4, R, T, Q>& m1, mat<4, R, U, Q> const& m2) {
m1[0] += m2[0];
m1[1] += m2[1];
m1[2] += m2[2];
m1[3] += m2[3];
return m1;
}
template<length_t R, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q>& operator-=(mat<4, R, T, Q>& m1, mat<4, R, U, Q> const& m2) {
m1[0] -= m2[0];
m1[1] -= m2[1];
m1[2] -= m2[2];
m1[3] -= m2[3];
return m1;
}
// Matrices
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q> operator+(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m2) {
return mat<4, R, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q> operator-(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m2) {
return mat<4, R, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
// Scalars
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q> operator-(T scalar, mat<4, R, T, Q> const& m) {
return mat<4, R, T, Q>(
scalar - m[0],
scalar - m[1],
scalar - m[2],
scalar - m[3]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q> operator/(T scalar, mat<4, R, T, Q>const& m) {
return mat<4, R, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
scalar / m[3]);
}
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, R, T, Q> operator-(mat<4, R, T, Q> const& m)
{
return mat<4, R, T, Q>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
// -- Boolean operators --
template<length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, R, T, Q> const& m1, mat<4, R, T, Q> const& m2) {
return m1[0] == m2[0]
&& m1[1] == m2[1]
&& m1[2] == m2[2]
&& m1[3] == m2[3];
}
}

View File

@ -0,0 +1,37 @@
#pragma once
#include "qualifier.hpp"
namespace glm {
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator+(mat<C, R, T, Q> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator++(mat<C, R, T, Q>& m, int);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator--(mat<C, R, T, Q>& m, int);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator+(mat<C, R, T, Q> const& m, T scalar);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator-(mat<C, R, T, Q> const& m, T scalar);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator*(mat<C, R, T, Q> const& m, T scalar);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator/(mat<C, R, T, Q> const& m, T scalar);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator+(T scalar, mat<C, R, T, Q> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<C, R, T, Q> operator*(T scalar, mat<C, R, T, Q> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<C, R, T, Q> const& m1, mat<C, R, T, Q> const& m2);
}
#ifndef GLM_EXTERNAL_TEMPLATE
#include "mat_common_ops.inl"
#endif//!GLM_EXTERNAL_TEMPLATE

View File

@ -0,0 +1,67 @@
#include "qualifier.hpp"
namespace glm {
template<length_t C,length_t R,typename T,qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator+(mat<C,R,T,Q> const& m) {
return m;
}
template<length_t C,length_t R,typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C,R, T, Q> operator++(mat<C,R,T,Q>& m,int)
{
mat<C,R, T, Q> Result(m);
++m;
return Result;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator--(mat<C, R, T, Q>& m, int)
{
mat<C, R, T, Q> Result(m);
--m;
return Result;
}
template<length_t C,length_t R,typename T,qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<C, R, T, Q> const& m1, mat<C, R, T, Q> const& m2) {
return !(m1 == m2);
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator+(mat<C, R, T, Q> const& m, T scalar) {
mat<C, R, T, Q> Result(m);
Result += scalar;
return Result;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator-(mat<C, R, T, Q> const& m, T scalar) {
mat<C, R, T, Q> Result(m);
Result -= scalar;
return Result;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator*(mat<C, R, T, Q> const& m, T scalar) {
mat<C, R, T, Q> Result(m);
Result *= scalar;
return Result;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator/(mat<C, R, T, Q> const& m, T scalar) {
mat<C, R, T, Q> Result(m);
Result /= scalar;
return Result;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator+(T scalar, mat<C, R, T, Q> const& m) {
return m + scalar;
}
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<C, R, T, Q> operator*(T scalar, mat<C, R, T, Q> const& m) {
return m * scalar;
}
}

View File

@ -58,28 +58,12 @@ namespace detail
template<glm::qualifier P>
struct is_aligned
{
static const bool value = false;
};
# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
template<>
struct is_aligned<glm::aligned_lowp>
{
static const bool value = true;
};
template<>
struct is_aligned<glm::aligned_mediump>
{
static const bool value = true;
};
template<>
struct is_aligned<glm::aligned_highp>
{
static const bool value = true;
};
static const bool value = (P == glm::aligned_lowp || P == glm::aligned_mediump || P == glm::aligned_highp);
# else
static const bool value = false;
# endif
};
template<length_t L, typename T, bool is_aligned>
struct storage
@ -258,8 +242,7 @@ namespace detail
};
template <typename genType>
struct genTypeTrait
{};
struct genTypeTrait;
template <length_t C, length_t R, typename T>
struct genTypeTrait<mat<C, R, T> >
@ -268,9 +251,7 @@ namespace detail
};
template<typename genType, genTypeEnum type>
struct init_gentype
{
};
struct init_gentype;
template<typename genType>
struct init_gentype<genType, GENTYPE_QUAT>

View File

@ -11,8 +11,7 @@ namespace glm{
namespace detail
{
template <typename T>
union float_t
{};
union float_t; // undefined
// https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
template <>

View File

@ -6,7 +6,7 @@
#include "type_vec2.hpp"
#include <limits>
#include <cstddef>
#include "mat2xn_common_ops.hpp"
namespace glm
{
template<typename T, qualifier Q>
@ -73,66 +73,17 @@ namespace glm
// -- Unary arithmetic operators --
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator*=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator/=(mat<2, 2, U, Q> const& m);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator++ ();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-- ();
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
@ -148,12 +99,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
@ -163,13 +108,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
} //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -243,187 +243,16 @@ namespace glm
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar)
{
this->value[0] += scalar;
this->value[1] += scalar;
return *this;
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) {
return *this = *this * m;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar)
{
this->value[0] -= scalar;
this->value[1] -= scalar;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar)
{
this->value[0] *= scalar;
this->value[1] *= scalar;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar)
{
this->value[0] /= scalar;
this->value[1] /= scalar;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m)
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) {
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int)
{
mat<2, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int)
{
mat<2, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, Q>(
scalar - m[0],
scalar - m[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator*
@ -485,22 +314,6 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, Q>(
scalar / m[0],
scalar / m[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v)
{
@ -519,18 +332,4 @@ namespace glm
mat<2, 2, T, Q> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm

View File

@ -5,6 +5,7 @@
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "mat2xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -75,55 +76,10 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator++ ();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator-- ();
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v);
@ -139,19 +95,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -241,160 +241,7 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int)
{
mat<2, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int)
{
mat<2, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type operator*
(
@ -433,19 +280,19 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
T SrcA02 = m1[0][2];
T SrcA10 = m1[1][0];
T SrcA11 = m1[1][1];
T SrcA12 = m1[1][2];
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA02 = m1[0][2];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA12 = m1[1][2];
T SrcB00 = m2[0][0];
T SrcB01 = m2[0][1];
T SrcB10 = m2[1][0];
T SrcB11 = m2[1][1];
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB20 = m2[2][0];
T const SrcB21 = m2[2][1];
mat<3, 3, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
@ -478,33 +325,4 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, Q>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm

View File

@ -5,6 +5,7 @@
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "mat2xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -77,55 +78,9 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator++ ();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-- ();
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v);
@ -141,19 +96,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -232,171 +232,7 @@ namespace glm
return this->value[i];
}
// -- Unary updatable operators --
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int)
{
mat<2, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int)
{
mat<2, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v)
{
@ -418,23 +254,23 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
T SrcA02 = m1[0][2];
T SrcA03 = m1[0][3];
T SrcA10 = m1[1][0];
T SrcA11 = m1[1][1];
T SrcA12 = m1[1][2];
T SrcA13 = m1[1][3];
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA02 = m1[0][2];
T const SrcA03 = m1[0][3];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA12 = m1[1][2];
T const SrcA13 = m1[1][3];
T SrcB00 = m2[0][0];
T SrcB01 = m2[0][1];
T SrcB10 = m2[1][0];
T SrcB11 = m2[1][1];
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
T SrcB30 = m2[3][0];
T SrcB31 = m2[3][1];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB20 = m2[2][0];
T const SrcB21 = m2[2][1];
T const SrcB30 = m2[3][0];
T const SrcB31 = m2[3][1];
mat<4, 4, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
@ -488,33 +324,4 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, Q>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}
} //namespace glm

View File

@ -5,6 +5,7 @@
#include "type_vec2.hpp"
#include "type_vec3.hpp"
#include "mat3xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -78,59 +79,13 @@ namespace glm
GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_CTOR_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
// Assignment Operator
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator++ ();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator-- ();
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v);
@ -146,20 +101,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -261,175 +261,8 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int)
{
mat<3, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int)
{
mat<3, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, Q>(
-m[0],
-m[1],
-m[2]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v)
{
@ -450,19 +283,19 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
const T SrcA10 = m1[1][0];
const T SrcA11 = m1[1][1];
const T SrcA20 = m1[2][0];
const T SrcA21 = m1[2][1];
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA20 = m1[2][0];
T const SrcA21 = m1[2][1];
const T SrcB00 = m2[0][0];
const T SrcB01 = m2[0][1];
const T SrcB02 = m2[0][2];
const T SrcB10 = m2[1][0];
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB02 = m2[0][2];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB12 = m2[1][2];
mat<2, 2, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
@ -498,35 +331,5 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm

View File

@ -6,6 +6,7 @@
#include "type_vec3.hpp"
#include <limits>
#include <cstddef>
#include "mat3xn_common_ops.hpp"
namespace glm
{
@ -81,65 +82,15 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator--(int);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator*=(mat<3,3 , U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator/=(mat<3, 3, U, Q> const& m);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
@ -155,12 +106,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
@ -170,13 +115,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -266,206 +266,18 @@ namespace glm
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>& mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) {
return *this = *this * m;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s)
{
col_type sv(s);
this->value[0] *= sv;
this->value[1] *= sv;
this->value[2] *= sv;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m)
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>& mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) {
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int)
{
mat<3, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int)
{
mat<3, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, Q>(
-m[0],
-m[1],
-m[2]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, Q>(
scalar - m[0],
scalar - m[1],
scalar - m[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v)
{
@ -582,24 +394,6 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v)
{
@ -619,17 +413,4 @@ namespace glm
return m1_copy /= m2;
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm

View File

@ -7,6 +7,7 @@
#include "type_vec4.hpp"
#include <limits>
#include <cstddef>
#include "mat3xn_common_ops.hpp"
namespace glm
{
@ -82,55 +83,11 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v);
@ -146,19 +103,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -3,44 +3,44 @@ namespace glm
// -- Constructors --
# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE
template<typename T, qualifier Q>
GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat()
template<typename T, qualifier Q>
GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat()
# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)}
: value{ col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0) }
# endif
{
{
# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
this->value[0] = col_type(1, 0, 0, 0);
this->value[1] = col_type(0, 1, 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
}
# endif
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0]), col_type(m[1]), col_type(m[2])}
: value{ col_type(m[0]), col_type(m[1]), col_type(m[2]) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)}
: value{ col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
this->value[2] = col_type(0, 0, s, 0);
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
this->value[2] = col_type(0, 0, s, 0);
# endif
}
@ -52,29 +52,29 @@ namespace glm
T x2, T y2, T z2, T w2
)
# if GLM_HAS_INITIALIZER_LISTS
: value{
col_type(x0, y0, z0, w0),
col_type(x1, y1, z1, w1),
col_type(x2, y2, z2, w2)}
: value{
col_type(x0, y0, z0, w0),
col_type(x1, y1, z1, w1),
col_type(x2, y2, z2, w2) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(v0), col_type(v1), col_type(v2)}
: value{ col_type(v0), col_type(v1), col_type(v2) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
this->value[0] = v0;
this->value[1] = v1;
this->value[2] = v2;
# endif
}
@ -92,16 +92,16 @@ namespace glm
X2 x2, Y2 y2, Z2 z2, W2 w2
)
# if GLM_HAS_INITIALIZER_LISTS
: value{
col_type(x0, y0, z0, w0),
col_type(x1, y1, z1, w1),
col_type(x2, y2, z2, w2)}
: value{
col_type(x0, y0, z0, w0),
col_type(x1, y1, z1, w1),
col_type(x2, y2, z2, w2) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
this->value[0] = col_type(x0, y0, z0, w0);
this->value[1] = col_type(x1, y1, z1, w1);
this->value[2] = col_type(x2, y2, z2, w2);
# endif
}
@ -109,13 +109,13 @@ namespace glm
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(v0), col_type(v1), col_type(v2)}
: value{ col_type(v0), col_type(v1), col_type(v2) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(v0);
this->value[1] = col_type(v1);
this->value[2] = col_type(v2);
this->value[0] = col_type(v0);
this->value[1] = col_type(v1);
this->value[2] = col_type(v2);
# endif
}
@ -125,124 +125,124 @@ namespace glm
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0]), col_type(m[1]), col_type(m[2])}
: value{ col_type(m[0]), col_type(m[1]), col_type(m[2]) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)}
: value{ col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)}
: value{ col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0]), col_type(m[1]), col_type(m[2])}
: value{ col_type(m[0]), col_type(m[1]), col_type(m[2]) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)}
: value{ col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)}
: value{ col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)}
: value{ col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1, 0);
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1, 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)}
: value{ col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
# endif
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m)
# if GLM_HAS_INITIALIZER_LISTS
: value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)}
: value{ col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0) }
# endif
{
# if !GLM_HAS_INITIALIZER_LISTS
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
# endif
}
// -- Accesses --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) GLM_NOEXCEPT
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) GLM_NOEXCEPT
{
GLM_ASSERT_LENGTH(i, this->length());
return this->value[i];
@ -267,181 +267,14 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int)
{
mat<3, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int)
{
mat<3, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, Q>(
-m[0],
-m[1],
-m[2]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type operator*
(
mat<3, 4, T, Q> const& m,
typename mat<3, 4, T, Q>::row_type const& v
)
(
mat<3, 4, T, Q> const& m,
typename mat<3, 4, T, Q>::row_type const& v
)
{
return typename mat<3, 4, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
@ -452,10 +285,10 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::row_type operator*
(
typename mat<3, 4, T, Q>::col_type const& v,
mat<3, 4, T, Q> const& m
)
(
typename mat<3, 4, T, Q>::col_type const& v,
mat<3, 4, T, Q> const& m
)
{
return typename mat<3, 4, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
@ -466,31 +299,31 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
const T SrcA02 = m1[0][2];
const T SrcA03 = m1[0][3];
const T SrcA10 = m1[1][0];
const T SrcA11 = m1[1][1];
const T SrcA12 = m1[1][2];
const T SrcA13 = m1[1][3];
const T SrcA20 = m1[2][0];
const T SrcA21 = m1[2][1];
const T SrcA22 = m1[2][2];
const T SrcA23 = m1[2][3];
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
T const SrcA02 = m1[0][2];
T const SrcA03 = m1[0][3];
T const SrcA10 = m1[1][0];
T const SrcA11 = m1[1][1];
T const SrcA12 = m1[1][2];
T const SrcA13 = m1[1][3];
T const SrcA20 = m1[2][0];
T const SrcA21 = m1[2][1];
T const SrcA22 = m1[2][2];
T const SrcA23 = m1[2][3];
const T SrcB00 = m2[0][0];
const T SrcB01 = m2[0][1];
const T SrcB02 = m2[0][2];
const T SrcB10 = m2[1][0];
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
const T SrcB20 = m2[2][0];
const T SrcB21 = m2[2][1];
const T SrcB22 = m2[2][2];
const T SrcB30 = m2[3][0];
const T SrcB31 = m2[3][1];
const T SrcB32 = m2[3][2];
T const SrcB00 = m2[0][0];
T const SrcB01 = m2[0][1];
T const SrcB02 = m2[0][2];
T const SrcB10 = m2[1][0];
T const SrcB11 = m2[1][1];
T const SrcB12 = m2[1][2];
T const SrcB20 = m2[2][0];
T const SrcB21 = m2[2][1];
T const SrcB22 = m2[2][2];
T const SrcB30 = m2[3][0];
T const SrcB31 = m2[3][1];
T const SrcB32 = m2[3][2];
mat<4, 4, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
@ -543,36 +376,4 @@ namespace glm
m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2],
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}
} //namespace glm

View File

@ -5,6 +5,7 @@
#include "type_vec2.hpp"
#include "type_vec4.hpp"
#include "mat4xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -87,55 +88,14 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator++ ();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-- ();
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v);
@ -151,19 +111,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -281,190 +281,8 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int)
{
mat<4, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int)
{
mat<4, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, Q>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar,
m[3] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v)
{
@ -538,37 +356,4 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar,
m[3] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
scalar / m[3]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
} //namespace glm

View File

@ -5,6 +5,8 @@
#include "type_vec3.hpp"
#include "type_vec4.hpp"
#include "mat4xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -87,55 +89,10 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator--();
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v);
@ -151,19 +108,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -281,189 +281,8 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int)
{
mat<4, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int)
{
mat<4, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, Q>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T scalar)
{
return mat<4, 3, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T scalar)
{
return mat<4, 3, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar,
m[3] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T scalar)
{
return mat<4, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator*(T scalar, mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type operator*
@ -562,37 +381,5 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T scalar)
{
return mat<4, 3, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar,
m[3] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q> operator/(T scalar, mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
scalar / m[3]);
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
} //namespace glm

View File

@ -4,6 +4,8 @@
#pragma once
#include "type_vec4.hpp"
#include "mat4xn_common_ops.hpp"
#include <limits>
#include <cstddef>
@ -86,65 +88,16 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(U s);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m);
// -- Increment and decrement operators --
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator*=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator/=(mat<4, 4, U, Q> const& m);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v);
@ -160,12 +113,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v);
@ -175,13 +122,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -308,6 +308,7 @@ namespace glm
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
//but memcpy is not constexpr
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
@ -315,224 +316,20 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename T,qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
this->value[2] += s;
this->value[3] += s;
return *this;
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) {
return *this = *this * m;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
this->value[2] += m[2];
this->value[3] += m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
this->value[2] -= s;
this->value[3] -= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
this->value[2] -= m[2];
this->value[3] -= m[3];
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
this->value[2] *= s;
this->value[3] *= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
this->value[2] /= s;
this->value[3] /= s;
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m)
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) {
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
++this->value[2];
++this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
--this->value[2];
--this->value[3];
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int)
{
mat<4, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int)
{
mat<4, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary constant operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, Q>(
-m[0],
-m[1],
-m[2],
-m[3]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T scalar)
{
return mat<4, 4, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(T scalar, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T scalar)
{
return mat<4, 4, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar,
m[3] - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(T scalar, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, Q>(
scalar - m[0],
scalar - m[1],
scalar - m[2],
scalar - m[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T scalar)
{
return mat<4, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator*(T scalar, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator*
(
@ -630,7 +427,7 @@ namespace glm
namespace detail
{
template<typename T, qualifier Q, bool is_aligned>
struct mul4x4 {};
struct mul4x4;
template<typename T, qualifier Q>
struct mul4x4<T, Q, true>
@ -712,26 +509,6 @@ namespace glm
return detail::mul4x4<T, Q, detail::is_aligned<Q>::value>::call(m1, m2);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T scalar)
{
return mat<4, 4, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar,
m[3] / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(T scalar, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
scalar / m[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v)
{
@ -748,22 +525,10 @@ namespace glm
GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
mat<4, 4, T, Q> m1_copy(m1);
return m1_copy /= m2;
m1_copy /= m2;
return m1_copy;
}
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}
}//namespace glm
#if GLM_CONFIG_SIMD == GLM_ENABLE

View File

@ -4,6 +4,7 @@
#pragma once
#include "qualifier.hpp"
#include "vec_common_ops.hpp"
#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
# include "_swizzle.hpp"
#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
@ -130,171 +131,77 @@ namespace glm
// -- Unary arithmetic operators --
GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1,U,Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int);
// -- Unary bit operators --
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v);
// These are to avoid ambigiuities
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
// -- Boolean operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2);

View File

@ -94,14 +94,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v)
@ -110,14 +102,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v)
@ -126,14 +110,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v)
@ -142,14 +118,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v)
@ -174,48 +142,15 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int)
{
vec<1, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int)
{
vec<1, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1,U,Q> const& v)
{
this->x %= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v)
@ -224,14 +159,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v)
@ -240,14 +167,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v)
@ -256,14 +175,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v)
@ -272,14 +183,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v)
@ -289,13 +192,6 @@ namespace glm
}
// -- Unary constant operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v)
{
return v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v)
{
@ -304,220 +200,6 @@ namespace glm
}
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar + v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x + v2.x);
}
//operator-
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar - v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x - v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar * v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x * v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar / v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x / v2.x);
}
// -- Binary bit operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x % scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar % v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x % v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x & scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar & v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x & v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x | scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar | v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x | v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
v.x ^ scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
scalar ^ v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
v1.x ^ v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
static_cast<T>(v.x << scalar));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
static_cast<T>(scalar << v.x));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
static_cast<T>(v1.x << v2.x));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, Q>(
static_cast<T>(v.x >> scalar));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, Q>(
static_cast<T>(scalar >> v.x));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, Q>(
static_cast<T>(v1.x >> v2.x));
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v)
{
@ -525,6 +207,50 @@ namespace glm
~v.x);
}
// These are to avoid ambigiuities
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x + v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x - v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x * v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x / v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x % v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x & v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x | v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x ^ v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x << v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) {
return vec<1, T, Q>(v1.x >> v2.x);
}
// -- Boolean operators --
template<typename T, qualifier Q>
@ -533,12 +259,6 @@ namespace glm
return detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(v1.x, v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return !(v1 == v2);
}
template<qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2)
{

View File

@ -4,6 +4,8 @@
#pragma once
#include "qualifier.hpp"
#include "vec_common_ops.hpp"
#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
# include "_swizzle.hpp"
#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
@ -152,237 +154,41 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int);
// -- Unary bit operators --
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v);
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q>& operator&=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v);
@ -391,9 +197,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2);

View File

@ -151,24 +151,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
this->y += static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v)
@ -178,24 +160,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
this->y -= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v)
@ -205,24 +169,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
this->y *= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v)
@ -232,24 +178,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
this->y /= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v)
@ -277,42 +205,8 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int)
{
vec<2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int)
{
vec<2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
this->y %= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v)
@ -322,24 +216,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
this->y &= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v)
@ -349,24 +225,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
this->y |= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v)
@ -376,24 +234,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
this->y ^= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v)
@ -403,24 +243,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
this->y <<= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v)
@ -430,24 +252,6 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
this->y >>= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v)
@ -459,12 +263,6 @@ namespace glm
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v)
{
return v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v)
{
@ -475,407 +273,6 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x + scalar,
v.y + scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x + v2.x,
v1.y + v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar + v.x,
scalar + v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x + v2.x,
v1.x + v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x + v2.x,
v1.y + v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x - scalar,
v.y - scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x - v2.x,
v1.y - v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar - v.x,
scalar - v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x - v2.x,
v1.x - v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x - v2.x,
v1.y - v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x * scalar,
v.y * scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x * v2.x,
v1.y * v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar * v.x,
scalar * v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x * v2.x,
v1.x * v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x * v2.x,
v1.y * v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x / scalar,
v.y / scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x / v2.x,
v1.y / v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar / v.x,
scalar / v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x / v2.x,
v1.x / v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x / v2.x,
v1.y / v2.y);
}
// -- Binary bit operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x % scalar,
v.y % scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x % v2.x,
v1.y % v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar % v.x,
scalar % v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x % v2.x,
v1.x % v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x % v2.x,
v1.y % v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x & scalar,
v.y & scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x & v2.x,
v1.y & v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar & v.x,
scalar & v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x & v2.x,
v1.x & v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x & v2.x,
v1.y & v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x | scalar,
v.y | scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x | v2.x,
v1.y | v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar | v.x,
scalar | v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x | v2.x,
v1.x | v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x | v2.x,
v1.y | v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x ^ scalar,
v.y ^ scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x ^ v2.x,
v1.y ^ v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar ^ v.x,
scalar ^ v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x ^ v2.x,
v1.x ^ v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x ^ v2.x,
v1.y ^ v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x << scalar,
v.y << scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x << v2.x,
v1.y << v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar << v.x,
scalar << v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x << v2.x,
v1.x << v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x << v2.x,
v1.y << v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar)
{
return vec<2, T, Q>(
v.x >> scalar,
v.y >> scalar);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x >> v2.x,
v1.y >> v2.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v)
{
return vec<2, T, Q>(
scalar >> v.x,
scalar >> v.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x >> v2.x,
v1.x >> v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return vec<2, T, Q>(
v1.x >> v2.x,
v1.y >> v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v)
@ -895,12 +292,6 @@ namespace glm
detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(v1.y, v2.y);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2)
{
return !(v1 == v2);
}
template<qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2)
{

View File

@ -4,6 +4,7 @@
#pragma once
#include "qualifier.hpp"
#include "vec_common_ops.hpp"
#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
# include "_swizzle.hpp"
#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
@ -189,72 +190,49 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int);
// -- Unary bit operators --
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v);
};
@ -262,164 +240,11 @@ namespace glm
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v);
@ -428,9 +253,6 @@ namespace glm
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2);

View File

@ -229,13 +229,6 @@ namespace glm
return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_add<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<1, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v)
@ -250,13 +243,6 @@ namespace glm
return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_sub<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<1, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v)
@ -271,13 +257,6 @@ namespace glm
return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(static_cast<T>(scalar))));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_mul<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v)
@ -292,13 +271,6 @@ namespace glm
return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_div<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v)
@ -326,38 +298,8 @@ namespace glm
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int)
{
vec<3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int)
{
vec<3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar)
{
return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v)
@ -367,37 +309,9 @@ namespace glm
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator&=(vec<3, U, Q> const& v)
{
return (*this = detail::compute_vec_and<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_and<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v)
{
return (*this = detail::compute_vec_and<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar)
{
return (*this = detail::compute_vec_or<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_or<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
return (*this = detail::compute_vec_and<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, v));
}
template<typename T, qualifier Q>
@ -407,20 +321,6 @@ namespace glm
return (*this = detail::compute_vec_or<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar)
{
return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v)
@ -428,20 +328,6 @@ namespace glm
return (*this = detail::compute_vec_xor<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar)
{
return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<1, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v)
@ -449,20 +335,6 @@ namespace glm
return (*this = detail::compute_vec_shift_left<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar)
{
return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_shift_right<3, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v)
@ -473,12 +345,6 @@ namespace glm
// -- Unary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v)
{
return v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v)
{
@ -487,309 +353,6 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) += scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<3, T, Q>(v1) += v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(v) += scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) += v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) += v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) -= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) -= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) -= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) -= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) -= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) *= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) *= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(v) *= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(v) *= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) *= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) /= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) /= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) /= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) /= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) /= v2;
}
// -- Binary bit operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) %= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) %= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) %= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) %= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) %= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) &= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) &= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) &= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) &= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) &= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) |= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) |= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) |= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) |= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) |= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) ^= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) ^= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) ^= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) ^= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) ^= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) <<= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) <<= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) << v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) << v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) <<= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar)
{
return vec<3, T, Q>(v) >>= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<3, T, Q>(v) >>= scalar.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar) >>= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v)
{
return vec<3, T, Q>(scalar.x) >>= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return vec<3, T, Q>(v1) >>= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v)
{
@ -810,12 +373,6 @@ namespace glm
detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(v1.z, v2.z);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2)
{
return !(v1 == v2);
}
template<qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2)
{
@ -982,4 +539,4 @@ namespace glm {
}
#endif
#endif

View File

@ -4,6 +4,7 @@
#pragma once
#include "qualifier.hpp"
#include "vec_common_ops.hpp"
#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
# include "_swizzle.hpp"
#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION
@ -259,238 +260,42 @@ namespace glm
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v);
// -- Increment and decrement operators --
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++();
GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--();
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int);
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int);
// -- Unary bit operators --
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v);

View File

@ -419,20 +419,6 @@ namespace detail
return *this;
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar)
{
return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v)
@ -440,20 +426,6 @@ namespace detail
return (*this = detail::compute_vec_add<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar)
{
return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v)
@ -461,20 +433,6 @@ namespace detail
return (*this = detail::compute_vec_sub<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar)
{
return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v)
@ -482,20 +440,6 @@ namespace detail
return (*this = detail::compute_vec_mul<4,T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar)
{
return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v.x)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v)
@ -503,6 +447,13 @@ namespace detail
return (*this = detail::compute_vec_div<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator%=(vec<4, U, Q> const& v)
{
return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
// -- Increment and decrement operators --
template<typename T, qualifier Q>
@ -525,59 +476,8 @@ namespace detail
return *this;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int)
{
vec<4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int)
{
vec<4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar)
{
return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_mod<3, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<3, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v)
{
return (*this = detail::compute_vec_mod<4, T, Q, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar)
{
return (*this = detail::compute_vec_and<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_and<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v)
@ -585,20 +485,6 @@ namespace detail
return (*this = detail::compute_vec_and<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar)
{
return (*this = detail::compute_vec_or<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_or<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v)
@ -606,20 +492,6 @@ namespace detail
return (*this = detail::compute_vec_or<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar)
{
return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v)
@ -627,19 +499,6 @@ namespace detail
return (*this = detail::compute_vec_xor<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar)
{
return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
@ -648,20 +507,6 @@ namespace detail
return (*this = detail::compute_vec_shift_left<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar)
{
return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(scalar)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v)
{
return (*this = detail::compute_vec_shift_right<4, T, Q, detail::is_int<T>::value, sizeof(T) * 8, detail::is_aligned<Q>::value>::call(*this, vec<4, T, Q>(v)));
}
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v)
@ -671,12 +516,6 @@ namespace detail
// -- Unary constant operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v)
{
return v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v)
{
@ -685,308 +524,6 @@ namespace detail
// -- Binary arithmetic operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) += scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) += v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(v) += scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v2) += v1;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) += v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) -= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) -= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) -= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) -= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) -= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) *= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) *= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(v) *= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v2) *= v1;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) *= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) /= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) /= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) /= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) /= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) /= v2;
}
// -- Binary bit operators --
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) %= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) %= v2.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) %= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar.x) %= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) %= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) &= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar)
{
return vec<4, T, Q>(v) &= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) &= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) &= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) &= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) |= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) |= v2.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) |= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) |= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) |= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) ^= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) ^= v2.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) ^= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) ^= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) ^= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) <<= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) <<= v2.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) <<= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) <<= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) <<= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar)
{
return vec<4, T, Q>(v) >>= scalar;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<4, T, Q>(v1) >>= v2.x;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v)
{
return vec<4, T, Q>(scalar) >>= v;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1.x) >>= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2)
{
return vec<4, T, Q>(v1) >>= v2;
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v)
{

View File

@ -0,0 +1,175 @@
#pragma once
#include "qualifier.hpp"
namespace glm {
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v);
template<length_t L,typename T,qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator++(vec<L, T, Q>& v, int);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator--(vec<L, T, Q>& v, int);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator+=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator-=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator*=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator/=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator%=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator&=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator|=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator^=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator<<=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator>>=(vec<L, T, Q>& v1, U scalar);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator+=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator-=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator*=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator/=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator%=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator&=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator|=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator^=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator<<=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q>& operator>>=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2);
// vectors
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
// Scalars
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v, T scalar);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(T scalar, vec<L, T, Q> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(T scalar, vec<L, T, Q> const& v);
//////// vec1
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2);
}
#ifndef GLM_EXTERNAL_TEMPLATE
#include "vec_common_ops.inl"
#endif//GLM_EXTERNAL_TEMPLATE

View File

@ -0,0 +1,329 @@
#include "qualifier.hpp"
namespace glm {
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v) {
return v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator++(vec<L, T, Q>& v, int) {
vec<L, T, Q> Result(v);
++v;
return Result;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator--(vec<L, T, Q>& v, int) {
vec<L, T, Q> Result(v);
--v;
return Result;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator+=(vec<L, T, Q>& v1, U scalar) {
return v1 += vec<L, T, Q>(static_cast<T>(scalar)); // cast to T to reduce template instatntions
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator-=(vec<L, T, Q>& v1, U scalar) {
return v1 -= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator*=(vec<L, T, Q>& v1, U scalar) {
return v1 *= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator/=(vec<L, T, Q>& v1, U scalar) {
return v1 /= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator%=(vec<L, T, Q>& v1, U scalar) {
return v1 %= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator&=(vec<L, T, Q>& v1, U scalar) {
return v1 &= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator|=(vec<L, T, Q>& v1, U scalar) {
return v1 &= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator^=(vec<L, T, Q>& v1, U scalar) {
return v1 ^= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator<<=(vec<L, T, Q>& v1, U scalar) {
return v1 <<= vec<L, T, Q>(static_cast<T>(scalar));
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator>>=(vec<L, T, Q>& v1, U scalar) {
return v1 >>= vec<L, T, Q>(static_cast<T>(scalar));
}
// vec2
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator+=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 += v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator-=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 -= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator*=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 *= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator/=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 /= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator%=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 %= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator&=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 &= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator|=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 |= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator^=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 ^= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator<<=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 <<= v2.x;
}
template<length_t L, typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q>& operator>>=(vec<L, T, Q>& v1, vec<1, U, Q> const& v2) {
return v1 >>= v2.x;
}
// Vectors vs Vectors
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) += v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) -= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) *= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) /= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) %= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) &= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) |= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) ^= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) <<= v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return vec<L, T, Q>(v1) >>= v2;
}
// Scalars
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) += vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) -= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) *= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) /= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) %= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) &= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) |= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) ^= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) <<= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v, T scalar) {
return vec<L, T, Q>(v) >>= vec<L, T, Q>(scalar);
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator+(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) += v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator-(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) -= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator*(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) *= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator/(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) /= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator%(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) %= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator&(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) &= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator|(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) |= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator^(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) ^= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator<<(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) <<= v;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator>>(T scalar, vec<L, T, Q> const& v) {
return vec<L, T, Q>(scalar) >>= v;
}
/// vec1
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator+(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x + v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator-(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x - v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator*(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x * v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator/(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x / v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator%(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x % v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator&(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x & v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator|(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x | v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator^(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x ^ v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x << v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<1, T, Q> const& v1, vec<L, T, Q> const& v2) {
return v1.x >> v2;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator+(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 + v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator-(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 - v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator*(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 * v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator/(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 / v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator%(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 / v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator&(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 & v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator|(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 | v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator^(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 ^ v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator<<(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 << v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> operator>>(vec<L, T, Q> const& v1, vec<1, T, Q> const& v2) {
return v1 >> v2.x;
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2) {
return !(v1 == v2);
}
}

View File

@ -7,158 +7,26 @@ namespace glm
/// @addtogroup gtc_type_ptr
/// @{
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<1, T, Q> const& v)
template<length_t L,typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<L, T, Q> const& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<1, T, Q>& v)
template<length_t L,typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<L, T, Q>& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v)
{
return &(v.x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m)
template<length_t C,length_t R,typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<C, R, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m)
{
return &(m[0].x);
}
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m)
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<C, R, T, Q>& m)
{
return &(m[0].x);
}

View File

@ -24,6 +24,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(-Werror -Weverything)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 15)
add_compile_options(-Wno-unsafe-buffer-usage)
endif()
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")

View File

@ -38,6 +38,7 @@ static int test_storage_aligned()
static int test_storage_unaligned()
{
int Error = 0;
size_t align1_unaligned = alignof(glm::detail::storage<1, int, false>::type);
@ -111,3 +112,4 @@ int main()
return Error;
}