From 56f501c8148b1061a02547d37b20eeeeb64029db Mon Sep 17 00:00:00 2001 From: Bertram Date: Tue, 9 Feb 2010 01:42:50 +0100 Subject: Made the Beings' logic be able to handle any tile height/width. This is the First step to get rid of most hardcoded 32 values. --- src/vector.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/vector.h') diff --git a/src/vector.h b/src/vector.h index 3a5c01c1..0122435f 100644 --- a/src/vector.h +++ b/src/vector.h @@ -70,6 +70,16 @@ class Vector z * c); } + /** + * 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. */ @@ -144,6 +154,22 @@ class Vector return *this; } + /** + * 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. -- cgit v1.2.3-70-g09d2