mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
feat(creatures): animate creature walk cycles
Add a Gait component synchronized over the network and procedural animation for model nodes. Load animation parameters from assets/model/creature/pig/animation.json and apply leg swing, body bob, and head motion based on gait. Refactor Gait into its own header for reuse.
This commit is contained in:
@@ -307,9 +307,9 @@ void WorldRenderer::shadow_entity(ClientWorld& world,
|
||||
auto& t = view.get<RenderTransform>(entity);
|
||||
float yaw = std::atan2(t.direction.value.x, t.direction.value.z);
|
||||
|
||||
m_renderer.model_renderer().shadow_pass(creature.model,
|
||||
t.position.value, yaw,
|
||||
world.world_scene().camera());
|
||||
m_renderer.model_renderer().shadow_pass(
|
||||
creature.model, t.position.value, yaw, world.world_scene().camera(),
|
||||
creature.pose);
|
||||
}
|
||||
m_player_renderer.render(shader, world, true);
|
||||
}
|
||||
@@ -734,9 +734,9 @@ void WorldRenderer::render_entity(ClientWorld& world) {
|
||||
}
|
||||
auto& t = view.get<RenderTransform>(entity);
|
||||
float yaw = std::atan2(t.direction.value.x, t.direction.value.z);
|
||||
m_renderer.model_renderer().render_model(creature.model,
|
||||
t.position.value, yaw,
|
||||
world.world_scene().camera());
|
||||
m_renderer.model_renderer().render_model(
|
||||
creature.model, t.position.value, yaw, world.world_scene().camera(),
|
||||
creature.pose);
|
||||
}
|
||||
|
||||
m_player_renderer.render(shader, world, false);
|
||||
|
||||
Reference in New Issue
Block a user