summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2020-04-20 07:21:27 +0200
committerGitHub <noreply@github.com>2020-04-20 07:21:27 +0200
commitc9920b6a2db5f871587df09a48304dfcb971c9bf (patch)
treec8671565e55f1f82ec1dd4de8219b440cffdc1ab
parentMerge pull request #479 from Fire-Head/master (diff)
parentcamerapickup ps2 code (diff)
downloadre3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar.gz
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar.bz2
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar.lz
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar.xz
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.tar.zst
re3-c9920b6a2db5f871587df09a48304dfcb971c9bf.zip
-rw-r--r--src/control/Pickups.cpp28
-rw-r--r--src/core/config.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 1bf6d9ce..d5db4ad8 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -623,6 +623,34 @@ CPickups::Update()
if (CReplay::IsPlayingBack())
return;
#endif
+#ifdef CAMERA_PICKUP
+ if ( bPickUpcamActivated ) // taken from PS2
+ {
+ float dist = (FindPlayerCoors() - StaticCamCoors).Magnitude2D();
+ float mult;
+ if ( dist < 10.0f )
+ mult = 1.0f - (dist / 10.0f );
+ else
+ mult = 0.0f;
+
+ CVector pos = StaticCamCoors;
+ pos.z += (pPlayerVehicle->GetColModel()->boundingBox.GetSize().z + 2.0f) * mult;
+
+ if ( (CTimer::GetTimeInMilliseconds() - StaticCamStartTime) > 750 )
+ {
+ TheCamera.SetCamPositionForFixedMode(pos, CVector(0.0f, 0.0f, 0.0f));
+ TheCamera.TakeControl(FindPlayerVehicle(), CCam::MODE_FIXED, JUMP_CUT, CAMCONTROL_SCRIPT);
+ }
+
+ if ( FindPlayerVehicle() != pPlayerVehicle
+ || (FindPlayerCoors() - StaticCamCoors).Magnitude() > 40.0f
+ || ((CTimer::GetTimeInMilliseconds() - StaticCamStartTime) > 60000) )
+ {
+ TheCamera.RestoreWithJumpCut();
+ bPickUpcamActivated = false;
+ }
+ }
+#endif
#define PICKUPS_FRAME_SPAN (6)
#ifdef FIX_BUGS
for (uint32 i = NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN) / PICKUPS_FRAME_SPAN; i < NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN + 1) / PICKUPS_FRAME_SPAN; i++) {
diff --git a/src/core/config.h b/src/core/config.h
index 9f5bfeb6..b5022b9f 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -226,6 +226,7 @@ enum Config {
// Pickups
//#define MONEY_MESSAGES
+#define CAMERA_PICKUP
// Peds
#define ANIMATE_PED_COL_MODEL