mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Merge branch 'main' into environments
This commit is contained in:
commit
d7d7e40799
2 changed files with 6 additions and 3 deletions
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
- os: windows-2022
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue