From a53c68054d30ddc2ad06c4ad66c16cc299650243 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 11 Oct 2023 17:20:23 -0400 Subject: [PATCH] Only one kind of zone. --- src/engine/gameManager/ZoneManager.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/gameManager/ZoneManager.java b/src/engine/gameManager/ZoneManager.java index 450c24d7..ae544cfe 100644 --- a/src/engine/gameManager/ZoneManager.java +++ b/src/engine/gameManager/ZoneManager.java @@ -277,24 +277,24 @@ public enum ZoneManager { // Converts world coordinates to coordinates local to a given zone. public static Vector3fImmutable worldToLocal(Vector3fImmutable worldVector, - Zone serverZone) { + Zone zone) { Vector3fImmutable localCoords; - localCoords = new Vector3fImmutable(worldVector.x - serverZone.absX, - worldVector.y - serverZone.absY, worldVector.z - - serverZone.absZ); + localCoords = new Vector3fImmutable(worldVector.x - zone.absX, + worldVector.y - zone.absY, worldVector.z + - zone.absZ); return localCoords; } public static Vector2f worldToZoneOffset(Vector3fImmutable worldLoc, - Zone serverZone) { + Zone zone) { Vector2f localCoords; Vector2f zoneOrigin; - zoneOrigin = new Vector2f(serverZone.getLoc().x, serverZone.getLoc().z); + zoneOrigin = new Vector2f(zone.getLoc().x, zone.getLoc().z); localCoords = new Vector2f(worldLoc.x, worldLoc.z); localCoords = localCoords.subtract(zoneOrigin); @@ -303,15 +303,15 @@ public enum ZoneManager { } public static Vector2f worldToTerrainSpace(Vector3fImmutable worldLoc, - Zone serverZone) { + Zone zone) { Vector2f localCoords; Vector2f zoneOrigin; // Top left corner of zone is calculated in world space by the center and it's extents. - zoneOrigin = new Vector2f(serverZone.getLoc().x, serverZone.getLoc().z); - zoneOrigin = zoneOrigin.subtract(new Vector2f(serverZone.bounds.getHalfExtents().x, serverZone.bounds.getHalfExtents().y)); + zoneOrigin = new Vector2f(zone.getLoc().x, zone.getLoc().z); + zoneOrigin = zoneOrigin.subtract(new Vector2f(zone.bounds.getHalfExtents().x, zone.bounds.getHalfExtents().y)); // Local coordinate in world space translated to an offset from the calculated zone origin.