summaryrefslogtreecommitdiffstats
path: root/src/math/Vector.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-18 13:50:37 +0100
committeraap <aap@papnet.eu>2020-12-18 13:50:37 +0100
commit55cf1a37cbce81db5b32264cfb4ebfa0a9793017 (patch)
tree9273d77a5fdffc4bc70cf7439fedb7935da024d6 /src/math/Vector.h
parentlittle cleanup and synch on templates and config (diff)
parentMerge pull request #889 from aap/miami (diff)
downloadre3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.gz
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.bz2
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.lz
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.xz
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.tar.zst
re3-55cf1a37cbce81db5b32264cfb4ebfa0a9793017.zip
Diffstat (limited to 'src/math/Vector.h')
-rw-r--r--src/math/Vector.h25
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); }