|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme3tools.navigation.MapModel3D
public class MapModel3D
A representation of the actual map in terms of lat/long and x,y,z co-ordinates. The Map class contains various helper methods such as methods for determining the world unit positions for lat/long coordinates and vice versa. This map projection does not handle screen/pixel coordinates.
Field Summary | |
---|---|
static int |
DEFAULT_MAP_WIDTH_LONGITUDE
|
Constructor Summary | |
---|---|
MapModel3D(int worldWidth)
Constructor. |
Method Summary | |
---|---|
void |
calculateMinutesPerWorldUnit(double mapWidthInLongitude)
Calculates the number of minutes per pixels using a given map width in longitude. |
Position |
getCentre()
Returns the Position centre of the map. |
Vector3f |
getCentreWu()
Returns the WU (x,y,z) centre of the map. |
double |
getMetersPerWu()
Returns the meters per WU. |
double |
getMinutesPerWu()
Returns the number of minutes there are per WU. |
int |
getWorldHeight()
Returns the height of the viewport in pixels. |
int |
getWorldWidth()
Returns the width of the viewport in pixels. |
void |
setCentre(Position centre)
Sets the map's centre. |
void |
setCentre(Vector3f posVec)
Defines the centre of the map in pixels. |
void |
setWorldHeight(int viewportHeight)
Sets the world's desired height. |
void |
setWorldWidth(int viewportWidth)
Sets the world's desired width. |
Position |
toPosition(Vector3f posVec)
Converts a world position into a Mercator position. |
Vector3f |
toWorldUnit(Position position)
Converts a latitude/longitude position into a WU coordinate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAP_WIDTH_LONGITUDE
Constructor Detail |
---|
public MapModel3D(int worldWidth)
worldWidth
- The world unit width the map's areaMethod Detail |
---|
public int getWorldHeight()
public void calculateMinutesPerWorldUnit(double mapWidthInLongitude)
mapWidthInLongitude
- The map's with in degrees of longitude.public int getWorldWidth()
public void setWorldWidth(int viewportWidth)
viewportWidth
- The world's desired width in WU.public void setWorldHeight(int viewportHeight)
viewportHeight
- The world's desired height in WU.public void setCentre(Position centre)
centre
- The Position
denoting the map's
desired centre.public double getMinutesPerWu()
public double getMetersPerWu()
public Vector3f toWorldUnit(Position position)
position
- The Position
to convert.
Point
a pixel coordinate.public Position toPosition(Vector3f posVec)
posVec
- Vector
containing the world unit
coordinates that are to be converted into
longitude / latitude coordinates.
Position
in degrees of
latitude and longitude.public void setCentre(Vector3f posVec)
posVec
- Vector3f
object denoting the map's new centre.public Vector3f getCentreWu()
Vector3f
object marking the map's (x,y) centre.public Position getCentre()
Position
centre of the map.
Position
object marking the map's (lat, long)
centre.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |