feat(gameplay): implement entity movement system with collision detection

- Add Velocity and HitBoxes components to entity
- Introduce HitboxManager for loading per-entity collision AABBs from JSON
- Create MoveSystem with per-axis collision handling
- Move get_block_aabb to base World class and add virtual get_per_tick_time
- Remove static get_block_aabb from ClientWorld; use member m_per_tick_time for tick duration
This commit is contained in:
2026-07-25 17:47:13 +08:00
parent f9bf2f4b89
commit 930226cc47
11 changed files with 263 additions and 13 deletions

View File

@@ -454,7 +454,7 @@ void ServerWorld::serever_run(std::stop_token stoken) {
Logger::info("Server Thread Started!");
using Clock = std::chrono::steady_clock;
constexpr auto TICK = std::chrono::milliseconds(DEFAULT_PER_TICK_TIME);
const auto TICK = std::chrono::milliseconds(m_per_tick_time);
auto next = Clock::now();
while (!stoken.stop_requested()) {
@@ -1074,4 +1074,6 @@ BlockType ServerWorld::get_block_tpye(const glm::ivec3& block_pos) const {
return chunk_blocks[Chunk::index(x, y, z)];
}
int ServerWorld::get_per_tick_time() const { return m_per_tick_time; }
} // namespace Cubed