Mouse free cam for peds&cars (under FREE_CAM)

This commit is contained in:
eray orçunus
2020-03-31 05:54:19 +03:00
parent 8e3ee096e2
commit 5e2fe749bd
8 changed files with 788 additions and 19 deletions

View File

@@ -59,6 +59,10 @@
#define CAN_SEE_ENTITY_ANGLE_THRESHOLD DEGTORAD(60.0f)
#ifdef FREE_CAM
extern bool bFreeMouseCam;
#endif
CPed *gapTempPedList[50];
uint16 gnNumTempPedList;
@@ -807,6 +811,10 @@ CPed::IsPedInControl(void)
bool
CPed::CanStrafeOrMouseControl(void)
{
#ifdef FREE_CAM
if (bFreeMouseCam)
return false;
#endif
return m_nPedState == PED_NONE || m_nPedState == PED_IDLE || m_nPedState == PED_FLEE_POS || m_nPedState == PED_FLEE_ENTITY ||
m_nPedState == PED_ATTACK || m_nPedState == PED_FIGHT || m_nPedState == PED_AIM_GUN || m_nPedState == PED_JUMP;
}
@@ -6984,7 +6992,11 @@ CPed::FinishLaunchCB(CAnimBlendAssociation *animAssoc, void *arg)
#endif
) {
#ifdef FREE_CAM
if (TheCamera.Cams[0].Using3rdPersonMouseCam() && !bFreeMouseCam) {
#else
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) {
#endif
float fpsAngle = ped->WorkOutHeadingForMovingFirstPerson(ped->m_fRotationCur);
ped->m_vecMoveSpeed.x = -velocityFromAnim * Sin(fpsAngle);
ped->m_vecMoveSpeed.y = velocityFromAnim * Cos(fpsAngle);