Added unary + operator #435
This commit is contained in:
@@ -157,7 +157,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -367,7 +367,13 @@ namespace detail
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m)
|
||||
{
|
||||
return tmat2x2<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -149,7 +149,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -337,7 +337,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m)
|
||||
{
|
||||
return tmat2x3<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -151,7 +151,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -338,7 +338,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m)
|
||||
{
|
||||
return tmat2x4<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -156,7 +156,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -376,8 +376,14 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> const operator-(tmat3x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m)
|
||||
{
|
||||
return tmat3x2<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -164,7 +164,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -415,7 +415,13 @@ namespace detail
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m)
|
||||
{
|
||||
return tmat3x3<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -156,7 +156,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -377,7 +377,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> const operator-(tmat3x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m)
|
||||
{
|
||||
return tmat3x4<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -161,7 +161,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -409,7 +409,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m)
|
||||
{
|
||||
return tmat4x2<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -161,7 +161,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -409,7 +409,13 @@ namespace glm
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> const operator-(tmat4x3<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m)
|
||||
{
|
||||
return tmat4x3<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -169,7 +169,10 @@ namespace glm
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m);
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -515,7 +515,13 @@ namespace detail
|
||||
// -- Unary constant operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> const operator-(tmat4x4<T, P> const & m)
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m)
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m)
|
||||
{
|
||||
return tmat4x4<T, P>(
|
||||
-m[0],
|
||||
|
||||
@@ -204,6 +204,9 @@ namespace glm
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
|
||||
|
||||
|
||||
@@ -352,6 +352,12 @@ namespace glm
|
||||
|
||||
// -- Unary constant operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v)
|
||||
{
|
||||
|
||||
@@ -230,6 +230,9 @@ namespace glm
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);
|
||||
|
||||
|
||||
@@ -480,6 +480,12 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator+(tvec2<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec2<T, P> operator-(tvec2<T, P> const & v)
|
||||
{
|
||||
|
||||
@@ -252,6 +252,9 @@ namespace glm
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
|
||||
|
||||
|
||||
@@ -547,6 +547,12 @@ namespace glm
|
||||
|
||||
// -- Unary arithmetic operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator+(tvec3<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> operator-(tvec3<T, P> const & v)
|
||||
{
|
||||
|
||||
@@ -351,6 +351,9 @@ namespace detail
|
||||
|
||||
// -- Unary operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
|
||||
|
||||
|
||||
@@ -645,6 +645,12 @@ namespace glm
|
||||
|
||||
// -- Unary constant operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> operator+(tvec4<T, P> const & v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec4<T, P> operator-(tvec4<T, P> const & v)
|
||||
{
|
||||
|
||||
@@ -149,6 +149,9 @@ namespace glm
|
||||
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q);
|
||||
|
||||
|
||||
@@ -296,6 +296,12 @@ namespace detail
|
||||
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q)
|
||||
{
|
||||
return q;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q)
|
||||
{
|
||||
|
||||
@@ -130,7 +130,10 @@ namespace glm
|
||||
// -- Unary bit operators --
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q);
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const & q);
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL tdualquat<T, P> operator-(tdualquat<T, P> const & q);
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace glm
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tdualquat<T, P> operator-(tdualquat<T, P> const & q)
|
||||
{
|
||||
return tdualquat<T, P>(-q.real,-q.dual);
|
||||
return q;
|
||||
}
|
||||
|
||||
// -- Binary operators --
|
||||
|
||||
Reference in New Issue
Block a user