summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h
index 3a5c01c1..0122435f 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -71,6 +71,16 @@ class Vector
}
/**
+ * Scale vector operator.
+ */
+ Vector operator*(const Vector &v) const
+ {
+ return Vector(x * v.x,
+ y * v.y,
+ z * v.z);
+ }
+
+ /**
* In-place scale vector operator.
*/
Vector &operator*=(float c)
@@ -145,6 +155,22 @@ class Vector
}
/**
+ * In-place > test vector operator.
+ */
+ bool operator>(const Vector &v)
+ {
+ return (x > v.x || y > v.y || z > v.z);
+ }
+
+ /**
+ * In-place > test vector operator against a float.
+ */
+ bool operator>(float c)
+ {
+ return (x > c || y > c || z > c);
+ }
+
+ /**
* Returns the length of this vector. This method does a relatively
* slow square root.
*/