#include <SplinePath.h>
Public Member Functions | |
| SplinePath () | |
| virtual | ~SplinePath () |
| void | generate (std::vector< FixedVector > &inPoints, int resolution=200, int polynomials=3, fixed pointsPerSecond=5) |
| void | draw () |
| void | simulate (fixed frameTime) |
| void | getPathAttrs (FixedVector &position, FixedVector &direction) |
| fixed | getPathTime () |
| void | setPathTime (fixed pathTime) |
| std::vector < FixedVector > & | getControlPoints () |
| std::vector < FixedVector > & | getPathPoints () |
Protected Attributes | |
| std::vector < FixedVector > | controlPoints_ |
| std::vector < FixedVector > | pathPoints_ |
| fixed | pathTime_ |
| fixed | pointsPerSecond_ |
Definition at line 27 of file SplinePath.h.
| SplinePath::SplinePath | ( | ) |
Definition at line 26 of file SplinePath.cpp.
| SplinePath::~SplinePath | ( | ) | [virtual] |
Definition at line 31 of file SplinePath.cpp.
| void SplinePath::generate | ( | std::vector< FixedVector > & | inPoints, | |
| int | resolution = 200, |
|||
| int | polynomials = 3, |
|||
| fixed | pointsPerSecond = 5 | |||
| ) |
Definition at line 35 of file SplinePath.cpp.
References controlPoints_, DIALOG_ASSERT, SplineCurve::generate(), pathPoints_, and pointsPerSecond_.
Referenced by TargetMovementEntrySpline::generate(), and TargetMovementEntryShips::generate().
| void SplinePath::draw | ( | ) |
Definition at line 91 of file SplinePath.cpp.
References FixedVector::asVector(), GLState::BLEND_OFF, controlPoints_, getPathAttrs(), GL_LINE_LOOP, GL_POINTS, glBegin(), glColor3f(), glEnd(), glPointSize(), glVertex3fv(), pathPoints_, and GLState::TEXTURE_OFF.
Referenced by TargetMovementEntrySpline::draw(), and TargetMovementEntryShips::draw().
| void SplinePath::simulate | ( | fixed | frameTime | ) |
Definition at line 51 of file SplinePath.cpp.
References pathTime_.
Referenced by TargetMovementEntrySpline::generate(), TargetMovementEntryShips::generate(), TargetMovementEntrySpline::simulate(), and TargetMovementEntryShips::simulate().
| void SplinePath::getPathAttrs | ( | FixedVector & | position, | |
| FixedVector & | direction | |||
| ) |
Definition at line 56 of file SplinePath.cpp.
References int(), pathPoints_, pathTime_, pointsPerSecond_, and FixedVector::StoreNormalize().
Referenced by draw(), TargetMovementEntrySpline::simulate(), and TargetMovementEntryShips::simulate().
| fixed SplinePath::getPathTime | ( | ) | [inline] |
Definition at line 43 of file SplinePath.h.
References pathTime_.
Referenced by TargetMovementEntrySpline::writeMessage(), and TargetMovementEntryShips::writeMessage().
| void SplinePath::setPathTime | ( | fixed | pathTime | ) | [inline] |
Definition at line 44 of file SplinePath.h.
References pathTime_.
Referenced by TargetMovementEntrySpline::readMessage(), and TargetMovementEntryShips::readMessage().
| std::vector<FixedVector>& SplinePath::getControlPoints | ( | ) | [inline] |
| std::vector<FixedVector>& SplinePath::getPathPoints | ( | ) | [inline] |
std::vector<FixedVector> SplinePath::controlPoints_ [protected] |
Definition at line 50 of file SplinePath.h.
Referenced by draw(), generate(), and getControlPoints().
std::vector<FixedVector> SplinePath::pathPoints_ [protected] |
Definition at line 51 of file SplinePath.h.
Referenced by draw(), generate(), getPathAttrs(), and getPathPoints().
fixed SplinePath::pathTime_ [protected] |
Definition at line 52 of file SplinePath.h.
Referenced by getPathAttrs(), getPathTime(), setPathTime(), and simulate().
fixed SplinePath::pointsPerSecond_ [protected] |
1.5.3