From 688553e6c6a000ba3c9f8060da29d73f78660b14 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 7 Jan 2024 19:07:55 -0600 Subject: [PATCH] invert X axis instead of Z axis --- src/engine/CollisionEngine/Mesh.java | 9 ++++++++- src/engine/db/handlers/dbBuildingHandler.java | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/engine/CollisionEngine/Mesh.java b/src/engine/CollisionEngine/Mesh.java index 98d6f5a3..379cefc6 100644 --- a/src/engine/CollisionEngine/Mesh.java +++ b/src/engine/CollisionEngine/Mesh.java @@ -28,8 +28,15 @@ public class Mesh { return false; //character moving is higher than the max Y of this mesh - if(charY > this.maxY && charHeight + charY < this.minY) + float feet = charY; + float head = feet + charHeight; + + if(head < this.minY && feet > this.maxY){ return false; + } + + //if(charY > this.maxY && charHeight + charY < this.minY) + // return false; for(Triangle tri : triangles) if(tri.collides(line)) diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index 260761bd..935c7387 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -895,7 +895,7 @@ public class dbBuildingHandler extends dbHandlerBase { } ArrayList triPoints = new ArrayList<>(); for(int i = 0; i < floatPoints.size(); i += 3){ - triPoints.add(new Vector3f(floatPoints.get(i),floatPoints.get(i+1),floatPoints.get(i+2) * -1)); + triPoints.add(new Vector3f(floatPoints.get(i),floatPoints.get(i+1),floatPoints.get(i+2))); } if(BuildingManager.mesh_triangle_points.containsKey(rs.getInt("meshID")) == false){