diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-09 22:31:26 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-02-09 22:31:26 +0100 |
commit | bade85c7890c2255dba41b084132ef892bf365fa (patch) | |
tree | 55b5b317e3450d8ac505c317a4a53f2f724f63b2 /src/vector.h | |
parent | b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd (diff) | |
download | mana-bade85c7890c2255dba41b084132ef892bf365fa.tar.gz mana-bade85c7890c2255dba41b084132ef892bf365fa.tar.bz2 mana-bade85c7890c2255dba41b084132ef892bf365fa.tar.xz mana-bade85c7890c2255dba41b084132ef892bf365fa.zip |
Got rid of non-sensical Vector operator overloads
Just because something is the kind of calculation that seems to be
required does not mean it makes sense in general. Let's try to keep
things understandable.
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 33 |
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. */ |