diff options
author | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
commit | 53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb (patch) | |
tree | fc65a6c40fa719f9d43be9e0e15be79c490135e0 /src/core/Placeable.h | |
parent | finished CPhysical (diff) | |
download | re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.gz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.bz2 re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.lz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.xz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.zst re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.zip |
Diffstat (limited to 'src/core/Placeable.h')
-rw-r--r-- | src/core/Placeable.h | 26 |
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"); |