AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Spline.h"
Public Types | |
typedef length_type | LengthType |
typedef std::vector< length_type > | LengthArray |
Public Types inherited from Movement::SplineBase | |
enum | EvaluationMode { ModeLinear , ModeCatmullrom , ModeBezier3_Unused , UninitializedMode , ModesEnd } |
typedef int | index_type |
typedef std::vector< Vector3 > | ControlArray |
Public Member Functions | |
Spline ()=default | |
void | evaluate_percent (float t, Vector3 &c) const |
void | evaluate_derivative (float t, Vector3 &hermite) const |
void | evaluate_percent (index_type Idx, float u, Vector3 &c) const |
void | evaluate_derivative (index_type Idx, float u, Vector3 &c) const |
index_type | computeIndexInBounds (float t) const |
void | computeIndex (float t, index_type &out_idx, float &out_u) 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) |
void | initLengths () |
template<class T > | |
void | initLengths (T &cacher) |
length_type | length () const |
length_type | length (index_type first, index_type last) const |
length_type | length (index_type Idx) const |
void | set_length (index_type i, length_type length) |
void | clear () |
Public Member Functions inherited from Movement::SplineBase | |
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 Attributes | |
LengthArray | lengths |
Protected Attributes inherited from Movement::SplineBase | |
ControlArray | points |
index_type | index_lo {0} |
index_type | index_hi {0} |
uint8 | m_mode {UninitializedMode} |
bool | cyclic {false} |
Additional Inherited Members | |
Protected Types inherited from Movement::SplineBase | |
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) |
Static Protected Attributes inherited from Movement::SplineBase | |
static EvaluationMethtod | evaluators [ModesEnd] |
static EvaluationMethtod | derivative_evaluators [ModesEnd] |
static SegLenghtMethtod | seglengths [ModesEnd] |
static InitMethtod | initializers [ModesEnd] |
typedef std::vector<length_type> Movement::Spline< length_type >::LengthArray |
typedef length_type Movement::Spline< length_type >::LengthType |
|
explicitdefault |
Referenced by TransportMgr::GeneratePath().
void Movement::Spline< length_type >::clear |
References Movement::SplineBase::clear().
Referenced by Movement::MoveSpline::Initialize().
void Movement::Spline< length_type >::computeIndex | ( | float | t, |
index_type & | out_idx, | ||
float & | out_u | ||
) | const |
References ASSERT.
SplineBase::index_type Movement::Spline< length_type >::computeIndexInBounds | ( | float | t | ) | const |
References ASSERT.
|
protected |
void Movement::Spline< length_type >::evaluate_derivative | ( | float | t, |
Vector3 & | hermite | ||
) | const |
Calculates derivation for given t
t | - percent of spline's length, assumes that t in range [0, 1]. |
Referenced by Movement::MoveSpline::ComputePosition(), and TransportMgr::GeneratePath().
|
inline |
Caclulates derivation for 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 Movement::SplineBase::evaluate_derivative().
void Movement::Spline< length_type >::evaluate_percent | ( | float | t, |
Vector3 & | c | ||
) | const |
Calculates the position for given t
t | - percent of spline's length, assumes that t in range [0, 1]. |
Referenced by Movement::MoveSpline::ComputePosition().
|
inline |
Calculates the position for given segment Idx, and percent of segment length t
t | = partial_segment_length / whole_segment_length |
Idx | - spline segment index, should be in range [first, last). |
References Movement::SplineBase::evaluate_percent().
|
inline |
References Movement::SplineBase::init_cyclic_spline().
Referenced by Movement::MoveSpline::init_spline().
|
inline |
Initializes spline. Don't call other methods while spline not initialized.
References Movement::SplineBase::init_spline().
Referenced by TransportMgr::GeneratePath(), and Movement::MoveSpline::init_spline().
void Movement::Spline< length_type >::initLengths |
Initializes lengths with SplineBase::SegLength method.
Referenced by TransportMgr::GeneratePath(), and Movement::MoveSpline::init_spline().
|
inline |
Initializes lengths in some custom way Note that value returned by cacher must be greater or equal to previous value.
References ASSERT, Movement::SplineBase::index_hi, Movement::SplineBase::index_lo, and Movement::Spline< length_type >::lengths.
|
inline |
Returns length of the whole spline.
References Movement::SplineBase::index_hi, and Movement::Spline< length_type >::lengths.
Referenced by Movement::MoveSpline::ComputePosition(), Movement::MoveSpline::Duration(), TransportMgr::GeneratePath(), Movement::MoveSpline::init_spline(), Movement::MoveSpline::next_timestamp(), and Movement::Spline< length_type >::set_length().
|
inline |
Returns length between given nodes.
References Movement::SplineBase::first(), Movement::SplineBase::last(), and Movement::Spline< length_type >::lengths.
|
inline |
References Movement::Spline< length_type >::lengths.
|
inline |
References Movement::Spline< length_type >::length(), and Movement::Spline< length_type >::lengths.
Referenced by Movement::MoveSpline::init_spline().
|
protected |