diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Matrix.h | 9 | ||||
-rw-r--r-- | src/math/Vector.h | 25 | ||||
-rw-r--r-- | src/math/VuVector.h | 13 |
3 files changed, 13 insertions, 34 deletions
diff --git a/src/math/Matrix.h b/src/math/Matrix.h index bf811af7..d32b1d93 100644 --- a/src/math/Matrix.h +++ b/src/math/Matrix.h @@ -23,15 +23,6 @@ public: void UpdateRW(void); void operator=(CMatrix const &rhs); CMatrix &operator+=(CMatrix const &rhs); -#ifdef RWCORE_H - operator RwMatrix (void) const { - return m_matrix; - } - - operator RwMatrix *(void) { - return &m_matrix; - } -#endif CMatrix &operator*=(CMatrix const &rhs); const CVector &GetPosition(void) const { return *(CVector*)&m_matrix.pos; } diff --git a/src/math/Vector.h b/src/math/Vector.h index 4cc2171f..02128454 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -1,23 +1,22 @@ #pragma once -class CVector +class CVector : public RwV3d { public: - float x, y, z; CVector(void) {} - CVector(float x, float y, float z) : x(x), y(y), z(z) {} -#ifdef RWCORE_H - CVector(const RwV3d &v) : x(v.x), y(v.y), z(v.z) {} - - operator RwV3d (void) const { - RwV3d vecRw = { this->x, this->y, this->z }; - return vecRw; + CVector(float x, float y, float z) + { + this->x = x; + this->y = y; + this->z = z; } - - operator RwV3d *(void) { - return (RwV3d*)this; + + CVector(const RwV3d &v) + { + x = v.x; + y = v.y; + z = v.z; } -#endif // (0,1,0) means no rotation. So get right vector and its atan float Heading(void) const { return Atan2(-x, y); } float Magnitude(void) const { return Sqrt(x*x + y*y + z*z); } diff --git a/src/math/VuVector.h b/src/math/VuVector.h index f90818e0..30d62cfc 100644 --- a/src/math/VuVector.h +++ b/src/math/VuVector.h @@ -8,18 +8,7 @@ public: CVuVector(float x, float y, float z) : CVector(x, y, z) {} CVuVector(float x, float y, float z, float w) : CVector(x, y, z), w(w) {} CVuVector(const CVector &v) : CVector(v.x, v.y, v.z) {} -#ifdef RWCORE_H - CVuVector(const RwV3d &v) : CVector(v.x, v.y, v.z) {} - - operator RwV3d (void) const { - RwV3d vecRw = { this->x, this->y, this->z }; - return vecRw; - } - - operator RwV3d *(void) { - return (RwV3d*)this; - } -#endif + CVuVector(const RwV3d &v) : CVector(v) {} /* void Normalise(void) { float sq = MagnitudeSqr(); |