summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-25 17:06:24 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-25 22:37:50 +0200
commit8fd63e5ca6288e0f16c63fa9f378682b31dbaf88 (patch)
tree0351cb51adcacf2cdf0f006d23e2ce7bd8081e3c /src/core
parentimplemented CAutomobile::TankControl (diff)
downloadre3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar.gz
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar.bz2
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar.lz
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar.xz
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.tar.zst
re3-8fd63e5ca6288e0f16c63fa9f378682b31dbaf88.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");