2019-05-15 14:52:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class CPlaceable
|
|
|
|
{
|
|
|
|
public:
|
2019-06-30 10:53:39 +00:00
|
|
|
// disable allocation
|
|
|
|
static void *operator new(size_t) = delete;
|
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
CMatrix m_matrix;
|
|
|
|
|
|
|
|
CPlaceable(void);
|
|
|
|
virtual ~CPlaceable(void);
|
2019-07-08 15:07:34 +00:00
|
|
|
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(); }
|
2019-05-15 14:52:37 +00:00
|
|
|
CMatrix &GetMatrix(void) { return m_matrix; }
|
|
|
|
void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
|
|
|
|
void SetHeading(float angle);
|
2019-07-08 19:37:47 +00:00
|
|
|
void SetOrientation(float x, float y, float z){
|
|
|
|
CVector pos = m_matrix.GetPosition();
|
|
|
|
m_matrix.SetRotate(x, y, z);
|
|
|
|
m_matrix.Translate(pos);
|
|
|
|
}
|
2019-05-15 14:52:37 +00:00
|
|
|
bool IsWithinArea(float x1, float y1, float x2, float y2);
|
|
|
|
bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
|
|
|
|
};
|
2019-08-15 14:52:12 +00:00
|
|
|
static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");
|