PF_API 0.52
Classes | Public Member Functions | Public Attributes

OpenSkyNet::PF::WaypointCollection Class Reference

#include <PFWaypointCollection.h>

List of all members.

Classes

struct  lessThan
struct  WhoGoesWhereDef

Public Member Functions

void loadWPC (const char *wPC_)
Math::Point< int > getWPCBin (const Math::Point<> &pos_) const
bool getWPCBin (const Math::Point<> &pos_, Math::Point< int > &wPCBin_) const
Math::Point< int > getNearestWPCBin (const Math::Point<> &pos_) const
Math::Point< int > getWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
bool getWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_, Math::Point< int > &wPCBin_) const
Math::Point< int > getNearestWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
int getWGWDIndex (Math::Point< int > &drivBin_, Math::Point< int > &targBin_, const CD::Grid *grid_) const
int getWGWDIndex (const Math::Point<> &drivPos_, const Math::Point<> &targPos_) const
void getPath (int wGWDIndex_, const Math::Point<> &drivPos_, const Math::Point<> &targPos_, Math::Path &path_) const
const Math::PointgetMaxCorner () const
void translate (const Math::Point<> &delta_)
const Math::PointgetSize () const
const Math::Point< Utils::uint > & getAxisDivs () const
const Math::PointgetBinSize () const
void loadWPC (const char *wPC_)
Math::Point< int > getWPCBin (const Math::Point<> &pos_) const
bool getWPCBin (const Math::Point<> &pos_, Math::Point< int > &wPCBin_) const
Math::Point< int > getNearestWPCBin (const Math::Point<> &pos_) const
Math::Point< int > getWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
bool getWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_, Math::Point< int > &wPCBin_) const
Math::Point< int > getNearestWPCBin (const Math::Point< int > &gridBin_, const CD::Grid *grid_) const
int getWGWDIndex (Math::Point< int > &drivBin_, Math::Point< int > &targBin_, const CD::Grid *grid_) const
int getWGWDIndex (const Math::Point<> &drivPos_, const Math::Point<> &targPos_) const
void getPath (int wGWDIndex_, const Math::Point<> &drivPos_, const Math::Point<> &targPos_, Math::Path &path_) const
const Math::PointgetMaxCorner () const
void translate (const Math::Point<> &delta_)
const Math::PointgetSize () const
const Math::Point< Utils::uint > & getAxisDivs () const
const Math::PointgetBinSize () const

Public Attributes

std::vector< WhoGoesWhereDef * > _defs

Detailed Description

A WaypointCollection can be used to describe large sets of complex hardcoded paths with minimal notation. Sets of CD::Grid bins map to other bin sets. After a driver and target are determined to occupy specific bins, a bin-bin mapping is searched for in the WaypointCollection. If one is found, then a path getting from the driver to the target is returned (these paths are determined offline).

Todo:
A WaypointCollection is currently translatable, but not rotatable.

A WaypointCollection can be used to describe large sets of complex hardcoded paths with minimal notation. Sets of CD::Grid bins map to other bin sets. After a driver and target are determined to occupy specific bins, a bin-bin mapping is searched for in the WaypointCollection. If one is found, then a path getting from the driver to the target is returned (these paths are determined offline).

Todo:
A WaypointCollection is currently translatable, but not rotatable.

Member Function Documentation

const Math::Point<Utils::uint>& OpenSkyNet::PF::WaypointCollection::getAxisDivs ( ) const [inline]

Returns the # of divisions of each axis for the WPC grid.

const Math::Point<Utils::uint>& OpenSkyNet::PF::WaypointCollection::getAxisDivs ( ) const [inline]

Returns the # of divisions of each axis for the WPC grid.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getBinSize ( ) const [inline]

Returns the bin size (the spatial distance between axis divisions) for each axis of the WPC grid.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getBinSize ( ) const [inline]

Returns the bin size (the spatial distance between axis divisions) for each axis of the WPC grid.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getMaxCorner ( ) const [inline]

Returns the max x, max y, and max z relative to the WPC grid.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getMaxCorner ( ) const [inline]

Returns the max x, max y, and max z relative to the WPC grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getNearestWPCBin ( const Math::Point<> &  pos_) const [inline]

Gets the WPC grid's bin nearest a given point.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getNearestWPCBin ( const Math::Point<> &  pos_) const [inline]

