com.brackeen.javagamebook.path
Class AStarSearchWithBSP

java.lang.Object
  extended bycom.brackeen.javagamebook.path.AStarSearch
      extended bycom.brackeen.javagamebook.path.AStarSearchWithBSP
All Implemented Interfaces:
PathFinder

public class AStarSearchWithBSP
extends AStarSearch
implements PathFinder

The AStarSearchWithBSP class is a PathFinder that finds a path in a BSP tree using an A* search algorithm.


Nested Class Summary
static class AStarSearchWithBSP.LeafNode
          The LeafNode class is an AStarNode that repesents a location in a leaf of a BSP tree.
 
Nested classes inherited from class com.brackeen.javagamebook.path.AStarSearch
AStarSearch.PriorityList
 
Constructor Summary
AStarSearchWithBSP(BSPTree bspTree)
          Creates a new AStarSearchWithBSP for the specified BSP tree.
 
Method Summary
 java.util.Iterator find(GameObject a, GameObject b)
          Finds a path from GameObject A to GameObject B.
 java.util.Iterator find(Vector3D start, Vector3D goal)
          Finds a path from the start location to the goal location.
 void setBSPTree(BSPTree bspTree)
           
 java.lang.String toString()
           
 
Methods inherited from class com.brackeen.javagamebook.path.AStarSearch
findPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AStarSearchWithBSP

public AStarSearchWithBSP(BSPTree bspTree)
Creates a new AStarSearchWithBSP for the specified BSP tree.

Method Detail

setBSPTree

public void setBSPTree(BSPTree bspTree)

find

public java.util.Iterator find(GameObject a,
                               GameObject b)
Description copied from interface: PathFinder
Finds a path from GameObject A to GameObject B. The path is an Iterator of Vector3Ds, not including the start location (GameObject A) but including the goal location (GameObject B). The Vector3D objects may be used in other objects and should not be modified. Returns null if no path found.

Specified by:
find in interface PathFinder

find

public java.util.Iterator find(Vector3D start,
                               Vector3D goal)
Description copied from interface: PathFinder
Finds a path from the start location to the goal location. The path is an Iterator of Vector3Ds, not including the start location, but including the goal location. The Vector3D objects may be used in other objects and should not be modified. Returns null if no path found.

Specified by:
find in interface PathFinder

toString

public java.lang.String toString()