From fff16d22117162e50e602ad8c8a60ecc42e2f150 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 19 Oct 2023 16:10:53 -0400 Subject: [PATCH] Comment cleanup --- src/engine/gameManager/ZoneManager.java | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index a4e4ebf1..86081dd5 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -298,8 +298,6 @@ public enum ZoneManager { localCoords = new Vector2f(worldLoc.x, worldLoc.z); localCoords = localCoords.subtract(zoneOrigin); - // TODO : Make sure this value does not go outside the zone's bounds. - return localCoords; } @@ -320,9 +318,10 @@ public enum ZoneManager { if (building.getBounds().getQuaternion() == null) return building.getLoc(); + // handle building rotation + Vector3fImmutable rotatedLocal = Vector3fImmutable.rotateAroundPoint(Vector3fImmutable.ZERO, localPos, building.getBounds().getQuaternion()); - // handle building rotation // handle building translation return building.getLoc().add(rotatedLocal.x, rotatedLocal.y, rotatedLocal.z); @@ -332,12 +331,10 @@ public enum ZoneManager { //used for regions, Building bounds not set yet. public static Vector3f convertLocalToWorld(Building building, Vector3f localPos, Bounds bounds) { - // convert from SB rotation value to radians - + // handle building rotation Vector3f rotatedLocal = Vector3f.rotateAroundPoint(Vector3f.ZERO, localPos, bounds.getQuaternion()); - // handle building rotation // handle building translation return new Vector3f(building.getLoc().add(rotatedLocal.x, rotatedLocal.y, rotatedLocal.z)); @@ -360,8 +357,6 @@ public enum ZoneManager { public static City getCityAtLocation(Vector3fImmutable worldLoc) { Zone currentZone; - ArrayList zoneList; - City city; currentZone = ZoneManager.findSmallestZone(worldLoc); @@ -408,27 +403,27 @@ public enum ZoneManager { public static float calculateGlobalZoneHeight(Zone zone) { - float worldAlttitude = MBServerStatics.SEA_FLOOR_ALTITUDE; + float worldAltitude = MBServerStatics.SEA_FLOOR_ALTITUDE; // Seafloor if (ZoneManager.seaFloor.equals(zone)) - return worldAlttitude; + return worldAltitude; // Children of seafloor if (ZoneManager.seaFloor.equals(zone.parent)) - return worldAlttitude + zone.yOffset; + return worldAltitude + zone.yOffset; // return height from heightmap engine at zone location - worldAlttitude = Terrain.getWorldHeight(zone.parent, zone.getLoc()); + worldAltitude = Terrain.getWorldHeight(zone.parent, zone.getLoc()); // Add zone offset to value - worldAlttitude += zone.yOffset; + worldAltitude += zone.yOffset; - return worldAlttitude; + return worldAltitude; } public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {