PF_API 0.52
|
#include <MPath.h>
Public Member Functions | |
Path () | |
Utils::uint | getNumPoints () const |
std::vector< Math::Point<> > & | getPoints () |
const std::vector< Math::Point<> > & | getPoints () const |
Utils::uint | addAPoint (const Math::Point<> &aPoint_) |
Utils::uint | addAPoint (float x_, float y_, float z_) |
Utils::uint | appendPath (const Path &path_) |
void | clear () |
bool | isPathChanged () |
void | translate (const Math::Point<> &p_) |
void | calcNaturalCubicSpline (float minDistanceBetweenPoints_=1.0, Utils::uint maxTotalPoints_=0, float tension_=0.0f) |
void | calcDistances () |
float | getTotalDist () const |
float | getAdditiveFromSpeed (float speed_) const |
Path () | |
Utils::uint | getNumPoints () const |
std::vector< Math::Point<> > & | getPoints () |
const std::vector< Math::Point<> > & | getPoints () const |
Utils::uint | addAPoint (const Math::Point<> &aPoint_) |
Utils::uint | addAPoint (float x_, float y_, float z_) |
Utils::uint | appendPath (const Path &path_) |
void | clear () |
bool | isPathChanged () |
void | translate (const Math::Point<> &p_) |
void | calcNaturalCubicSpline (float minDistanceBetweenPoints_=1.0, Utils::uint maxTotalPoints_=0, float tension_=0.0f) |
void | calcDistances () |
float | getTotalDist () const |
float | getAdditiveFromSpeed (float speed_) const |
Path Interpolation | |
Returns an interpolated point along the path by a percentage of the number of stored points or the total distance. The two methods will return the same result if all stored points are equidistant from their neighbor. | |
Math::Point | travelPercentOfPoints (const float &percent_) const |
Math::Point | travelPercentOfDist (const float &percent_) const |
Math::Point | travelPercentOfPoints (const float &percent_) const |
Math::Point | travelPercentOfDist (const float &percent_) const |
A Path is a series of points that can be interpolated.
OpenSkyNet::Math::Path::Path | ( | ) |
Path::Path | ( | ) |
Utils::uint OpenSkyNet::Math::Path::addAPoint | ( | const Math::Point<> & | aPoint_ | ) | [inline] |
Utils::uint OpenSkyNet::Math::Path::addAPoint | ( | float | x_, |
float | y_, | ||
float | z_ | ||
) | [inline] |
Utils::uint OpenSkyNet::Math::Path::addAPoint | ( | const Math::Point<> & | aPoint_ | ) | [inline] |
Utils::uint OpenSkyNet::Math::Path::addAPoint | ( | float | x_, |
float | y_, | ||
float | z_ | ||
) | [inline] |
Utils::uint OpenSkyNet::Math::Path::appendPath | ( | const Path & | path_ | ) | [inline] |
Utils::uint OpenSkyNet::Math::Path::appendPath | ( | const Path & | path_ | ) | [inline] |
void OpenSkyNet::Math::Path::calcDistances | ( | ) |
Calculates distances from point to point and the total distance.
void Path::calcDistances | ( | ) |
Calculates distances from point to point and the total distance.
void OpenSkyNet::Math::Path::calcNaturalCubicSpline | ( | float | minDistanceBetweenPoints_ = 1.0 , |
Utils::uint | maxTotalPoints_ = 0 , |
||
float | tension_ = 0.0f |
||
) |
Creates a natural cubic spline from the path. The number of subdivisions is limited by the total number of points in the path and/or the points' density. One of the first two parameters can be zero, meaning that condition is not checked. This method is NOT safe for multiple simultaneous accesses because it uses static local variables. Precondition: There are at least two points in the path.
void OpenSkyNet::Math::Path::calcNaturalCubicSpline | ( | float | minDistanceBetweenPoints_ = 1.0 , |
Utils::uint | maxTotalPoints_ = 0 , |
||
float | tension_ = 0.0f |
||
) |
Creates a natural cubic spline from the path. The number of subdivisions is limited by the total number of points in the path and/or the points' density. One of the first two parameters can be zero, meaning that condition is not checked. This method is NOT safe for multiple simultaneous accesses because it uses static local variables. Precondition: There are at least two points in the path.
void OpenSkyNet::Math::Path::clear | ( | ) | [inline] |
void OpenSkyNet::Math::Path::clear | ( | ) | [inline] |
float OpenSkyNet::Math::Path::getAdditiveFromSpeed | ( | float | speed_ | ) | const [inline] |
Returns the percent needed to interpolate per update interval. Put another way, it's the amount added to an Interpolator instance.
speed_ | = distance step / time step (i.e. interpolator update interval) |
float OpenSkyNet::Math::Path::getAdditiveFromSpeed | ( | float | speed_ | ) | const [inline] |
Returns the percent needed to interpolate per update interval. Put another way, it's the amount added to an Interpolator instance.
speed_ | = distance step / time step (i.e. interpolator update interval) |
Utils::uint OpenSkyNet::Math::Path::getNumPoints | ( | ) | const [inline] |
Utils::uint OpenSkyNet::Math::Path::getNumPoints | ( | ) | const [inline] |
std::vector<Math::Point<> >& OpenSkyNet::Math::Path::getPoints | ( | ) | [inline] |
std::vector<Math::Point<> >& OpenSkyNet::Math::Path::getPoints | ( | ) | [inline] |
const std::vector<Math::Point<> >& OpenSkyNet::Math::Path::getPoints | ( | ) | const [inline] |
const std::vector<Math::Point<> >& OpenSkyNet::Math::Path::getPoints | ( | ) | const [inline] |
float OpenSkyNet::Math::Path::getTotalDist | ( | ) | const [inline] |
float OpenSkyNet::Math::Path::getTotalDist | ( | ) | const [inline] |
bool OpenSkyNet::Math::Path::isPathChanged | ( | ) | [inline] |
Returns true if the path has changed since the last call to this method.
bool OpenSkyNet::Math::Path::isPathChanged | ( | ) | [inline] |
Returns true if the path has changed since the last call to this method.
void OpenSkyNet::Math::Path::translate | ( | const Math::Point<> & | p_ | ) | [inline] |
void OpenSkyNet::Math::Path::translate | ( | const Math::Point<> & | p_ | ) | [inline] |
Math::Point OpenSkyNet::Math::Path::travelPercentOfDist | ( | const float & | percent_ | ) | const |
Math::Point OpenSkyNet::Math::Path::travelPercentOfDist | ( | const float & | percent_ | ) | const |
Math::Point OpenSkyNet::Math::Path::travelPercentOfPoints | ( | const float & | percent_ | ) | const |
Math::Point OpenSkyNet::Math::Path::travelPercentOfPoints | ( | const float & | percent_ | ) | const |