re3-mirror/src/core/Placeable.h

38 lines
1.1 KiB
C
Raw Normal View History

2019-05-15 15:52:37 +01:00
#pragma once
class CPlaceable
{
protected:
CMatrix m_matrix;
2019-05-15 15:52:37 +01:00
public:
2019-06-30 11:53:39 +01:00
// disable allocation
2021-06-25 22:27:12 +01:00
static void *operator new(size_t) throw();
2019-06-30 11:53:39 +01:00
2019-05-15 15:52:37 +01:00
CPlaceable(void);
virtual ~CPlaceable(void);
2020-05-05 02:45:18 +01:00
const CVector &GetPosition(void) { return m_matrix.GetPosition(); }
2020-04-30 11:48:01 +01:00
void SetPosition(float x, float y, float z) {
m_matrix.GetPosition().x = x;
m_matrix.GetPosition().y = y;
m_matrix.GetPosition().z = z;
}
void SetPosition(const CVector &pos) { m_matrix.GetPosition() = pos; }
CVector &GetRight(void) { return m_matrix.GetRight(); }
CVector &GetForward(void) { return m_matrix.GetForward(); }
CVector &GetUp(void) { return m_matrix.GetUp(); }
2019-05-15 15:52:37 +01:00
CMatrix &GetMatrix(void) { return m_matrix; }
void SetMatrix(CMatrix &newMatrix) { m_matrix = newMatrix; }
2019-05-15 15:52:37 +01:00
void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
void SetHeading(float angle);
2019-07-08 20:37:47 +01: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 15:52:37 +01: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);
};
2020-05-10 14:54:37 +01:00
VALIDATE_SIZE(CPlaceable, 0x4C);