diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-20 19:41:49 +0300 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-20 19:41:49 +0300 |
commit | 35a7f89f734f2e6e09d05cd90a945982e035b14b (patch) | |
tree | 01fa4f7ed892166777f0d8f810ccdd48c2610588 /src/control | |
parent | b8c34f6654303870865703476125e333a6830ee9 (diff) | |
parent | 98fc8ecef09ba9c50a511c3bcfaca3cffe2fed0b (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Pickups.cpp | 28 |
1 files changed, 28 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++) { |