summaryrefslogtreecommitdiffstats
path: root/src/core/Placeable.h
blob: 868ca9e7f59366d260f74fd0eb3102167d5b0f47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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");