![]() |
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 () | |
| SplineBase (SplineBase const &right)=delete | |
| SplineBase (SplineBase &&right)=delete | |
| SplineBase & | operator= (SplineBase const &right)=delete |
| SplineBase & | operator= (SplineBase &&right)=delete |
| virtual | ~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=0.0f) |
| void | init_cyclic_spline (const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point, float orientation=0.0f) |
| template<class Init > | |
| void | init_spline_custom (Init &&initializer) |
| virtual void | clear () |
| float | SegLength (index_type i) const |
| void | set_steps_per_segment (index_type newStepsPerSegment) |
| std::string | ToString () const |
Protected Types | |
| 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 |
| index_type | stepsPerSegment = 3 |
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 |
|
explicit |
Definition at line 285 of file Spline.cpp.
|
delete |
|
delete |
|
virtualdefault |
|
virtual |
Reimplemented in Movement::Spline< length_type >, Movement::Spline< float >, and Movement::Spline< int32 >.
Definition at line 291 of file Spline.cpp.
References index_hi, index_lo, and points.
Referenced by Movement::Spline< length_type >::clear().
|
inline |
Definition at line 113 of file Spline.h.
References index_hi, and index_lo.
Referenced by Movement::MoveSpline::Initialized().
|
inline |
|
inline |
|
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 110 of file Spline.h.
References index_lo.
Referenced by Movement::MoveSpline::_updateState(), Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::ComputePosition(), Movement::MoveSpline::currentPathIdx(), Movement::MoveSpline::init_spline(), Movement::MoveSpline::Initialize(), Movement::Spline< length_type >::length(), and Movement::MoveSpline::reinit_spline_for_next_cycle().
|
inline |
Definition at line 119 of file Spline.h.
References points.
Referenced by Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::CurrentDestination(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::init_spline(), Movement::FallInitializer::operator()(), and WorldPackets::Movement::CommonMovement::WriteCreateObjectSplineDataBlock().
|
inline |
Definition at line 118 of file Spline.h.
References points.
Referenced by WorldPackets::Movement::MonsterMove::InitializeSplineData(), and WorldPackets::Movement::CommonMovement::WriteCreateObjectSplineDataBlock().
|
inline |
Definition at line 117 of file Spline.h.
References points.
Referenced by Movement::MoveSpline::getPath(), WorldPackets::Movement::MonsterMove::InitializeSplineData(), and Movement::MoveSpline::reinit_spline_for_next_cycle().
| void Movement::SplineBase::init_cyclic_spline | ( | const Vector3 * | controls, |
| index_type | count, | ||
| EvaluationMode | m, | ||
| index_type | cyclic_point, | ||
| float | orientation = 0.0f |
||
| ) |
Definition at line 210 of file Spline.cpp.
References cyclic, initializers, initialOrientation, and m_mode.
Referenced by Movement::MoveSpline::init_spline().
| void Movement::SplineBase::init_spline | ( | const Vector3 * | controls, |
| index_type | count, | ||
| EvaluationMode | m, | ||
| float | orientation = 0.0f |
||
| ) |
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::MoveSpline::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 115 of file Spline.h.
References cyclic.
Referenced by Movement::MoveSpline::_updateState(), and Movement::MoveSpline::init_spline().
|
inline |
Definition at line 111 of file Spline.h.
References index_hi.
Referenced by Movement::MoveSpline::_Finalize(), Movement::MoveSpline::_updateState(), Movement::MoveSpline::ComputePosition(), Movement::MoveSpline::currentPathIdx(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::init_spline(), Movement::Spline< length_type >::length(), Movement::MoveSpline::reinit_spline_for_next_cycle(), and WorldPackets::Movement::CommonMovement::WriteCreateObjectSplineDataBlock().
|
inline |
|
delete |
|
delete |
|
inline |
Calculates distance between [i; i+1] points, assumes that index i is in bounds.
Definition at line 136 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 stepsPerSegment.
|
protected |
Definition at line 158 of file Spline.cpp.
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, Movement::s_catmullRomCoeffs(), and stepsPerSegment.
|
protected |
|
inline |
Definition at line 138 of file Spline.h.
References stepsPerSegment.
| std::string Movement::SplineBase::ToString | ( | ) | const |
Definition at line 298 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 82 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 |
|
protected |
Definition at line 58 of file Spline.h.
Referenced by SegLengthBezier3(), SegLengthCatmullRom(), and set_steps_per_segment().