load mesh data and structure meshes
This commit is contained in:
@@ -35,7 +35,8 @@ public class Mesh {
|
||||
|
||||
|
||||
//check to see if character is under or over the mesh
|
||||
if((charY + charHeight) < this.minY || charY > this.maxY)
|
||||
float head = charY + charHeight;
|
||||
if(head < this.minY || charY > this.maxY)
|
||||
return false;
|
||||
|
||||
//check if any triangles intersect the movement path
|
||||
|
||||
@@ -49,6 +49,7 @@ public class RegionCmd extends AbstractDevCmd {
|
||||
}
|
||||
if(building != null){
|
||||
for (Mesh mesh : building.buildingMeshes){
|
||||
this.throwbackInfo(pc, "Mesh Rect: " + mesh.boundsRect);
|
||||
if(mesh.boundsRect.contains(pc.loc.x,pc.loc.z)) {
|
||||
this.throwbackInfo(pc, "Inside A Mesh's Bounds");
|
||||
return;
|
||||
|
||||
@@ -1017,12 +1017,13 @@ public enum BuildingManager {
|
||||
Point2D.Float p4 = new Point2D.Float(bottomLeft.x, bottomLeft.z);
|
||||
float rectWidth = topLeft.distance(topRight);
|
||||
float rectHeight = topLeft.distance(bottomLeft);
|
||||
boundingBox.setRect(p1.x, p1.y, rectWidth, rectHeight);
|
||||
generatedMesh.boundsRect = new Rectangle2D.Float();
|
||||
generatedMesh.boundsRect.setRect(p1.x, p1.y, rectWidth, rectHeight);
|
||||
generatedMesh.BoundingLines.add(new Line2D.Float(p1, p2));
|
||||
generatedMesh.BoundingLines.add(new Line2D.Float(p2, p3));
|
||||
generatedMesh.BoundingLines.add(new Line2D.Float(p3, p4));
|
||||
generatedMesh.BoundingLines.add(new Line2D.Float(p4, p1));
|
||||
generatedMesh.boundsRect = boundingBox;
|
||||
//generatedMesh.boundsRect = boundingBox;
|
||||
} else{
|
||||
Logger.error("No Bounding Box Data For Mesh: " + mesh);
|
||||
}
|
||||
@@ -1049,13 +1050,14 @@ public enum BuildingManager {
|
||||
}
|
||||
building.buildingMeshes.add(generatedMesh);
|
||||
}
|
||||
Rectangle2D.Float buildingBound = new Rectangle2D.Float();
|
||||
//Rectangle2D.Float buildingBound = new Rectangle2D.Float();
|
||||
float xLoc = building.loc.x - building.getBounds().getHalfExtents().x;
|
||||
float zLoc = building.loc.z - building.getBounds().getHalfExtents().y;
|
||||
float width = building.getBounds().getHalfExtents().x * 2;
|
||||
float height = building.getBounds().getHalfExtents().y * 2;
|
||||
buildingBound.setRect(xLoc,zLoc,width,height);
|
||||
building.buildingRect = buildingBound;
|
||||
building.buildingRect = new Rectangle2D.Float();
|
||||
building.buildingRect.setRect(xLoc,zLoc,width,height);
|
||||
//building.buildingRect = buildingBound;
|
||||
}
|
||||
catch(Exception e){
|
||||
Logger.info("Failed To Bake Building Mesh Data For Structure: " + building.meshUUID);
|
||||
|
||||
@@ -43,8 +43,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
|
||||
Line2D travelLine = new Line2D.Float();
|
||||
Vector3fImmutable endLoc = new Vector3fImmutable(msg.getEndLat(),msg.getEndAlt(),msg.getEndLon());
|
||||
travelLine.setLine(pc.loc.x,pc.loc.z,endLoc.x,endLoc.z);
|
||||
float movementDistance = 185 + pc.loc.distance(endLoc);
|
||||
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(pc.loc, movementDistance, MBServerStatics.MASK_BUILDING);
|
||||
HashSet<AbstractWorldObject> awoList = WorldGrid.getObjectsInRangePartial(pc.loc, 1000, MBServerStatics.MASK_BUILDING);
|
||||
for(AbstractWorldObject awo : awoList){
|
||||
Building building = (Building)awo;
|
||||
if(CollisionManager.CollisionDetected(building, travelLine,pc.getCharacterHeight(),pc.loc.y)){
|
||||
@@ -54,7 +53,7 @@ public class MoveToPointHandler extends AbstractClientMsgHandler {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
ChatManager.chatSystemInfo(pc, "No Collision Detected");
|
||||
//ChatManager.chatSystemInfo(pc, "No Collision Detected");
|
||||
MovementManager.movement(msg, pc);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user