Gets the WPC grid's bin nearest a given point.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getNearestWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_ 
) const [inline]

Gets the WPC grid's bin nearest the center of a bin in another grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getNearestWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_ 
) const [inline]

Gets the WPC grid's bin nearest the center of a bin in another grid.

void OpenSkyNet::PF::WaypointCollection::getPath ( int  wGWDIndex_,
const Math::Point<> &  drivPos_,
const Math::Point<> &  targPos_,
Math::Path path_ 
) const

Sets the "out" path_ parameter to a path from drivPos_ to targPos_ using the waypoints defined by the wGWDIndex_.

void OpenSkyNet::PF::WaypointCollection::getPath ( int  wGWDIndex_,
const Math::Point<> &  drivPos_,
const Math::Point<> &  targPos_,
Math::Path path_ 
) const

Sets the "out" path_ parameter to a path from drivPos_ to targPos_ using the waypoints defined by the wGWDIndex_.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getSize ( ) const [inline]

Returns the WPC grid's size.

const Math::Point& OpenSkyNet::PF::WaypointCollection::getSize ( ) const [inline]

Returns the WPC grid's size.

int OpenSkyNet::PF::WaypointCollection::getWGWDIndex ( const Math::Point<> &  drivPos_,
const Math::Point<> &  targPos_ 
) const

Returns -1 if no WGWD found.

int OpenSkyNet::PF::WaypointCollection::getWGWDIndex ( const Math::Point<> &  drivPos_,
const Math::Point<> &  targPos_ 
) const

Returns -1 if no WGWD found.

int OpenSkyNet::PF::WaypointCollection::getWGWDIndex ( Math::Point< int > &  drivBin_,
Math::Point< int > &  targBin_,
const CD::Grid grid_ 
) const

Input drivBin_/targBin_ are the grid_ bins; they are the WPC bins after the function returns. Returns -1 if no WGWD found.

int OpenSkyNet::PF::WaypointCollection::getWGWDIndex ( Math::Point< int > &  drivBin_,
Math::Point< int > &  targBin_,
const CD::Grid grid_ 
) const

Input drivBin_/targBin_ are the grid_ bins; they are the WPC bins after the function returns. Returns -1 if no WGWD found.

bool OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point<> &  pos_,
Math::Point< int > &  wPCBin_ 
) const [inline]

Gets the WPC grid's bin given a point. Returns false if the point lies outside the grid.

bool OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_,
Math::Point< int > &  wPCBin_ 
) const [inline]

Gets the WPC grid's bin for the center of a bin in another grid. Returns false if the supplied bin's center lies outside the WPC grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point<> &  pos_) const [inline]

Gets the WPC grid's bin given a point. The components will be out of range ( < 0 or > max dimension size ) if the point lies outside the grid.

bool OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_,
Math::Point< int > &  wPCBin_ 
) const [inline]

Gets the WPC grid's bin for the center of a bin in another grid. Returns false if the supplied bin's center lies outside the WPC grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_ 
) const [inline]

Gets the WPC grid's bin for the center of a bin in another grid. The components will be out of range ( < 0 or > max dimension size ) if the supplied bin's center lies outside the WPC grid.

bool OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point<> &  pos_,
Math::Point< int > &  wPCBin_ 
) const [inline]

Gets the WPC grid's bin given a point. Returns false if the point lies outside the grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point<> &  pos_) const [inline]

Gets the WPC grid's bin given a point. The components will be out of range ( < 0 or > max dimension size ) if the point lies outside the grid.

Math::Point<int> OpenSkyNet::PF::WaypointCollection::getWPCBin ( const Math::Point< int > &  gridBin_,
const CD::Grid grid_ 
) const [inline]

Gets the WPC grid's bin for the center of a bin in another grid. The components will be out of range ( < 0 or > max dimension size ) if the supplied bin's center lies outside the WPC grid.

void OpenSkyNet::PF::WaypointCollection::loadWPC ( const char *  wPC_)

Load a *.wpc.xml file

void OpenSkyNet::PF::WaypointCollection::loadWPC ( const char *  wPC_)

Load a *.wpc.xml file

void OpenSkyNet::PF::WaypointCollection::translate ( const Math::Point<> &  delta_) [inline]

Translate the WPC grid.

void OpenSkyNet::PF::WaypointCollection::translate ( const Math::Point<> &  delta_) [inline]

Translate the WPC grid.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines