![]() |
TrinityCore
|
#include <Spline.h>
Inheritance diagram for Movement::SplineBase:Public Types | |
| enum | EvaluationMode { ModeLinear , ModeCatmullrom , ModeBezier3_Unused , UninitializedMode , ModesEnd } |
| typedef int | index_type |
| typedef std::vector< Vector3 > | ControlArray |
Public Member Functions | |
| SplineBase () | |
| void | evaluate_percent (index_type Idx, float u, Vector3 &c) const |
| void | evaluate_derivative (index_type Idx, float u, Vector3 &hermite) const |
| index_type | first () const |
| index_type | last () const |
| bool | empty () const |
| EvaluationMode | mode () const |
| bool | isCyclic () const |
| ControlArray const & | getPoints () const |
| index_type | getPointCount () const |
| Vector3 const & | getPoint (index_type i) const |
| void | init_spline (const Vector3 *controls, index_type count, EvaluationMode m, float orientation) |
| void | init_cyclic_spline (const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point, float orientation) |
| template<class Init > | |
| void | init_spline_custom (Init &initializer) |
| void | clear () |
| float | SegLength (index_type i) const |
| std::string | ToString () const |
Protected Types | |
| enum | { STEPS_PER_SEGMENT = 3 } |
| typedef void(SplineBase::* | EvaluationMethtod) (index_type, float, Vector3 &) const |
| typedef float(SplineBase::* | SegLenghtMethtod) (index_type) const |
| typedef void(SplineBase::* | InitMethtod) (Vector3 const *, index_type, index_type) |
Protected Member Functions | |
| void | EvaluateLinear (index_type, float, Vector3 &) const |
| void | EvaluateCatmullRom (index_type, float, Vector3 &) const |
| void | EvaluateBezier3 (index_type, float, Vector3 &) const |
| void | EvaluateDerivativeLinear (index_type, float, Vector3 &) const |
| void | EvaluateDerivativeCatmullRom (index_type, float, Vector3 &) const |
| void | EvaluateDerivativeBezier3 (index_type, float, Vector3 &) const |
| float | SegLengthLinear (index_type) const |
| float | SegLengthCatmullRom (index_type) const |
| float | SegLengthBezier3 (index_type) const |
| void | InitLinear (Vector3 const *, index_type, index_type) |
| void | InitCatmullRom (Vector3 const *, index_type, index_type) |
| void | InitBezier3 (Vector3 const *, index_type, index_type) |
| void | UninitializedSplineEvaluationMethod (index_type, float, Vector3 &) const |
| float | UninitializedSplineSegLenghtMethod (index_type) const |
| void | UninitializedSplineInitMethod (Vector3 const *, index_type, index_type) |
Protected Attributes | |
| ControlArray | points |
| index_type | index_lo |
| index_type | index_hi |
| uint8 | m_mode |
| bool | cyclic |
| float | initialOrientation |
Static Protected Attributes | |
| static EvaluationMethtod | evaluators [ModesEnd] |
| static EvaluationMethtod | derivative_evaluators [ModesEnd] |
| static SegLenghtMethtod | seglengths [ModesEnd] |
| static InitMethtod | initializers [ModesEnd] |
| typedef std::vector<Vector3> Movement::SplineBase::ControlArray |
|
protected |
| typedef int Movement::SplineBase::index_type |
|
protected |
|
protected |
| void Movement::SplineBase::clear | ( | ) |
Definition at line 285 of file Spline.cpp.
References index_hi, index_lo, and points.
Referenced by Movement::Spline< length_type >::clear().
|
inline |
Definition at line 111 of file Spline.h.
References index_hi, and index_lo.
Referenced by Movement::MoveSpline::Initialized().
|
inline |
Caclulates derivation in index Idx, and percent of segment length t
| Idx | - spline segment index, should be in range [first, last) |
| t | - percent of spline segment length, assumes that t in range [0, 1] |
Definition at line 105 of file Spline.h.
References m_mode.
Referenced by Movement::Spline< length_type >::evaluate_derivative().
|
inline |
Caclulates the position for given segment Idx, and percent of segment length t
| t | - percent of segment length, assumes that t in range [0, 1] |
| Idx | - spline segment index, should be in range [first, last) |
Definition at line 99 of file Spline.h.
References m_mode.
Referenced by Movement::Spline< length_type >::evaluate_percent().
|
protected |
Definition at line 126 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_Bezier3Coeffs().
|
protected |
Definition at line 120 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_catmullRomCoeffs().
|
protected |
Definition at line 145 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate_Derivative(), index_hi, index_lo, points, and Movement::s_Bezier3Coeffs().
|
protected |
Definition at line 139 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate_Derivative(), index_hi, index_lo, points, and Movement::s_catmullRomCoeffs().
|
protected |
|
protected |
|
inline |
Bounds for spline indexes. All indexes should be in range [first, last).
Definition at line 108 of file Spline.h.
References index_lo.
Referenced by Movement::MoveSpline::_updateState(), Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::currentPathIdx(), Movement::MoveSpline::init_spline(), and Movement::Spline< length_type >::length().
|
inline |
Definition at line 117 of file Spline.h.
References points.
Referenced by Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::CurrentDestination(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::init_spline(), and Movement::FallInitializer::operator()().
|
inline |
Definition at line 116 of file Spline.h.
References points.
Referenced by Movement::MoveSpline::_updateState(), and WorldPackets::Movement::MonsterMove::InitializeSplineData().
|
inline |
Definition at line 115 of file Spline.h.
References points.
Referenced by Movement::MoveSpline::_updateState(), Movement::MoveSpline::getPath(), and WorldPackets::Movement::MonsterMove::InitializeSplineData().
| void Movement::SplineBase::init_cyclic_spline | ( | const Vector3 * | controls, |
| index_type | count, | ||
| EvaluationMode | m, | ||
| index_type | cyclic_point, | ||
| float | orientation | ||
| ) |
Definition at line 210 of file Spline.cpp.
References cyclic, initializers, initialOrientation, and m_mode.
Referenced by Movement::Spline< length_type >::init_cyclic_spline().
| void Movement::SplineBase::init_spline | ( | const Vector3 * | controls, |
| index_type | count, | ||
| EvaluationMode | m, | ||
| float | orientation | ||
| ) |
Initializes spline. Don't call other methods while spline not initialized.
Definition at line 201 of file Spline.cpp.
References cyclic, initializers, initialOrientation, and m_mode.
Referenced by Movement::Spline< length_type >::init_spline().
|
inline |
|
protected |
Definition at line 272 of file Spline.cpp.
|
protected |
Definition at line 239 of file Spline.cpp.
References cyclic, index_hi, index_lo, initialOrientation, and points.
|
protected |
|
inline |
Definition at line 113 of file Spline.h.
References cyclic.
Referenced by Movement::MoveSpline::_updateState(), and Movement::MoveSpline::init_spline().
|
inline |
Definition at line 109 of file Spline.h.
References index_hi.
Referenced by Movement::MoveSpline::_Finalize(), Movement::MoveSpline::_updateState(), Movement::MoveSpline::currentPathIdx(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::init_spline(), and Movement::Spline< length_type >::length().
|
inline |
|
inline |
Calculates distance between [i; i+1] points, assumes that index i is in bounds.
Definition at line 133 of file Spline.h.
References m_mode.
Referenced by Movement::CommonInitializer::operator()().
|
protected |
Definition at line 178 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, Movement::s_Bezier3Coeffs(), and STEPS_PER_SEGMENT.
|
protected |
Definition at line 158 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, Movement::s_catmullRomCoeffs(), and STEPS_PER_SEGMENT.
|
protected |
| std::string Movement::SplineBase::ToString | ( | ) | const |
Definition at line 292 of file Spline.cpp.
References mode(), ModesEnd, and points.
Referenced by Movement::MoveSpline::ToString().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protected |
Definition at line 51 of file Spline.h.
Referenced by init_cyclic_spline(), init_spline(), init_spline_custom(), InitCatmullRom(), InitLinear(), and isCyclic().
|
staticprotected |
|
staticprotected |
|
protected |
Definition at line 48 of file Spline.h.
Referenced by clear(), empty(), EvaluateBezier3(), EvaluateCatmullRom(), EvaluateDerivativeBezier3(), EvaluateDerivativeCatmullRom(), EvaluateDerivativeLinear(), EvaluateLinear(), init_spline_custom(), InitBezier3(), InitCatmullRom(), Movement::Spline< length_type >::initLengths(), InitLinear(), last(), Movement::Spline< length_type >::length(), SegLengthBezier3(), SegLengthCatmullRom(), and SegLengthLinear().
|
protected |
Definition at line 47 of file Spline.h.
Referenced by clear(), empty(), EvaluateBezier3(), EvaluateCatmullRom(), EvaluateDerivativeBezier3(), EvaluateDerivativeCatmullRom(), EvaluateDerivativeLinear(), EvaluateLinear(), first(), init_spline_custom(), InitBezier3(), InitCatmullRom(), Movement::Spline< length_type >::initLengths(), InitLinear(), SegLengthBezier3(), SegLengthCatmullRom(), and SegLengthLinear().
|
staticprotected |
Definition at line 85 of file Spline.h.
Referenced by init_cyclic_spline(), and init_spline().
|
protected |
Definition at line 52 of file Spline.h.
Referenced by init_cyclic_spline(), init_spline(), and InitCatmullRom().
|
protected |
Definition at line 50 of file Spline.h.
Referenced by evaluate_derivative(), evaluate_percent(), init_cyclic_spline(), init_spline(), init_spline_custom(), mode(), and SegLength().
|
protected |
Definition at line 45 of file Spline.h.
Referenced by clear(), EvaluateBezier3(), EvaluateCatmullRom(), EvaluateDerivativeBezier3(), EvaluateDerivativeCatmullRom(), EvaluateDerivativeLinear(), EvaluateLinear(), getPoint(), getPointCount(), getPoints(), init_spline_custom(), InitBezier3(), InitCatmullRom(), InitLinear(), SegLengthBezier3(), SegLengthCatmullRom(), SegLengthLinear(), and ToString().
|
staticprotected |