|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.util.pathfinding.navmesh.Space
public class Space
A quad space within a navigation mesh
Constructor Summary | |
---|---|
Space(float x,
float y,
float width,
float height)
Create a new space |
Method Summary | |
---|---|
boolean |
canMerge(Space other)
Check if the given space can be merged with this one. |
void |
clearCost()
Clear the costing values across the whole map |
boolean |
contains(float xp,
float yp)
Check if this space contains a given point |
void |
fill(Space target,
float sx,
float sy,
float cost)
Fill the spaces based on the cost from a given starting point |
float |
getCost()
Get the cost to get to this node at the moment |
float |
getHeight()
Get the height of the space |
Link |
getLink(int index)
Get the link from this space to another at a particular index |
int |
getLinkCount()
Get the number of links |
float |
getWidth()
Get the width of the space |
float |
getX()
Get the x coordinate of the top corner of the space |
float |
getY()
Get the y coordinate of the top corner of the space |
boolean |
hasJoinedEdge(Space other)
Check if this space has an edge that is joined with another |
void |
link(Space other)
Link this space to another by creating a link and finding the point at which the spaces link up |
Space |
merge(Space other)
Merge this space with another |
boolean |
pickLowestCost(Space target,
NavPath path)
Pick the lowest cost route from this space to another on the path |
java.lang.String |
toString()
Get the string representation of this instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Space(float x, float y, float width, float height)
x
- The x coordinate of the top corner of the spacey
- The y coordinate of the top corner of the spacewidth
- The width of the spaceheight
- The height of the spaceMethod Detail |
---|
public float getWidth()
public float getHeight()
public float getX()
public float getY()
public void link(Space other)
other
- The other space to link topublic boolean hasJoinedEdge(Space other)
other
- The other space to check against
public Space merge(Space other)
other
- The other space to merge with
public boolean canMerge(Space other)
other
- The other space to be considered
public int getLinkCount()
public Link getLink(int index)
index
- The index of the link to retrieve
public boolean contains(float xp, float yp)
xp
- The x coordinate to checkyp
- The y coordinate to check
public void fill(Space target, float sx, float sy, float cost)
target
- The target space we're heading forsx
- The x coordinate of the starting pointsy
- The y coordinate of the starting pointcost
- The cost up to this pointpublic void clearCost()
public float getCost()
public boolean pickLowestCost(Space target, NavPath path)
target
- The target space we're looking forpath
- The path to add the steps to
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |