|
|
|
@ -298,8 +298,6 @@ public enum ZoneManager {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -360,8 +357,6 @@ public enum ZoneManager {
|
|
|
|
|
public static City getCityAtLocation(Vector3fImmutable worldLoc) { |
|
|
|
|
|
|
|
|
|
Zone currentZone; |
|
|
|
|
ArrayList<Zone> zoneList; |
|
|
|
|
City city; |
|
|
|
|
|
|
|
|
|
currentZone = ZoneManager.findSmallestZone(worldLoc); |
|
|
|
|
|
|
|
|
@ -408,27 +403,27 @@ public enum ZoneManager {
@@ -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) { |
|
|
|
|