Public Member Functions

PolyVox::AStarPathfinder< VolumeType, VoxelType > Class Template Reference

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

#include <AStarPathfinder.h>

Collaboration diagram for PolyVox::AStarPathfinder< VolumeType, VoxelType >:

List of all members.

Public Member Functions

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

Detailed Description

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

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:
AStarPathfinderParams

Definition at line 164 of file AStarPathfinder.h.


Constructor & Destructor Documentation

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

Definition at line 54 of file AStarPathfinder.inl.


Member Function Documentation

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

Definition at line 60 of file AStarPathfinder.inl.


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