mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-12 02:08:14 +08:00
[saco] Implement member functions to CCamera
This commit is contained in:
1 parent
1f16817ef0
commit
315a961c3e
6 files changed
+133
-3
No files matched your search
@@ -0,0 +1,92 @@
|
||||
|
||||
#include "game.h"
|
||||
#include "util.h"
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::SetBehindPlayer()
|
||||
{
|
||||
ScriptCommand(&lock_camera_position, 0);
|
||||
ScriptCommand(&restore_camera_to_user_defined);
|
||||
field_0 = 0;
|
||||
ScriptCommand(&set_camera_behind_player);
|
||||
ScriptCommand(&restore_camera_jumpcut);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::SetPosition(float fX, float fY, float fZ, float fRotationX, float fRotationY, float fRotationZ)
|
||||
{
|
||||
ScriptCommand(&restore_camera_to_user_defined);
|
||||
field_0 = 0;
|
||||
ScriptCommand(&set_camera_position,fX,fY,fZ,fRotationX,fRotationY,fRotationZ);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::LookAtPoint(float fX, float fY, float fZ, int iType)
|
||||
{
|
||||
ScriptCommand(&restore_camera_to_user_defined);
|
||||
field_0 = 0;
|
||||
ScriptCommand(&point_camera,fX,fY,fZ,iType);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::Restore()
|
||||
{
|
||||
field_0 = 0;
|
||||
ScriptCommand(&restore_camera_jumpcut);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::Fade(int iInOut)
|
||||
{
|
||||
ScriptCommand(&fade,500,iInOut);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::GetMatrix(PMATRIX4X4 Matrix)
|
||||
{
|
||||
Matrix->right.X = m_matPos->right.X;
|
||||
Matrix->right.Y = m_matPos->right.Y;
|
||||
Matrix->right.Z = m_matPos->right.Z;
|
||||
|
||||
Matrix->up.X = m_matPos->up.X;
|
||||
Matrix->up.Y = m_matPos->up.Y;
|
||||
Matrix->up.Z = m_matPos->up.Z;
|
||||
|
||||
Matrix->at.X = m_matPos->at.X;
|
||||
Matrix->at.Y = m_matPos->at.Y;
|
||||
Matrix->at.Z = m_matPos->at.Z;
|
||||
|
||||
Matrix->pos.X = m_matPos->pos.X;
|
||||
Matrix->pos.Y = m_matPos->pos.Y;
|
||||
Matrix->pos.Z = m_matPos->pos.Z;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CCamera::SetMatrix(MATRIX4X4 Matrix)
|
||||
{
|
||||
m_matPos->right.X = Matrix.right.X;
|
||||
m_matPos->right.Y = Matrix.right.Y;
|
||||
m_matPos->right.Z = Matrix.right.Z;
|
||||
|
||||
m_matPos->up.X = Matrix.up.X;
|
||||
m_matPos->up.Y = Matrix.up.Y;
|
||||
m_matPos->up.Z = Matrix.up.Z;
|
||||
|
||||
m_matPos->at.X = Matrix.at.X;
|
||||
m_matPos->at.Y = Matrix.at.Y;
|
||||
m_matPos->at.Z = Matrix.at.Z;
|
||||
|
||||
m_matPos->pos.X = Matrix.pos.X;
|
||||
m_matPos->pos.Y = Matrix.pos.Y;
|
||||
m_matPos->pos.Z = Matrix.pos.Z;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user