mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Reverse eye-offset Z-coordinate in 3rd person front view (#13369)
This commit is contained in:
parent
0218963f1b
commit
136a93f628
@ -374,10 +374,19 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 tool_reload_ratio)
|
|||||||
// Calculate and translate the head SceneNode offsets
|
// Calculate and translate the head SceneNode offsets
|
||||||
{
|
{
|
||||||
v3f eye_offset = player->getEyeOffset();
|
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;
|
eye_offset += player->eye_offset_first;
|
||||||
else
|
break;
|
||||||
|
case CAMERA_MODE_THIRD:
|
||||||
eye_offset += player->eye_offset_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
|
// Set head node transformation
|
||||||
eye_offset.Y += cameratilt * -player->hurt_tilt_strength + fall_bobbing;
|
eye_offset.Y += cameratilt * -player->hurt_tilt_strength + fall_bobbing;
|
||||||
|
Loading…
Reference in New Issue
Block a user