summaryrefslogtreecommitdiffstats
path: root/src/game/client/entity/factory.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-12-26 18:09:35 +0500
committeruntodesu <kirill@untode.su>2025-12-26 18:09:35 +0500
commitf755a1eeb45262fe3aea64efc3914709d572afcc (patch)
treebb08dff89a7ddd446a4363edabac8f9ee0514234 /src/game/client/entity/factory.cc
parenteebc2b776717f18e4a24af39b0209afa8eb7404f (diff)
downloadvoxelius-f755a1eeb45262fe3aea64efc3914709d572afcc.tar.bz2
voxelius-f755a1eeb45262fe3aea64efc3914709d572afcc.zip
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)
Diffstat (limited to 'src/game/client/entity/factory.cc')
-rw-r--r--src/game/client/entity/factory.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game/client/entity/factory.cc b/src/game/client/entity/factory.cc
index f4724c5..94a9698 100644
--- a/src/game/client/entity/factory.cc
+++ b/src/game/client/entity/factory.cc
@@ -5,6 +5,7 @@
#include "shared/entity/factory.hh"
#include "shared/entity/head.hh"
#include "shared/entity/transform.hh"
+#include "shared/entity/velocity.hh"
#include "shared/world/dimension.hh"
@@ -24,6 +25,10 @@ void client::create_player(Dimension* dimension, entt::entity entity)
dimension->entities.emplace_or_replace<client::TransformIntr>(entity, transform);
dimension->entities.emplace_or_replace<client::TransformPrev>(entity, transform);
+ const auto& velocity = dimension->entities.get<Velocity>(entity);
+ dimension->entities.emplace_or_replace<client::VelocityIntr>(entity, velocity);
+ dimension->entities.emplace_or_replace<client::VelocityPrev>(entity, velocity);
+
if(globals::sound_ctx) {
dimension->entities.emplace_or_replace<SoundEmitter>(entity);
}