summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-26 01:32:38 +0200
committerGitHub <noreply@github.com>2019-07-26 01:32:38 +0200
commita9f4ba12d7aeccdff8a021b28956fe5a993a5eac (patch)
tree0351cb51adcacf2cdf0f006d23e2ce7bd8081e3c /src/core
parentimplemented CAutomobile::TankControl (diff)
parentPed & fixes, including peds dive into danger fix (diff)
downloadre3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar.gz
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar.bz2
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar.lz
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar.xz
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.tar.zst
re3-a9f4ba12d7aeccdff8a021b28956fe5a993a5eac.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Camera.cpp11
-rw-r--r--src/core/Camera.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index a66d6ac9..b5ba76db 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -1304,6 +1304,17 @@ CCam::GetWeaponFirstPersonOn()
return false;
}
+float
+CCamera::Find3rdPersonQuickAimPitch(void)
+{
+ float clampedFrontZ = clamp(Cams[ActiveCam].Front.z, -1.0f, 1.0f);
+
+ // float rot = atan2(clampedFrontZ, sqrt(1.0f - sq(clampedFrontZ)));
+ float rot = Asin(clampedFrontZ);
+
+ return -(DEGTORAD(((0.5f - m_f3rdPersonCHairMultY) * 1.8f * 0.5f * Cams[ActiveCam].FOV)) + rot);
+}
+
STARTPATCHES
InjectHook(0x42C760, (bool (CCamera::*)(const CVector &center, float radius, const CMatrix *mat))&CCamera::IsSphereVisible, PATCH_JUMP);
InjectHook(0x46FD00, &CCamera::SetFadeColour, PATCH_JUMP);
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 1a2aae79..3ce0d9a6 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -469,6 +469,8 @@ int m_iModeObbeCamIsInForCar;
void Restore(void);
void SetWidescreenOff(void);
+ float Find3rdPersonQuickAimPitch(void);
+
void dtor(void) { this->CCamera::~CCamera(); }
};
static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error");