PolyVox  0.2.1
Open source voxel management library
Public Member Functions
PolyVox::AStarPathfinder< VolumeType > Class Template Reference

The AStarPathfinder compute a path from one point in the volume to another. More...

#include <AStarPathfinder.h>

List of all members.

Public Member Functions

 AStarPathfinder (const AStarPathfinderParams< VolumeType > &params)
void execute ()

Detailed Description

template<typename VolumeType>
class PolyVox::AStarPathfinder< VolumeType >

The AStarPathfinder compute a path from one point in the volume to another.

A* is a well known pathfinding algorithm commonly used in computer games. It takes as input a pair of points in the world, and works out a path between them which avoids obstacles and adheres to other user defined criteria. The resulting path is usually the shortest possible, but a less optimal path can be exchanged for reduced computation time.

For an excellent overview of the A* algorithm please see Amit Patel's Game Programming page here: http://theory.stanford.edu/~amitp/GameProgramming/ Much of this class is based on the principles described in those pages.

Usage of this class if very strightforward. You create an instance of it by passing an instance of the AStarPathfinderParams structure to the constructor. The details of the AStarPathfinderParams and the options it provides are described in the documentation for that class.

Next you call the execute() function and wait for it to return. If a path is found then this is stored in the list which was set as the 'result' field of the AStarPathfinderParams. If a path cannot be found then an exception of type std::runtime_error is thrown.

See also:

Definition at line 164 of file AStarPathfinder.h.

Constructor & Destructor Documentation

template<typename VolumeType >
PolyVox::AStarPathfinder< VolumeType >::AStarPathfinder ( const AStarPathfinderParams< VolumeType > &  params)

Definition at line 47 of file AStarPathfinder.inl.

Member Function Documentation

template<typename VolumeType >
void PolyVox::AStarPathfinder< VolumeType >::execute ( )

Definition at line 53 of file AStarPathfinder.inl.

The documentation for this class was generated from the following files: