Skip to content

Commit

Permalink
Fix jitter in 3rd person vehicle cam when vehicle cinema mode is active
Browse files Browse the repository at this point in the history
  • Loading branch information
fholger committed Sep 20, 2023
1 parent c09bb24 commit 21fcfff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/CryGame C++/Solution1/CryGame/XPlayerCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ void CPlayer::UpdateCamera()
offset = offset*(targetMt);
offset += m_pVehicle->GetEntity()->GetPos();

// in the vehicle cinema mode it sometimes happens that the camera accumulates some weird shaking, usually while firing
// this is ultimately caused by the player entity's quaternion jumping between two values. Not sure why; might come
// from some camera shake somewhere that we no longer properly deal with. Anyway, resetting the quat here fixes it
// and I could not observe any negative side-effects.
pe_params_pos pp;
pp.q = Quat(1, 0, 0, 0);
physEnt->SetParams(&pp);

camera->SetThirdPersonMode(offset,
angles,CAMERA_3DPERSON1,100.f,camRange,!m_bFirstPerson,physEnt,
physEntCar,
Expand Down

0 comments on commit 21fcfff

Please sign in to comment.