diff --git a/src/vector.hpp b/src/vector.hpp index a649080..41dd2b8 100644 --- a/src/vector.hpp +++ b/src/vector.hpp @@ -105,6 +105,9 @@ namespace cloonel { template bool operator!= ( const Vector& parA, const Vector& parB ) __attribute__((pure)); + template + Vector operator- ( Vector parOperand ) __attribute__((pure)); + typedef Vector float2; typedef Vector ushort2; typedef Vector int2; diff --git a/src/vector.inl b/src/vector.inl index 98e3d12..2059621 100644 --- a/src/vector.inl +++ b/src/vector.inl @@ -245,4 +245,12 @@ namespace cloonel { } return retVal; } + + template + Vector operator- (Vector parOperand) { + for (uint32_t z = 0; z < S; ++z) { + parOperand[z] = -parOperand[z]; + } + return parOperand; + } } //namespace cloonel