Skip to content

Commit

Permalink
Reverse eye-offset Z-coordinate in 3rd person front view (#13369)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhofhansl committed Jul 8, 2023
1 parent 0218963 commit 136a93f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/client/camera.cpp
Expand Up @@ -374,10 +374,19 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio)
// Calculate and translate the head SceneNode offsets
{
v3f eye_offset = player->getEyeOffset();
if (m_camera_mode == CAMERA_MODE_FIRST)
switch(m_camera_mode) {
case CAMERA_MODE_FIRST:
eye_offset += player->eye_offset_first;
else
break;
case CAMERA_MODE_THIRD:
eye_offset += player->eye_offset_third;
break;
case CAMERA_MODE_THIRD_FRONT:
eye_offset.X += player->eye_offset_third.X;
eye_offset.Y += player->eye_offset_third.Y;
eye_offset.Z -= player->eye_offset_third.Z;
break;
}

// Set head node transformation
eye_offset.Y += cameratilt * -player->hurt_tilt_strength + fall_bobbing;
Expand Down

0 comments on commit 136a93f

Please sign in to comment.