|
||||||||||
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.NavMesh
public class NavMesh
A nav-mesh is a set of shapes that describe the navigation of a map. These shapes are linked together allow path finding but without the high resolution that tile maps require. This leads to fast path finding and potentially much more accurate map definition.
Constructor Summary | |
---|---|
NavMesh()
Create a new empty mesh |
|
NavMesh(java.util.ArrayList spaces)
Create a new mesh with a set of spaces |
Method Summary | |
---|---|
void |
addSpace(Space space)
Add a single space to the mesh |
NavPath |
findPath(float sx,
float sy,
float tx,
float ty,
boolean optimize)
Find a path from the source to the target coordinates |
Space |
findSpace(float x,
float y)
Find the space at a given location |
Space |
getSpace(int index)
Get the space at a given index |
int |
getSpaceCount()
Get the number of spaces that are in the mesh |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NavMesh()
public NavMesh(java.util.ArrayList spaces)
spaces
- The spaces included in the meshMethod Detail |
---|
public int getSpaceCount()
public Space getSpace(int index)
index
- The index of the space to retrieve
public void addSpace(Space space)
space
- The space to be addedpublic Space findSpace(float x, float y)
x
- The x coordinate at which to find the spacey
- The y coordinate at which to find the space
public NavPath findPath(float sx, float sy, float tx, float ty, boolean optimize)
sx
- The x coordinate of the source locationsy
- The y coordinate of the source locationtx
- The x coordinate of the target locationty
- The y coordinate of the target locationoptimize
- True if paths should be optimized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |