mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user