diff options
author | kilbith <kilbith@users.noreply.github.com> | 2017-07-15 20:15:36 +0200 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-07-15 20:15:36 +0200 |
commit | ecbc972ea6a2371d64b1d9c9576d31be36b8ae6a (patch) | |
tree | aafe154afcd344c9729f272c9a8e366cbf9b4795 /src/camera.cpp | |
parent | 84aa84591183db08489cad4e5a26472dbd7050b2 (diff) | |
download | minetest-ecbc972ea6a2371d64b1d9c9576d31be36b8ae6a.tar.gz minetest-ecbc972ea6a2371d64b1d9c9576d31be36b8ae6a.tar.bz2 minetest-ecbc972ea6a2371d64b1d9c9576d31be36b8ae6a.zip |
Camera: Fix wieldmesh glitch after teleporting (#6138)
Diffstat (limited to 'src/camera.cpp')
-rw-r--r-- | src/camera.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/camera.cpp b/src/camera.cpp index 35aaeaad4..027e0ffc8 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -215,7 +215,8 @@ static inline v2f dir(const v2f &pos_dist) void Camera::addArmInertia(f32 player_yaw) { - m_cam_vel.X = std::fabs((m_last_cam_pos.X - player_yaw) / 0.016f) * 0.01f; + m_cam_vel.X = std::fabs(rangelim(m_last_cam_pos.X - player_yaw, + -100.0f, 100.0f) / 0.016f) * 0.01f; m_cam_vel.Y = std::fabs((m_last_cam_pos.Y - m_camera_direction.Y) / 0.016f); f32 gap_X = std::fabs(WIELDMESH_OFFSET_X - m_wieldmesh_offset.X); f32 gap_Y = std::fabs(WIELDMESH_OFFSET_Y - m_wieldmesh_offset.Y); |