feat: sync entity direction and rotate models accordingly

Move direction into the transform component and include it in server-to-client entity updates. Client now sets transform direction from the network message and uses it to compute yaw for model rotation, so entities visually face their movement direction. Refactor net_utils to support arbitrary Vec3 fields.
This commit is contained in:
2026-08-04 10:46:31 +08:00
parent 6b1f9d7354
commit e2bbc2d57f
12 changed files with 37 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ void WanderAISystem::do_ai(BaseServerCreature& creature,
MoveBoost& move_boost) {
thread_local Random r{std::random_device()()};
if (r.random_bool(DIRECTION_PROBABILITY)) {
creature.direction.value = r.random_direction_horizontal();
creature.transform.direction.value = r.random_direction_horizontal();
}
if (r.random_bool(MOVE_PROBABILITY)) {