Browse Source

invert X axis instead of Z axis

server-collision
FatBoy-DOTC 10 months ago
parent
commit
688553e6c6
  1. 9
      src/engine/CollisionEngine/Mesh.java
  2. 2
      src/engine/db/handlers/dbBuildingHandler.java

9
src/engine/CollisionEngine/Mesh.java

@ -28,8 +28,15 @@ public class Mesh {
return false; return false;
//character moving is higher than the max Y of this mesh //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; return false;
}
//if(charY > this.maxY && charHeight + charY < this.minY)
// return false;
for(Triangle tri : triangles) for(Triangle tri : triangles)
if(tri.collides(line)) if(tri.collides(line))

2
src/engine/db/handlers/dbBuildingHandler.java

@ -895,7 +895,7 @@ public class dbBuildingHandler extends dbHandlerBase {
} }
ArrayList<Vector3f> triPoints = new ArrayList<>(); ArrayList<Vector3f> triPoints = new ArrayList<>();
for(int i = 0; i < floatPoints.size(); i += 3){ 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){ if(BuildingManager.mesh_triangle_points.containsKey(rs.getInt("meshID")) == false){

Loading…
Cancel
Save