feat(gameplay): add server-side entity movement and AI

Refactor LocalPlayer::update_physical to operate on a passed position, and run speed, physical, and wander AI systems in ServerEntityManager.
This commit is contained in:
2026-07-31 20:51:14 +08:00
parent c5ce91e653
commit 2e4a32fed7
4 changed files with 21 additions and 9 deletions

View File

@@ -156,7 +156,7 @@ private:
Gait compute_gait() const;
void update_speed(float dt);
std::tuple<bool, bool, bool> update_physical(float dt);
std::tuple<bool, bool, bool> update_physical(float dt, glm::vec3& pos);
glm::vec3 get_move_distance(float dt);
};
} // namespace Cubed

View File

@@ -45,6 +45,7 @@ private:
void handle_task();
void send_all_entities(std::shared_ptr<Session>& session);
void update_ai();
void update_move();
template <typename... Args>
EntityID create_entity_in_factory(Args&&... args) {
auto entity = m_registry.create();