Class Land
raft.kilavuz.runtime.Land All Implemented Interfaces:
-
public class Land
runtime pathfinding information
Nested Class Summary |
|
|
|
Land.Portalline of (generally) border cells which leads to same sector with same action. |
|
Land.Sectora rectangular region which is freely traversable with simple steps |
Constructor Summary |
Land(Grid grid)creates Land using information in Grid |
Method Summary |
|
|
|
getOrigin()returns origin, first cell 0,0 at world space |
|
|
|
getPoint(float x, float y, float z)returns point in grid space, or null if no sector contains the point. |
|
getPortal(int portalId)return sector with given id or null of there is no such sector |
|
getPortals()returns an unmodifiable view of sectors |
|
getSector(int sectorId)return sector with given id or null of there is no such sector |
|
getSectors()returns an unmodifiable view of sectors |
|
|
|
|
|
|
|
|
|
|
Field Detail
SAME_ELEVATION_LIMIT
public static float SAME_ELEVATION_LIMIT
-
ratio to cellHeight to consider two cells at same elevation.
sectors store elevations at cell positions as a float array.
to save memory if all sector is at same elevation only a single value is stored.
default value is 1/20
See Also:
-
DEFAULT_TERRAIN
public static final short DEFAULT_TERRAIN
-
default terrain
ACTION_NONE
public static final short ACTION_NONE
-
no action required
ACTION_JUMP
public static final short ACTION_JUMP
-
jump action
ACTION_FALLDOWN
public static final short ACTION_FALLDOWN
-
fall dwon action
cellWidth
public final float cellWidth
-
width of a cell
cellHeight
public final float cellHeight
-
height of a cell
Constructor Detail
Land
-
creates Land using information in Grid
Method Detail
getPoint
-
returns point in grid space, or null if no sector contains the point.
given coordinates are in world space
Parameters:
-
v - location in world space
getPoint
public Land.Point getPoint(float x, float y, float z) -
returns point in grid space, or null if no sector contains the point.
given coordinates are in world space
Parameters:
-
x - coordinate in world space
-
y - coordinate in world space
-
z - coordinate in world space
getOrigin
-
returns origin, first cell 0,0 at world space
getLocation
-
returns the location in world space
getSector
-
return sector with given id or null of there is no such sector
getSectors
-
returns an unmodifiable view of sectors
getPortal
-
return sector with given id or null of there is no such sector
getPortals
-
returns an unmodifiable view of sectors
setUserObject
public void setUserObject(Object userObject) -
sets user defined object.
use when you want to store additional information about this Land.
note given object is also serialized when Land is serialized
Parameters:
-
userObject - user object, null to clear user object
-
See Also:
-
getUserObject
-
returns user defined object
-
See Also:
-
setPenalties
-
sets penalties for costs of portals of specific actions.
setting to null clears all penalties.
this method re-calculates portal costs if necessary
saveToStream
-
serializes this Land to stream and closes stream
-
Throws:
-
loadFromStream
-
loads Land from serialized stream and closes stream
-
Throws:
-
-
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc. If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com