summaryrefslogtreecommitdiffstats
path: root/src/core/Camera.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-26 01:34:32 +0200
committerGitHub <noreply@github.com>2019-07-26 01:34:32 +0200
commit8804aafc6a9f7cd69f51e248546d2f889e65c242 (patch)
treef86d3d0e5b4ec32026775eb9ede17e894d6ca40e /src/core/Camera.cpp
parentRunning script part 3 (diff)
parentMerge pull request #162 from erorcun/erorcun (diff)
downloadre3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.gz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.bz2
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.lz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.xz
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.tar.zst
re3-8804aafc6a9f7cd69f51e248546d2f889e65c242.zip
Diffstat (limited to 'src/core/Camera.cpp')
-rw-r--r--src/core/Camera.cpp11
1 files changed, 11 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);