1
0
mirror of https://github.com/halpz/re3.git synced 2025-07-03 05:40:48 +00:00

more CAutomobile

This commit is contained in:
aap
2019-07-08 21:37:47 +02:00
parent edf5ac2626
commit 2ae112fdf6
18 changed files with 475 additions and 34 deletions

@ -82,6 +82,32 @@ public:
CVector &GetRight(void) { return *(CVector*)&m_matrix.right; }
CVector &GetForward(void) { return *(CVector*)&m_matrix.up; }
CVector &GetUp(void) { return *(CVector*)&m_matrix.at; }
void SetTranslate(float x, float y, float z){
m_matrix.right.x = 1.0f;
m_matrix.right.y = 0.0f;
m_matrix.right.z = 0.0f;
m_matrix.up.x = 0.0f;
m_matrix.up.y = 1.0f;
m_matrix.up.z = 0.0f;
m_matrix.at.x = 0.0f;
m_matrix.at.y = 0.0f;
m_matrix.at.z = 1.0f;
m_matrix.pos.x = x;
m_matrix.pos.y = y;
m_matrix.pos.z = z;
}
void SetTranslate(const CVector &trans){ SetTranslate(trans.x, trans.y, trans.z); }
void Translate(float x, float y, float z){
m_matrix.pos.x += x;
m_matrix.pos.y += y;
m_matrix.pos.z += z;
}
void Translate(const CVector &trans){ Translate(trans.x, trans.y, trans.z); }
void SetScale(float s){
m_matrix.right.x = s;
m_matrix.right.y = 0.0f;
@ -99,6 +125,7 @@ public:
m_matrix.pos.y = 0.0f;
m_matrix.pos.z = 0.0f;
}
void SetRotateXOnly(float angle){
float c = cos(angle);
float s = sin(angle);