|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NavigationMesh
A navigation mesh is a set of nodes covering a map area which represent branching pathways for the vehicle to move from one location to another. This interface is used by classes which build navigation meshes.
Method Summary | |
---|---|
int |
addNode(Node node,
int neighbors)
Adds a node to this set and connects it with a number of neighboring nodes. |
boolean |
connect(Node node1,
Node node2)
Attempts to connect two nodes together by adding them as neighbors. |
boolean |
disconnect(Node node1,
Node node2)
Disconnects two nodes by removing them as neighbors. |
Collection<Node> |
getMesh()
Returns a collection of all nodes within this navigation mesh. |
void |
regenerate()
Throws away the previous set of nodes and recalculates them all. |
boolean |
removeNode(Node node)
Removes a node from the set and removes any existing connections with its neighbors. |
Method Detail |
---|
int addNode(Node node, int neighbors)
node
- The unconnected node to add to this mesh. Will be connected with others in the set.neighbors
- The maximum number of neighbors to attempt to connect with.
boolean removeNode(Node node)
node
- The node to remove.
boolean connect(Node node1, Node node2)
node1
- node2
-
boolean disconnect(Node node1, Node node2)
node1
- node2
-
Collection<Node> getMesh()
void regenerate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |