load mesh data and structure meshes

This commit is contained in:
2024-01-17 20:34:47 -06:00
parent e983a32b5d
commit adcf3fd9b6
11 changed files with 179 additions and 148 deletions
+59
View File
@@ -0,0 +1,59 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
import engine.CollisionEngine.Mesh;
import engine.Enum;
import engine.devcmd.AbstractDevCmd;
import engine.objects.*;
public class ColliderCmd extends AbstractDevCmd {
public ColliderCmd() {
super("collider");
}
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
String newline = "\r\n ";
String output;
if(target.getObjectType().equals(Enum.GameObjectType.Building) == false){
throwbackInfo(pc,"Please Select A Building To Show Collider Data");
}
Building building = (Building)target;
output = "Collision Info:" + newline;
output += "Total Meshes: " + building.buildingMeshes.size() + newline;
for(Mesh mesh : building.buildingMeshes){
output += "-----------------------------";
output += "Mesh ID: " + mesh.mesh_id + newline;
output += "Mesh Location: " + mesh.mesh_location + newline;
output += "Mesh Min/Max: " + mesh.mesh_min_y + "/" + mesh.mesh_max_y + newline;
output += "Mesh Triangle Count: " + mesh.triangles.size() + newline;
output += "Mesh Rect: " + mesh.mesh_bounds + newline;
output += "-----------------------------";
}
throwbackInfo(pc,output);
}
@Override
protected String _getHelpString() {
return "Displays Information About Colliders";
}
@Override
protected String _getUsageString() {
return "' /collider displays collision info when selected on a building";
}
}
-5
View File
@@ -245,11 +245,6 @@ public class InfoCmd extends AbstractDevCmd {
for (Regions regions : targetBuilding.getBounds().getRegions()) {
//TODO ADD REGION INFO
}
output += "-------Mesh Data-------" + newline;
output += "Mesh Count: " + targetBuilding.buildingMeshes.size() + newline;
for(Mesh mesh : targetBuilding.buildingMeshes){
output += "Mesh Rect: " + mesh.boundsRect + newline;
}
break;
case PlayerCharacter:
output += newline;
-12
View File
@@ -47,18 +47,6 @@ public class RegionCmd extends AbstractDevCmd {
output += "is Outside: " + region.isOutside();
this.throwbackInfo(pc, output);
}
if(building != null){
this.throwbackInfo(pc, "Building Rect: " + building.buildingRect);
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");
this.throwbackInfo(pc, "Rect: " + mesh.boundsRect);
return;
}
}
}
this.throwbackInfo(pc, "Outside All Mesh Bounds");
}
@Override