diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-06 19:00:22 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-06 19:00:22 +0200 |
commit | 32043605153543bd72eb012ff310367299ad4e8f (patch) | |
tree | 91371b113a60d6069dd7d90d0819e4ea3bfdf58d /src/math/vector.h | |
parent | e8c9945e13fca88a6f8232838682df0654437f3e (diff) | |
download | colobot-32043605153543bd72eb012ff310367299ad4e8f.tar.gz colobot-32043605153543bd72eb012ff310367299ad4e8f.tar.bz2 colobot-32043605153543bd72eb012ff310367299ad4e8f.zip |
Refactoring in math & texture modules
- moved texture-related structs to texture.h & code to texture.cpp
- cleaned up texture test code
- added Math:: namespace qualifiers to math modules for clarity
Diffstat (limited to 'src/math/vector.h')
-rw-r--r-- | src/math/vector.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/math/vector.h b/src/math/vector.h index baba6bb..41f11a8 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -205,7 +205,7 @@ struct Vector }; // struct Point //! Checks if two vectors are equal within given \a tolerance -inline bool VectorsEqual(const Vector &a, const Vector &b, float tolerance = TOLERANCE) +inline bool VectorsEqual(const Math::Vector &a, const Math::Vector &b, float tolerance = TOLERANCE) { return IsEqual(a.x, b.x, tolerance) && IsEqual(a.y, b.y, tolerance) @@ -213,7 +213,7 @@ inline bool VectorsEqual(const Vector &a, const Vector &b, float tolerance = TOL } //! Convenience function for getting normalized vector -inline Vector Normalize(const Vector &v) +inline Vector Normalize(const Math::Vector &v) { Vector result = v; result.Normalize(); @@ -221,25 +221,25 @@ inline Vector Normalize(const Vector &v) } //! Convenience function for calculating dot product -inline float DotProduct(const Vector &left, const Vector &right) +inline float DotProduct(const Math::Vector &left, const Math::Vector &right) { return left.DotMultiply(right); } //! Convenience function for calculating cross product -inline Vector CrossProduct(const Vector &left, const Vector &right) +inline Vector CrossProduct(const Math::Vector &left, const Math::Vector &right) { return left.CrossMultiply(right); } //! Convenience function for calculating angle (in radians) between two vectors -inline float Angle(const Vector &a, const Vector &b) +inline float Angle(const Math::Vector &a, const Math::Vector &b) { return a.Angle(b); } //! Returns the distance between the ends of two vectors -inline float Distance(const Vector &a, const Vector &b) +inline float Distance(const Math::Vector &a, const Math::Vector &b) { return sqrtf( (a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) + |