Ivan Safrin 12 лет назад
Родитель
Сommit
722e5a458a
2 измененных файлов с 9 добавлено и 3 удалено
  1. 4 1
      Core/Contents/Include/PolyVector2.h
  2. 5 2
      Core/Contents/Include/PolyVector3.h

+ 4 - 1
Core/Contents/Include/PolyVector2.h

@@ -104,10 +104,13 @@ namespace Polycode {
 				return Vector2(x + v2.x, y + v2.y);
 			}		
 
+            inline Vector2 operator - () {
+                return Vector2(-x, -y);
+            }
 
 			inline bool operator == ( const Vector2& v2)  {
 				return (v2.x == x && v2.y == y);
-			}		
+			}
 
 			inline bool operator != ( const Vector2& v2)  {
 				return (v2.x != x || v2.y != y);

+ 5 - 2
Core/Contents/Include/PolyVector3.h

@@ -121,8 +121,11 @@ namespace Polycode {
 	
 			inline Vector3 operator + ( const Vector3& v2 ) const {
 				return Vector3(x + v2.x, y + v2.y, z + v2.z);
-			}		
-
+			}
+        
+            inline Vector3 operator - () {
+                return Vector3(-x, -y, -z);
+            }
 
 			inline bool operator == ( const Vector3& v2)  {
 				return (v2.x == x && v2.y == y && v2.z == z);