SA-MP/saco/game/entity.cpp

54 lines
1.3 KiB
C++
Raw Normal View History

2024-02-07 23:40:39 +08:00
#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;
}
//-----------------------------------------------------------
2024-02-07 23:40:39 +08:00