Tactics: Western Philosophers Vs. Musicians
0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
|
#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 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 |
A Path is a series of points that can be interpolated.
Path::Path | ( | ) |
|
inline |
|
inline |
|
inline |
void Path::calcDistances | ( | ) |
Calculates distances from point to point and the total distance.
void 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.
|
inline |
|
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) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if the path has changed since the last call to this method.
|
inline |
Point Path::travelPercentOfDist | ( | const float & | percent_ | ) | const |
Point Path::travelPercentOfPoints | ( | const float & | percent_ | ) | const |