feat: add collision detection

This commit is contained in:
2026-03-29 20:19:08 +08:00
parent 01d6e91da9
commit fb11fee955
8 changed files with 276 additions and 168 deletions

View File

@@ -12,15 +12,10 @@ World::~World() {
}
bool World::can_move(const glm::vec3& pos) const{
bool World::can_move(const AABB& player_box) const{
if (is_block(glm::floor(glm::vec3(pos.x, pos.y - 0.5f, pos.z)))) {
return false;
}
if (is_block(glm::floor(glm::vec3(pos.x, pos.y + 0.5f, pos.z)))) {
return false;
}
return true;
}