diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-12-18 01:58:09 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-12-18 01:58:09 +0100 |
commit | cfda5eb148abdb502b049083c83f166460ccc8be (patch) | |
tree | 290b84a8053f37f3b676fd26314631a528f04630 /src/math/Vector.h | |
parent | Fix placement of some script functions (diff) | |
download | re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.gz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.bz2 re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.lz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.xz re3-cfda5eb148abdb502b049083c83f166460ccc8be.tar.zst re3-cfda5eb148abdb502b049083c83f166460ccc8be.zip |
Diffstat (limited to '')
-rw-r--r-- | src/math/Vector.h | 25 |
1 files changed, 12 insertions, 13 deletions
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); } |