summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/vector.h b/src/vector.h
index 0122435f..780dc30d 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -61,23 +61,22 @@ class Vector
{}
/**
- * Scale vector operator.
+ * Returns true if all coordinates are set to 0, otherwise returns
+ * false.
*/
- Vector operator*(float c) const
+ bool isNull() const
{
- return Vector(x * c,
- y * c,
- z * c);
+ return x == 0.0f && y == 0.0f && z == 0.0f;
}
/**
* Scale vector operator.
*/
- Vector operator*(const Vector &v) const
+ Vector operator*(float c) const
{
- return Vector(x * v.x,
- y * v.y,
- z * v.z);
+ return Vector(x * c,
+ y * c,
+ z * c);
}
/**
@@ -155,22 +154,6 @@ 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.
*/