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:
2026-08-06 10:57:49 +08:00
parent b2187bf0ad
commit d6051486a8
18 changed files with 249 additions and 42 deletions

View File

@@ -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);