diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d13479cd3..f248b6ab6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: include: - - os: windows-latest + - os: windows-2022 runs-on: ${{ matrix.os }} diff --git a/src/physics/PhysicsSolver.cpp b/src/physics/PhysicsSolver.cpp index 5fb959670..7ecc07f05 100644 --- a/src/physics/PhysicsSolver.cpp +++ b/src/physics/PhysicsSolver.cpp @@ -151,7 +151,10 @@ bool PhysicsSolver::calcCollisionNegY( continue; } auto aabb = AABB(pos - half, pos + half); - aabb.scale(glm::vec3(1.0f - E * 4.0f, 1.0f - E * 2, 1.0f - E * 4.0f)); + glm::vec3 scale(1.0f); + scale.x = 1.0f - E * 4.0f; + scale.z = 1.0f - E * 4.0f; + aabb.scale(scale); auto boxhalf = box->getHalfSize(); if (box->position.y < pos.y && box->getAABB().intersects(aabb)) { @@ -241,7 +244,7 @@ void PhysicsSolver::calcCollisions( float x = (pos.x - half.x + E) + ix; for (int iz = 0; iz <= glm::ceil((half.z - E) * 2); 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)) { float newy = std::floor(y) - half.y + aabb->min().y - E; if (pos.y >= newy) {