AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Spline.h"
Public Types | |
enum | EvaluationMode { ModeLinear , ModeCatmullrom , ModeBezier3_Unused , UninitializedMode , ModesEnd } |
typedef int | index_type |
typedef std::vector< Vector3 > | ControlArray |
Public Member Functions | |
SplineBase ()=default | |
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 |
const ControlArray & | getPoints () const |
index_type | getPointCount () const |
const Vector3 & | getPoint (index_type i) const |
void | init_spline (const Vector3 *controls, index_type count, EvaluationMode m) |
void | init_cyclic_spline (const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point) |
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) (const Vector3 *, index_type, bool, 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 (const Vector3 *, index_type, bool, index_type) |
void | InitCatmullRom (const Vector3 *, index_type, bool, index_type) |
void | InitBezier3 (const Vector3 *, index_type, bool, index_type) |
void | UninitializedSplineEvaluationMethod (index_type, float, Vector3 &) const |
float | UninitializedSplineSegLenghtMethod (index_type) const |
void | UninitializedSplineInitMethod (Vector3 const *, index_type, bool, index_type) |
Protected Attributes | |
ControlArray | points |
index_type | index_lo {0} |
index_type | index_hi {0} |
uint8 | m_mode {UninitializedMode} |
bool | cyclic {false} |
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 |
|
protected |
Enumerator | |
---|---|
STEPS_PER_SEGMENT |
Enumerator | |
---|---|
ModeLinear | |
ModeCatmullrom | |
ModeBezier3_Unused | |
UninitializedMode | |
ModesEnd |
|
explicitdefault |
void Movement::SplineBase::clear | ( | ) |
|
inline |
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] |
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) |
References m_mode.
Referenced by Movement::Spline< length_type >::evaluate_percent().
|
protected |
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_Bezier3Coeffs().
|
protected |
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_catmullRomCoeffs().
|
protected |
References ASSERT, Movement::C_Evaluate_Derivative(), index_hi, index_lo, points, and Movement::s_Bezier3Coeffs().
|
protected |
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).
References index_lo.
Referenced by Movement::MoveSpline::_updateState(), Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::currentPathIdx(), Movement::MoveSpline::init_spline(), Movement::Spline< length_type >::length(), and Movement::PacketBuilder::WriteCommonMonsterMovePart().
|
inline |
References points.
Referenced by Movement::MoveSpline::computeFallElevation(), Movement::MoveSpline::CurrentDestination(), Movement::MoveSpline::FinalDestination(), Movement::MoveSpline::init_spline(), Movement::FallInitializer::operator()(), Movement::WriteCatmullRomCyclicPath(), Movement::WriteCatmullRomPath(), Movement::PacketBuilder::WriteCommonMonsterMovePart(), and Movement::WriteLinearPath().
|
inline |
References points.
Referenced by Movement::WriteCatmullRomCyclicPath(), Movement::WriteCatmullRomPath(), and Movement::WriteLinearPath().
|
inline |
void Movement::SplineBase::init_cyclic_spline | ( | const Vector3 * | controls, |
index_type | count, | ||
EvaluationMode | m, | ||
index_type | cyclic_point | ||
) |
References cyclic, initializers, 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 | ||
) |
Initializes spline. Don't call other methods while spline not initialized.
References cyclic, initializers, and m_mode.
Referenced by Movement::Spline< length_type >::init_spline().
|
inline |
|
protected |
|
protected |
|
protected |
|
inline |
References cyclic.
Referenced by Movement::MoveSpline::_updateState(), and Movement::MoveSpline::init_spline().
|
inline |
|
inline |
|
inline |
Calculates distance between [i; i+1] points, assumes that index i is in bounds.
References m_mode.
Referenced by Movement::CommonInitializer::operator()().
|
protected |
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, Movement::s_Bezier3Coeffs(), and STEPS_PER_SEGMENT.
|
protected |
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, Movement::s_catmullRomCoeffs(), and STEPS_PER_SEGMENT.
|
protected |
std::string Movement::SplineBase::ToString | ( | ) | const |
References mode(), ModesEnd, and points.
Referenced by Movement::MoveSpline::ToString().
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protected |
Referenced by init_cyclic_spline(), init_spline(), init_spline_custom(), InitCatmullRom(), InitLinear(), and isCyclic().
|
staticprotected |
|
staticprotected |
|
protected |
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 |
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 |
Referenced by init_cyclic_spline(), and init_spline().
|
protected |
Referenced by evaluate_derivative(), evaluate_percent(), init_cyclic_spline(), init_spline(), init_spline_custom(), mode(), and SegLength().
|
protected |
Referenced by clear(), EvaluateBezier3(), EvaluateCatmullRom(), EvaluateDerivativeBezier3(), EvaluateDerivativeCatmullRom(), EvaluateDerivativeLinear(), EvaluateLinear(), getPoint(), getPointCount(), getPoints(), init_spline_custom(), InitBezier3(), InitCatmullRom(), InitLinear(), SegLengthBezier3(), SegLengthCatmullRom(), SegLengthLinear(), and ToString().
|
staticprotected |