Steeriously  0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
steer::Path Class Reference

Class providing the necessary structure for path following behavior. More...

#include <Path.hpp>

Public Member Functions

 Path ()
 Default constructor.
 
 Path (int NumWaypoints, std::list< steer::Vector2 > &waypoints)
 Constructor used for creating a path from a list of waypoints.
 
 Path (int NumWaypoints, float MinX, float MinY, float MaxX, float MaxY, bool looped)
 Constructor for creating a path with initial random waypoints. MinX/Y & MaxX/Y define the bounding box of the path.
 
 ~Path ()
 Destructor.
 
steer::Vector2 currentWaypoint () const
 Returns the current waypoint.
 
bool finished ()
 Returns true if the end of the list has been reached.
 
void setNextWaypoint ()
 Moves the iterator on to the next waypoint in the list.
 
std::list< steer::Vector2createRandomPath (int NumWaypoints, float MinX, float MinY, float MaxX, float MaxY)
 Creates a random path which is bound by rectangle described by the min/max values.
 
void loopOn ()
 Turn on the loop option for the path so the path meets the first waypoint.
 
void loopOff ()
 Turn off the loop option for the path so the path ends on the last waypoint.
 
void set (std::list< steer::Vector2 > newPath)
 Method for setting the path with list of vectors.
 
void set (const Path &path)
 Method for setting the path with a previously defined Path.
 
void clear ()
 Clears all waypoints in the path std::vector.
 
std::list< steer::Vector2getPath () const
 Returns the std::vector of waypoints in the path.
 

Detailed Description

Class providing the necessary structure for path following behavior.

Constructor & Destructor Documentation

steer::Path::Path ( int  NumWaypoints,
std::list< steer::Vector2 > &  waypoints 
)

Constructor used for creating a path from a list of waypoints.

Parameters
NumWaypoints- a plain old int.
waypoints- a std::list of steer::Vector2.
steer::Path::Path ( int  NumWaypoints,
float  MinX,
float  MinY,
float  MaxX,
float  MaxY,
bool  looped 
)

Constructor for creating a path with initial random waypoints. MinX/Y & MaxX/Y define the bounding box of the path.

Parameters
NumWaypoints- a plain old int.
MinX- a plain old float.
MinY- a plain old float.
MaxX- a plain old float.
MaxY- a plain old float.
looped- a plain old bool.

Member Function Documentation

std::list< Vector2 > steer::Path::createRandomPath ( int  NumWaypoints,
float  MinX,
float  MinY,
float  MaxX,
float  MaxY 
)

Creates a random path which is bound by rectangle described by the min/max values.

Parameters
NumWaypoints- a plain old int.
MinX- a plain old float.
MinY- a plain old float.
MaxX- a plain old float.
MaxY- a plain old float.
void steer::Path::set ( std::list< steer::Vector2 newPath)
inline

Method for setting the path with list of vectors.

Parameters
newPath- a std::vector of steer::Vector2 floats.
steer::Path::set ( const Path path)
inline

Method for setting the path with a previously defined Path.

Parameters
path- a steer::Path object.

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