mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 03:05:28 +01:00
Add compassazimuth to perspectives (oveeride for compass orientation)
and 'oldnorth' perspective
This commit is contained in:
parent
0c34d5a5b5
commit
1093da7657
@ -8,7 +8,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
import org.dynmap.Client;
|
import org.dynmap.Client;
|
||||||
import org.dynmap.Color;
|
import org.dynmap.Color;
|
||||||
@ -28,7 +27,6 @@ import org.dynmap.renderer.RenderPatchFactory.SideVisible;
|
|||||||
import org.dynmap.storage.MapStorage;
|
import org.dynmap.storage.MapStorage;
|
||||||
import org.dynmap.storage.MapStorageTile;
|
import org.dynmap.storage.MapStorageTile;
|
||||||
import org.dynmap.utils.BlockStep;
|
import org.dynmap.utils.BlockStep;
|
||||||
import org.dynmap.utils.DynIntHashMap;
|
|
||||||
import org.dynmap.hdmap.TexturePack.BlockTransparency;
|
import org.dynmap.hdmap.TexturePack.BlockTransparency;
|
||||||
import org.dynmap.utils.DynmapBufferedImage;
|
import org.dynmap.utils.DynmapBufferedImage;
|
||||||
import org.dynmap.utils.LightLevels;
|
import org.dynmap.utils.LightLevels;
|
||||||
@ -47,6 +45,7 @@ public class IsoHDPerspective implements HDPerspective {
|
|||||||
private final int hashcode;
|
private final int hashcode;
|
||||||
/* View angles */
|
/* View angles */
|
||||||
public final double azimuth; /* Angle in degrees from looking north (0), east (90), south (180), or west (270) */
|
public final double azimuth; /* Angle in degrees from looking north (0), east (90), south (180), or west (270) */
|
||||||
|
public final double compassazimuth; // Angle in degrees from looking north (0), east (90), for the compass (default same as azimuth)
|
||||||
public final double inclination; /* Angle in degrees from horizontal (0) to vertical (90) */
|
public final double inclination; /* Angle in degrees from horizontal (0) to vertical (90) */
|
||||||
public final double maxheight;
|
public final double maxheight;
|
||||||
public final double minheight;
|
public final double minheight;
|
||||||
@ -988,10 +987,17 @@ public class IsoHDPerspective implements HDPerspective {
|
|||||||
hashcode = name.hashCode();
|
hashcode = name.hashCode();
|
||||||
}
|
}
|
||||||
double az = 90.0 + configuration.getDouble("azimuth", 135.0); /* Get azimuth (default to classic kzed POV) */
|
double az = 90.0 + configuration.getDouble("azimuth", 135.0); /* Get azimuth (default to classic kzed POV) */
|
||||||
if(az >= 360.0) {
|
if (az >= 360.0) {
|
||||||
az = az - 360.0;
|
az = az - 360.0;
|
||||||
}
|
}
|
||||||
azimuth = az;
|
azimuth = az;
|
||||||
|
// Get compass azimuth - default to same as true azimuth, but allows for override
|
||||||
|
az = 90.0 + configuration.getDouble("compassazimuth", az - 90.0); /* Get azimuth (default to classic kzed POV) */
|
||||||
|
if (az >= 360.0) {
|
||||||
|
az = az - 360.0;
|
||||||
|
}
|
||||||
|
compassazimuth = az;
|
||||||
|
|
||||||
double inc;
|
double inc;
|
||||||
inc = configuration.getDouble("inclination", 60.0);
|
inc = configuration.getDouble("inclination", 60.0);
|
||||||
if(inc > MAX_INCLINATION) inc = MAX_INCLINATION;
|
if(inc > MAX_INCLINATION) inc = MAX_INCLINATION;
|
||||||
@ -1436,7 +1442,7 @@ public class IsoHDPerspective implements HDPerspective {
|
|||||||
s(mapObject, "scale", basemodscale);
|
s(mapObject, "scale", basemodscale);
|
||||||
s(mapObject, "worldtomap", world_to_map.toJSON());
|
s(mapObject, "worldtomap", world_to_map.toJSON());
|
||||||
s(mapObject, "maptoworld", map_to_world.toJSON());
|
s(mapObject, "maptoworld", map_to_world.toJSON());
|
||||||
int dir = (((360 + (int)(22.5+azimuth)) / 45) + 6) % 8;
|
int dir = (((360 + (int)(22.5+compassazimuth)) / 45) + 6) % 8;
|
||||||
s(mapObject, "compassview", directions[dir]);
|
s(mapObject, "compassview", directions[dir]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,4 +498,12 @@ perspectives:
|
|||||||
azimuth: 270
|
azimuth: 270
|
||||||
inclination: 90
|
inclination: 90
|
||||||
scale: 16
|
scale: 16
|
||||||
|
|
||||||
|
# Old style compass (sun rise in the North...)
|
||||||
|
- class: org.dynmap.hdmap.IsoHDPerspective
|
||||||
|
name: oldnorth
|
||||||
|
azimuth: 0
|
||||||
|
compassazimuth: 90
|
||||||
|
inclination: 90
|
||||||
|
scale: 4
|
||||||
|
|
Loading…
Reference in New Issue
Block a user