mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 15:31:49 +00:00
fix ceiling collision
This commit is contained in:
parent
3d9c831051
commit
625a5caecc
1 changed files with 1 additions and 1 deletions
|
|
@ -244,7 +244,7 @@ void PhysicsSolver::calcCollisions(
|
||||||
float x = (pos.x - half.x + E) + ix;
|
float x = (pos.x - half.x + E) + ix;
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z - E) * 2); iz++) {
|
for (int iz = 0; iz <= glm::ceil((half.z - E) * 2); iz++) {
|
||||||
float z = (pos.z - half.z + E) + iz;
|
float z = (pos.z - half.z + E) + iz;
|
||||||
float y = (pos.y + half.y + E) + 0.5f;
|
float y = (pos.y + half.y + E) - E;
|
||||||
if (auto aabb = chunks.isObstacleAt(x, y, z, boxAABB)) {
|
if (auto aabb = chunks.isObstacleAt(x, y, z, boxAABB)) {
|
||||||
float newy = std::floor(y) - half.y + aabb->min().y - E;
|
float newy = std::floor(y) - half.y + aabb->min().y - E;
|
||||||
if (pos.y >= newy) {
|
if (pos.y >= newy) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue