summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-05 16:03:59 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-05 16:03:59 +0200
commit4fc2f9c359781fabe182fec88444ad540125fd40 (patch)
treeb068784c8e75aa87396a99f7399c88e90a150c59 /src/control
parentMerge remote-tracking branch 'origin/master' into MoreLanguages (diff)
parentfixed look behind bug (diff)
downloadre3-4fc2f9c359781fabe182fec88444ad540125fd40.tar
re3-4fc2f9c359781fabe182fec88444ad540125fd40.tar.gz
re3-4fc2f9c359781fabe182fec88444ad540125fd40.tar.bz2
re3-4fc2f9c359781fabe182fec88444ad540125fd40.tar.lz
re3-4fc2f9c359781fabe182fec88444ad540125fd40.tar.xz
re3-4fc2f9c359781fabe182fec88444ad540125fd40.tar.zst
re3-4fc2f9c359781fabe182fec88444ad540125fd40.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Garages.cpp5
-rw-r--r--src/control/Garages.h2
-rw-r--r--src/control/Remote.cpp2
-rw-r--r--src/control/SceneEdit.cpp1
-rw-r--r--src/control/SceneEdit.h1
-rw-r--r--src/control/Script.cpp8
6 files changed, 12 insertions, 7 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 2cb89444..6a91da76 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1464,8 +1464,9 @@ void CGarage::UpdateDoorsHeight()
void CGarage::BuildRotatedDoorMatrix(CEntity * pDoor, float fPosition)
{
float fAngle = -fPosition * HALFPI;
- CVector r(-Sin(fAngle) * pDoor->GetForward().x, Sin(fAngle) * pDoor->GetForward().y, Cos(fAngle) * pDoor->GetForward().z);
- pDoor->GetRight() = CrossProduct(r, pDoor->GetForward());
+ CVector up(-Sin(fAngle) * pDoor->GetForward().y, Sin(fAngle) * pDoor->GetForward().z, Cos(fAngle));
+ pDoor->GetRight() = CrossProduct(up, pDoor->GetForward());
+ pDoor->GetUp() = up;
}
void CGarage::UpdateCrusherAngle()
diff --git a/src/control/Garages.h b/src/control/Garages.h
index 3f471555..e3864a48 100644
--- a/src/control/Garages.h
+++ b/src/control/Garages.h
@@ -5,6 +5,7 @@
#include "config.h"
class CVehicle;
+class CCamera;
enum eGarageState : int8
{
@@ -168,6 +169,7 @@ class CGarage
friend class CGarages;
friend class cAudioManager;
+ friend class CCamera;
};
static_assert(sizeof(CGarage) == 140, "CGarage");
diff --git a/src/control/Remote.cpp b/src/control/Remote.cpp
index e3891502..f7d12702 100644
--- a/src/control/Remote.cpp
+++ b/src/control/Remote.cpp
@@ -35,7 +35,7 @@ CRemote::GivePlayerRemoteControlledCar(float x, float y, float z, float rot, uin
CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = car;
CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->RegisterReference((CEntity**)&CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle);
- TheCamera.TakeControl(car, CCam::MODE_BEHINDCAR, INTERPOLATION, CAM_CONTROLLER_1);
+ TheCamera.TakeControl(car, CCam::MODE_BEHINDCAR, INTERPOLATION, CAMCONTROL_SCRIPT);
}
void
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index 4c05e11b..3e55d431 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -2,6 +2,7 @@
#include "patcher.h"
#include "SceneEdit.h"
+bool &CSceneEdit::m_bEditOn = *(bool*)0x95CD77;
int32 &CSceneEdit::m_bCameraFollowActor = *(int*)0x940590;
bool &CSceneEdit::m_bRecording = *(bool*)0x95CD1F;
CVector &CSceneEdit::m_vecCurrentPosition = *(CVector*)0x943064;
diff --git a/src/control/SceneEdit.h b/src/control/SceneEdit.h
index ec321b27..0de72c19 100644
--- a/src/control/SceneEdit.h
+++ b/src/control/SceneEdit.h
@@ -3,6 +3,7 @@
class CSceneEdit
{
public:
+ static bool &m_bEditOn;
static int32 &m_bCameraFollowActor;
static bool &m_bRecording;
static CVector &m_vecCurrentPosition;
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 8a79ba1d..f96ec060 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -3073,7 +3073,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
{
CollectParameters(&m_nIp, 3);
// ScriptParams[0] is unused.
- TheCamera.TakeControl(nil, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(nil, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_POINT_CAMERA_AT_CAR:
@@ -3081,7 +3081,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CollectParameters(&m_nIp, 3);
CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]);
assert(pVehicle);
- TheCamera.TakeControl(pVehicle, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(pVehicle, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_POINT_CAMERA_AT_CHAR:
@@ -3089,7 +3089,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CollectParameters(&m_nIp, 3);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed);
- TheCamera.TakeControl(pPed, ScriptParams[1], ScriptParams[2], CAM_CONTROLLER_1);
+ TheCamera.TakeControl(pPed, ScriptParams[1], ScriptParams[2], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_RESTORE_CAMERA:
@@ -3140,7 +3140,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
CVector pos = *(CVector*)&ScriptParams[0];
if (pos.z <= MAP_Z_LOW_LIMIT)
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
- TheCamera.TakeControlNoEntity(pos, ScriptParams[3], CAM_CONTROLLER_1);
+ TheCamera.TakeControlNoEntity(pos, ScriptParams[3], CAMCONTROL_SCRIPT);
return 0;
}
case COMMAND_ADD_BLIP_FOR_CAR_OLD: