From edecb3659963d668f7059e6d591a7693f743f146 Mon Sep 17 00:00:00 2001 From: austin Date: Wed, 14 May 2025 20:09:50 -0400 Subject: [PATCH] moving classes --- docs/src/progress/renderertodo.md | 1 + .../menu/debug/entity/ImGuiEntityMacros.java | 75 +++---------------- .../{ => tabs}/ImGuiEntityActorTab.java | 4 +- .../{ => tabs}/ImGuiEntityDebugActions.java | 4 +- .../{ => tabs}/ImGuiEntityFoliageTab.java | 4 +- .../{ => tabs}/ImGuiEntityHitboxTab.java | 4 +- .../ImGuiEntityInstancedActorTab.java | 4 +- .../{ => tabs}/ImGuiEntityInteractionTab.java | 4 +- .../{ => tabs}/ImGuiEntityInventoryTab.java | 4 +- .../{ => tabs}/ImGuiEntityPhysicsTab.java | 4 +- .../{ => tabs}/ImGuiEntityServerTab.java | 4 +- .../{ => tabs}/ImGuiEntityToolbarTab.java | 4 +- 12 files changed, 31 insertions(+), 85 deletions(-) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityActorTab.java (97%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityDebugActions.java (85%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityFoliageTab.java (96%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityHitboxTab.java (95%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityInstancedActorTab.java (99%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityInteractionTab.java (87%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityInventoryTab.java (88%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityPhysicsTab.java (97%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityServerTab.java (86%) rename src/main/java/electrosphere/client/ui/menu/debug/entity/{ => tabs}/ImGuiEntityToolbarTab.java (85%) diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index b7878811..3aa49822 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1781,6 +1781,7 @@ Grid alignment cursor Furniture spawner items triggers grid alignment cursor Grid aligned entity work Grid alignment visualization work +Move around entity debug tab classes diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityMacros.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityMacros.java index 56eec68e..2b36853a 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityMacros.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityMacros.java @@ -6,10 +6,19 @@ import java.util.Set; import org.joml.Quaterniond; import org.joml.Vector3d; -import org.ode4j.ode.DBody; import electrosphere.client.entity.debug.DebugVisualizerUtils; import electrosphere.client.interact.ClientInteractionEngine; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityActorTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityDebugActions; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityFoliageTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityHitboxTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityInstancedActorTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityInteractionTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityInventoryTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityPhysicsTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityServerTab; +import electrosphere.client.ui.menu.debug.entity.tabs.ImGuiEntityToolbarTab; import electrosphere.collision.PhysicsEntityUtils; import electrosphere.data.creature.equip.EquipPoint; import electrosphere.data.foliage.FoliageType; @@ -541,70 +550,6 @@ public class ImGuiEntityMacros { } } - /** - * Physics details - */ - protected static void drawPhysicsDetails(){ - if(showPhysicsTab && ImGui.collapsingHeader("Physics")){ - ImGui.indent(); - if(PhysicsEntityUtils.getDBody(detailViewEntity) != null){ - DBody physicsBody = PhysicsEntityUtils.getDBody(detailViewEntity); - if(physicsBody != null){ - ImGui.text("Position: " + EntityUtils.getPosition(detailViewEntity)); - ImGui.text("Rotation: " + EntityUtils.getRotation(detailViewEntity)); - ImGui.text("Velocity: " + physicsBody.getLinearVel()); - ImGui.text("Force: " + physicsBody.getForce()); - ImGui.text("Angular Velocity: " + physicsBody.getAngularVel()); - ImGui.text("Torque: " + physicsBody.getTorque()); - ImGui.text("Move Vector: " + CreatureUtils.getFacingVector(detailViewEntity)); - ImGui.text("Velocity: " + CreatureUtils.getVelocity(detailViewEntity)); - } - //synchronized data - if( - Globals.clientSceneWrapper.getScene().getEntityFromId(detailViewEntity.getId()) != null && - Globals.clientSceneWrapper.mapClientToServerId(detailViewEntity.getId()) != -1 - ){ - //detailViewEntity is a client entity - //get server entity - int serverIdForClientEntity = Globals.clientSceneWrapper.mapClientToServerId(detailViewEntity.getId()); - Entity serverEntity = EntityLookupUtils.getEntityById(serverIdForClientEntity); - DBody serverPhysicsBody = PhysicsEntityUtils.getDBody(serverEntity); - if(serverPhysicsBody != null){ - ImGui.newLine(); - ImGui.text("Linked server entity:"); - ImGui.text("Position (Server): " + EntityUtils.getPosition(serverEntity)); - ImGui.text("Rotation (Server): " + EntityUtils.getRotation(serverEntity)); - ImGui.text("Velocity (Server): " + serverPhysicsBody.getLinearVel()); - ImGui.text("Force (Server): " + serverPhysicsBody.getForce()); - ImGui.text("Angular Velocity: " + serverPhysicsBody.getAngularVel()); - ImGui.text("Torque: " + serverPhysicsBody.getTorque()); - ImGui.text("Move Vector (Server): "+ CreatureUtils.getFacingVector(serverEntity)); - ImGui.text("Velocity (Server): " + CreatureUtils.getVelocity(serverEntity)); - } - } else if(Globals.clientSceneWrapper.containsServerId(detailViewEntity.getId())){ - //detailViewEntity is a server entity - //get client entity - int clientId = Globals.clientSceneWrapper.mapServerToClientId(detailViewEntity.getId()); - Entity clientEntity = Globals.clientSceneWrapper.getScene().getEntityFromId(clientId); - DBody clientPhysicsBody = PhysicsEntityUtils.getDBody(clientEntity); - if(clientPhysicsBody != null){ - ImGui.newLine(); - ImGui.text("Linked client entity:"); - ImGui.text("Position (Client): " + EntityUtils.getPosition(clientEntity)); - ImGui.text("Rotation (Client): " + EntityUtils.getRotation(clientEntity)); - ImGui.text("Velocity (Client): " + clientPhysicsBody.getLinearVel()); - ImGui.text("Force (Client): " + clientPhysicsBody.getForce()); - ImGui.text("Angular Velocity: " + clientPhysicsBody.getAngularVel()); - ImGui.text("Torque: " + clientPhysicsBody.getTorque()); - ImGui.text("Move Vector (Client): " + CreatureUtils.getFacingVector(clientEntity)); - ImGui.text("Velocity (Client): " + CreatureUtils.getVelocity(clientEntity)); - } - } - } - ImGui.unindent(); - } - } - /** * Gets the displayed name of an entity (ie creature type, foliage type, terrain, etc) * @param entity diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityActorTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityActorTab.java similarity index 97% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityActorTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityActorTab.java index 83825d54..d4c19f66 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityActorTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityActorTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import java.util.Set; import java.util.Random; @@ -29,7 +29,7 @@ public class ImGuiEntityActorTab { /** * Client scene entity view */ - protected static void drawActorView(boolean show, Entity detailViewEntity){ + public static void drawActorView(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Actor Details")){ ImGui.indent(); if(detailViewEntity != null && EntityUtils.getActor(detailViewEntity) != null){ diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityDebugActions.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityDebugActions.java similarity index 85% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityDebugActions.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityDebugActions.java index 84207bd6..b306c86b 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityDebugActions.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityDebugActions.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import electrosphere.engine.Globals; import electrosphere.entity.Entity; @@ -14,7 +14,7 @@ public class ImGuiEntityDebugActions { /** * Debug actions view */ - protected static void drawDebugActions(boolean show, Entity detailViewEntity){ + public static void drawDebugActions(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Debug Actions")){ ImGui.indent(); if(detailViewEntity != null){ diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityFoliageTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityFoliageTab.java similarity index 96% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityFoliageTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityFoliageTab.java index 2b6579f3..cc856287 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityFoliageTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityFoliageTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import electrosphere.client.terrain.foliage.FoliageModel; import electrosphere.data.foliage.FoliageType; @@ -43,7 +43,7 @@ public class ImGuiEntityFoliageTab { /** * Client scene entity view */ - protected static void drawFoliageView(boolean show, Entity detailViewEntity){ + public static void drawFoliageView(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Foliage Data")){ FoliageType foliageData = (FoliageType)CommonEntityUtils.getCommonData(detailViewEntity); ImGui.indent(); diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityHitboxTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityHitboxTab.java similarity index 95% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityHitboxTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityHitboxTab.java index 0efb5a3b..fa00109b 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityHitboxTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityHitboxTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import java.util.LinkedList; import java.util.List; @@ -40,7 +40,7 @@ public class ImGuiEntityHitboxTab { /** * Hitbox data view */ - protected static void drawHitboxTab(boolean show, Entity detailViewEntity){ + public static void drawHitboxTab(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Hitbox Data")){ ImGui.indent(); if(detailViewEntity != null && HitboxCollectionState.hasHitboxState(detailViewEntity)){ diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInstancedActorTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInstancedActorTab.java similarity index 99% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInstancedActorTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInstancedActorTab.java index 95283a52..d8e0e995 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInstancedActorTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInstancedActorTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import java.util.Random; @@ -22,7 +22,7 @@ public class ImGuiEntityInstancedActorTab { /** * Client scene entity view */ - protected static void drawInstancedActorView(boolean show, Entity detailViewEntity){ + public static void drawInstancedActorView(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Instanced Actor Details")){ ImGui.indent(); float[] limbScalarFalloffFactor = new float[1]; diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInteractionTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInteractionTab.java similarity index 87% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInteractionTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInteractionTab.java index abc87ba2..331fe6ef 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInteractionTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInteractionTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import org.ode4j.ode.DBody; @@ -16,7 +16,7 @@ public class ImGuiEntityInteractionTab { /** * Interaction view */ - protected static void drawInteractionTab(boolean show, Entity detailViewEntity){ + public static void drawInteractionTab(boolean show, Entity detailViewEntity){ if(detailViewEntity == null){ return; } diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInventoryTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInventoryTab.java similarity index 88% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInventoryTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInventoryTab.java index 6237270c..31c9ad45 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityInventoryTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityInventoryTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import electrosphere.entity.Entity; import electrosphere.entity.state.inventory.InventoryUtils; @@ -14,7 +14,7 @@ public class ImGuiEntityInventoryTab { /** * Inventory view */ - protected static void drawInventoryTab(boolean show, Entity detailViewEntity){ + public static void drawInventoryTab(boolean show, Entity detailViewEntity){ if(detailViewEntity == null){ return; } diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityPhysicsTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityPhysicsTab.java similarity index 97% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityPhysicsTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityPhysicsTab.java index e5ead481..cb79a870 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityPhysicsTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityPhysicsTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import org.ode4j.ode.DBody; @@ -21,7 +21,7 @@ public class ImGuiEntityPhysicsTab { /** * Physics view */ - protected static void drawPhysicsView(boolean show, Entity detailViewEntity){ + public static void drawPhysicsView(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Physics Details")){ ImGui.indent(); if(PhysicsEntityUtils.getDBody(detailViewEntity) != null){ diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityServerTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityServerTab.java similarity index 86% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityServerTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityServerTab.java index 167ee1d1..09aafa6d 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityServerTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityServerTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import electrosphere.client.ui.menu.debug.server.ImGuiServerDataCell; import electrosphere.engine.Globals; @@ -14,7 +14,7 @@ public class ImGuiEntityServerTab { /** * Physics view */ - protected static void drawServerView(boolean show, Entity detailViewEntity){ + public static void drawServerView(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Server Details")){ ImGui.indent(); ServerDataCell serverDataCell = Globals.entityDataCellMapper.getEntityDataCell(detailViewEntity); diff --git a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityToolbarTab.java b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityToolbarTab.java similarity index 85% rename from src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityToolbarTab.java rename to src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityToolbarTab.java index 5e0d5c56..76064034 100644 --- a/src/main/java/electrosphere/client/ui/menu/debug/entity/ImGuiEntityToolbarTab.java +++ b/src/main/java/electrosphere/client/ui/menu/debug/entity/tabs/ImGuiEntityToolbarTab.java @@ -1,4 +1,4 @@ -package electrosphere.client.ui.menu.debug.entity; +package electrosphere.client.ui.menu.debug.entity.tabs; import electrosphere.entity.Entity; import electrosphere.entity.state.equip.ClientToolbarState; @@ -12,7 +12,7 @@ public class ImGuiEntityToolbarTab { /** * Client scene entity view */ - protected static void drawToolbarTab(boolean show, Entity detailViewEntity){ + public static void drawToolbarTab(boolean show, Entity detailViewEntity){ if(show && ImGui.collapsingHeader("Toolbar Data")){ ClientToolbarState clientToolbarState = ClientToolbarState.getClientToolbarState(detailViewEntity); ImGui.indent();