From f755a1eeb45262fe3aea64efc3914709d572afcc Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 26 Dec 2025 18:09:35 +0500 Subject: Add interpolation to Velocity component; fixes #20 - Also disabled snapping to grid for sideways movement as it was somehow messing with player_move code and was making you slide on voxels as if you were on ice (not good) --- src/game/client/entity/camera.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game/client/entity/camera.cc') diff --git a/src/game/client/entity/camera.cc b/src/game/client/entity/camera.cc index 2009066..27603cf 100644 --- a/src/game/client/entity/camera.cc +++ b/src/game/client/entity/camera.cc @@ -8,6 +8,7 @@ #include "core/math/angles.hh" +#include "shared/entity/grounded.hh" #include "shared/entity/head.hh" #include "shared/entity/transform.hh" #include "shared/entity/velocity.hh" @@ -87,7 +88,7 @@ void camera::update(void) const auto& head = globals::dimension->entities.get(globals::player); const auto& transform = globals::dimension->entities.get(globals::player); - const auto& velocity = globals::dimension->entities.get(globals::player); + const auto& velocity = globals::dimension->entities.get(globals::player); camera::angles = transform.angles + head.angles; camera::position_chunk = transform.chunk; @@ -98,8 +99,7 @@ void camera::update(void) auto client_angles = camera::angles; - if(!toggles::get(TOGGLE_PM_FLIGHT)) { - // Apply the quake-like view rolling + if(!toggles::get(TOGGLE_PM_FLIGHT) && globals::dimension->entities.try_get(globals::player)) { client_angles[2] = math::radians(-camera::roll_angle.get_value() * glm::dot(velocity.value / PMOVE_MAX_SPEED_GROUND, right_vector)); } -- cgit