Files
SA-MP/saco/game/camera.cpp

93 lines
2.2 KiB
C++
Raw Normal View History

#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;
}
//-----------------------------------------------------------