summaryrefslogtreecommitdiffstats
path: root/src/core/Placeable.h
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-07-07 15:16:54 +0200
committer_AG <gennariarmando@outlook.com>2019-07-07 15:16:54 +0200
commitd1c6a6aaa6c17250e069d1267b27e13303d6e20f (patch)
tree76d55bfd8bcc8f72cdd4d261c0bb1eaa050e522a /src/core/Placeable.h
parentMerge branch 'master' into master (diff)
parentthe great reorganization (diff)
downloadre3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar.gz
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar.bz2
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar.lz
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar.xz
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.tar.zst
re3-d1c6a6aaa6c17250e069d1267b27e13303d6e20f.zip
Diffstat (limited to 'src/core/Placeable.h')
-rw-r--r--src/core/Placeable.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
new file mode 100644
index 00000000..868ca9e7
--- /dev/null
+++ b/src/core/Placeable.h
@@ -0,0 +1,26 @@
+#pragma once
+
+class CPlaceable
+{
+public:
+ // disable allocation
+ static void *operator new(size_t) = delete;
+
+ CMatrix m_matrix;
+
+ CPlaceable(void);
+ virtual ~CPlaceable(void);
+ CVector &GetPosition(void) { return *m_matrix.GetPosition(); }
+ CVector &GetRight(void) { return *m_matrix.GetRight(); }
+ CVector &GetForward(void) { return *m_matrix.GetForward(); }
+ CVector &GetUp(void) { return *m_matrix.GetUp(); }
+ CMatrix &GetMatrix(void) { return m_matrix; }
+ void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
+ void SetHeading(float angle);
+ bool IsWithinArea(float x1, float y1, float x2, float y2);
+ bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
+
+ CPlaceable *ctor(void) { return ::new (this) CPlaceable(); }
+ void dtor(void) { this->CPlaceable::~CPlaceable(); }
+};
+static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");