mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Implement CEntity::GetMatrix and CEntity::SetMatrix
This commit is contained in:
1 parent
b370b8d980
commit
7755205ea9
3 files changed
+68
-1
No files matched your search
@@ -26,3 +26,18 @@ typedef struct _MATRIX4X4 {
|
||||
VECTOR pos;
|
||||
float pad_p;
|
||||
} MATRIX4X4, *PMATRIX4X4;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
#pragma pack(1)
|
||||
typedef struct _ENTITY_TYPE
|
||||
{
|
||||
// ENTITY STUFF
|
||||
DWORD vtable; // 0-4
|
||||
|
||||
char _pad4[16];
|
||||
|
||||
MATRIX4X4 *mat; // 20-24
|
||||
|
||||
} ENTITY_TYPE;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
@@ -1,3 +1,53 @@
|
||||
|
||||
#include "../main.h"
|
||||
#include "entity.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CEntity::GetMatrix(PMATRIX4X4 Matrix)
|
||||
{
|
||||
if (!m_pEntity || !m_pEntity->mat) return;
|
||||
|
||||
Matrix->right.X = m_pEntity->mat->right.X;
|
||||
Matrix->right.Y = m_pEntity->mat->right.Y;
|
||||
Matrix->right.Z = m_pEntity->mat->right.Z;
|
||||
|
||||
Matrix->up.X = m_pEntity->mat->up.X;
|
||||
Matrix->up.Y = m_pEntity->mat->up.Y;
|
||||
Matrix->up.Z = m_pEntity->mat->up.Z;
|
||||
|
||||
Matrix->at.X = m_pEntity->mat->at.X;
|
||||
Matrix->at.Y = m_pEntity->mat->at.Y;
|
||||
Matrix->at.Z = m_pEntity->mat->at.Z;
|
||||
|
||||
Matrix->pos.X = m_pEntity->mat->pos.X;
|
||||
Matrix->pos.Y = m_pEntity->mat->pos.Y;
|
||||
Matrix->pos.Z = m_pEntity->mat->pos.Z;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CEntity::SetMatrix(MATRIX4X4 Matrix)
|
||||
{
|
||||
if (!m_pEntity || !m_pEntity->mat) return;
|
||||
|
||||
m_pEntity->mat->right.X = Matrix.right.X;
|
||||
m_pEntity->mat->right.Y = Matrix.right.Y;
|
||||
m_pEntity->mat->right.Z = Matrix.right.Z;
|
||||
|
||||
m_pEntity->mat->up.X = Matrix.up.X;
|
||||
m_pEntity->mat->up.Y = Matrix.up.Y;
|
||||
m_pEntity->mat->up.Z = Matrix.up.Z;
|
||||
|
||||
m_pEntity->mat->at.X = Matrix.at.X;
|
||||
m_pEntity->mat->at.Y = Matrix.at.Y;
|
||||
m_pEntity->mat->at.Z = Matrix.at.Z;
|
||||
|
||||
m_pEntity->mat->pos.X = Matrix.pos.X;
|
||||
m_pEntity->mat->pos.Y = Matrix.pos.Y;
|
||||
m_pEntity->mat->pos.Z = Matrix.pos.Z;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
+3
-1
@@ -11,8 +11,10 @@ public:
|
||||
};
|
||||
virtual ~CEntity() {};
|
||||
|
||||
void GetMatrix(PMATRIX4X4 Matrix);
|
||||
void SetMatrix(MATRIX4X4 Matrix);
|
||||
char field_4[60];
|
||||
int field_40;
|
||||
ENTITY_TYPE *m_pEntity;
|
||||
int field_44;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user