|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.path.AStarNode
com.brackeen.javagamebook.bsp2D.Portal
A Portal represents a passable divider between two leaves in a BSP tree (think: entryway between rooms). The Portal class is also an AStarNode, so AI creatures can use the A* algorithm to find paths throughout the BSP tree.
Constructor Summary | |
Portal(BSPLine divider,
BSPTree.Leaf front,
BSPTree.Leaf back)
Create a new Portal with the specified divider and front/ back leaves. |
Method Summary | |
void |
addNeighbor(AStarNode node)
Adds a neighbor node to the list of neighbors. |
void |
buildNeighborList()
Builds the list of neighbors for the AStarNode representation. |
float |
getCost(AStarNode node)
Gets the cost between this node and the specified adjacent (aka "neighbor" or "child") node. |
float |
getEstimatedCost(AStarNode node)
Gets the estimated cost between this node and the specified node. |
Vector3D |
getMidPoint()
Gets the mid-point along this Portal's divider. |
java.util.List |
getNeighbors()
Gets the children (aka "neighbors" or "adjacent nodes") of this node. |
void |
removeNeighbor(AStarNode node)
Removes a neighbor node to the list of neighbors. |
Methods inherited from class com.brackeen.javagamebook.path.AStarNode |
compareTo, getCost |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Portal(BSPLine divider, BSPTree.Leaf front, BSPTree.Leaf back)
Method Detail |
public Vector3D getMidPoint()
public void buildNeighborList()
public void addNeighbor(AStarNode node)
public void removeNeighbor(AStarNode node)
public float getCost(AStarNode node)
AStarNode
getCost
in class AStarNode
public float getEstimatedCost(AStarNode node)
AStarNode
getEstimatedCost
in class AStarNode
public java.util.List getNeighbors()
AStarNode
getNeighbors
in class AStarNode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |