#include "Spline.h"
|
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) |
|
◆ ControlArray
◆ EvaluationMethtod
typedef void(SplineBase::* Movement::SplineBase::EvaluationMethtod) (index_type, float, Vector3 &) const |
|
protected |
◆ index_type
◆ InitMethtod
typedef void(SplineBase::* Movement::SplineBase::InitMethtod) (const Vector3 *, index_type, bool, index_type) |
|
protected |
◆ SegLenghtMethtod
typedef float(SplineBase::* Movement::SplineBase::SegLenghtMethtod) (index_type) const |
|
protected |
◆ anonymous enum
Enumerator |
---|
STEPS_PER_SEGMENT | |
53 {
54
55
56
57
59 };
@ STEPS_PER_SEGMENT
Definition Spline.h:58
◆ EvaluationMode
Enumerator |
---|
ModeLinear | |
ModeCatmullrom | |
ModeBezier3_Unused | |
UninitializedMode | |
ModesEnd | |
35 {
41 };
@ ModeCatmullrom
Definition Spline.h:37
@ ModesEnd
Definition Spline.h:40
@ ModeBezier3_Unused
Definition Spline.h:38
@ UninitializedMode
Definition Spline.h:39
@ ModeLinear
Definition Spline.h:36
◆ SplineBase()
Movement::SplineBase::SplineBase |
( |
| ) |
|
|
explicitdefault |
◆ clear()
void Movement::SplineBase::clear |
( |
| ) |
|
◆ empty()
bool Movement::SplineBase::empty |
( |
| ) |
const |
|
inline |
◆ evaluate_derivative()
void Movement::SplineBase::evaluate_derivative |
( |
index_type |
Idx, |
|
|
float |
u, |
|
|
Vector3 & |
hermite |
|
) |
| const |
|
inline |
Caclulates derivation in index Idx, and percent of segment length t
- Parameters
-
Idx | - spline segment index, should be in range [first, last) |
t | - percent of spline segment length, assumes that t in range [0, 1] |
uint8 m_mode
Definition Spline.h:49
static EvaluationMethtod derivative_evaluators[ModesEnd]
Definition Spline.h:72
References m_mode.
Referenced by Movement::Spline< length_type >::evaluate_derivative().
◆ evaluate_percent()
void Movement::SplineBase::evaluate_percent |
( |
index_type |
Idx, |
|
|
float |
u, |
|
|
Vector3 & |
c |
|
) |
| const |
|
inline |
Caclulates the position for given segment Idx, and percent of segment length t
- Parameters
-
t | - percent of segment length, assumes that t in range [0, 1] |
Idx | - spline segment index, should be in range [first, last) |
static EvaluationMethtod evaluators[ModesEnd]
Definition Spline.h:67
References m_mode.
Referenced by Movement::Spline< length_type >::evaluate_percent().
◆ EvaluateBezier3()
void Movement::SplineBase::EvaluateBezier3 |
( |
index_type |
index, |
|
|
float |
t, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
128 {
129 index *= 3u;
132 }
#define ASSERT
Definition Errors.h:68
void C_Evaluate(const Vector3 *vertice, float t, const Matrix4 &matr, Vector3 &result)
Definition Spline.cpp:97
static const Matrix4 s_Bezier3Coeffs(-1.f, 3.f, -3.f, 1.f, 3.f, -6.f, 3.f, 0.f, -3.f, 3.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f)
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_Bezier3Coeffs().
◆ EvaluateCatmullRom()
void Movement::SplineBase::EvaluateCatmullRom |
( |
index_type |
index, |
|
|
float |
t, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
122 {
125 }
static const Matrix4 s_catmullRomCoeffs(-0.5f, 1.5f, -1.5f, 0.5f, 1.f, -2.5f, 2.f, -0.5f, -0.5f, 0.f, 0.5f, 0.f, 0.f, 1.f, 0.f, 0.f)
References ASSERT, Movement::C_Evaluate(), index_hi, index_lo, points, and Movement::s_catmullRomCoeffs().
◆ EvaluateDerivativeBezier3()
void Movement::SplineBase::EvaluateDerivativeBezier3 |
( |
index_type |
index, |
|
|
float |
t, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
◆ EvaluateDerivativeCatmullRom()
void Movement::SplineBase::EvaluateDerivativeCatmullRom |
( |
index_type |
index, |
|
|
float |
t, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
◆ EvaluateDerivativeLinear()
void Movement::SplineBase::EvaluateDerivativeLinear |
( |
index_type |
index, |
|
|
float |
, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
◆ EvaluateLinear()
void Movement::SplineBase::EvaluateLinear |
( |
index_type |
index, |
|
|
float |
u, |
|
|
Vector3 & |
result |
|
) |
| const |
|
protected |
◆ first()
◆ getPoint()
const Vector3 & Movement::SplineBase::getPoint |
( |
index_type |
i | ) |
const |
|
inline |
◆ getPointCount()
index_type Movement::SplineBase::getPointCount |
( |
| ) |
const |
|
inline |
◆ getPoints()
const ControlArray & Movement::SplineBase::getPoints |
( |
| ) |
const |
|
inline |
◆ init_cyclic_spline()
◆ init_spline()
◆ init_spline_custom()
template<class Init >
void Movement::SplineBase::init_spline_custom |
( |
Init & |
initializer | ) |
|
|
inline |
◆ InitBezier3()
void Movement::SplineBase::InitBezier3 |
( |
const Vector3 * |
controls, |
|
|
index_type |
count, |
|
|
bool |
, |
|
|
index_type |
|
|
) |
| |
|
protected |
272 {
275
277 memcpy(&
points[0], controls,
sizeof(Vector3) * c);
278
281
282 }
int index_type
Definition Spline.h:31
References index_hi, index_lo, and points.
◆ InitCatmullRom()
void Movement::SplineBase::InitCatmullRom |
( |
const Vector3 * |
controls, |
|
|
index_type |
count, |
|
|
bool |
cyclic, |
|
|
index_type |
cyclic_point |
|
) |
| |
|
protected |
239 {
240 const int real_size = count + (
cyclic ? (1 + 2) : (1 + 1));
241
243
244 int lo_index = 1;
245 int high_index = lo_index + count - 1;
246
247 memcpy(&
points[lo_index], controls,
sizeof(Vector3) * count);
248
249
250
252 {
253 if (cyclic_point == 0)
254 points[0] = controls[count - 1];
255 else
256 points[0] = controls[0].lerp(controls[1], -1);
257
258 points[high_index + 1] = controls[cyclic_point];
259 points[high_index + 2] = controls[cyclic_point + 1];
260 }
261 else
262 {
263 points[0] = controls[0].lerp(controls[1], -1);
264 points[high_index + 1] = controls[count - 1];
265 }
266
269 }
References cyclic, index_hi, index_lo, and points.
◆ InitLinear()
void Movement::SplineBase::InitLinear |
( |
const Vector3 * |
controls, |
|
|
index_type |
count, |
|
|
bool |
cyclic, |
|
|
index_type |
cyclic_point |
|
) |
| |
|
protected |
219 {
221 const int real_size = count + 1;
222
224
225 memcpy(&
points[0], controls,
sizeof(Vector3) * count);
226
227
228
230 points[count] = controls[cyclic_point];
231 else
232 points[count] = controls[count - 1];
233
236 }
References ASSERT, cyclic, index_hi, index_lo, and points.
◆ isCyclic()
bool Movement::SplineBase::isCyclic |
( |
| ) |
const |
|
inline |
◆ last()
◆ mode()
◆ SegLength()
float Movement::SplineBase::SegLength |
( |
index_type |
i | ) |
const |
|
inline |
◆ SegLengthBezier3()
float Movement::SplineBase::SegLengthBezier3 |
( |
index_type |
index | ) |
const |
|
protected |
◆ SegLengthCatmullRom()
float Movement::SplineBase::SegLengthCatmullRom |
( |
index_type |
index | ) |
const |
|
protected |
◆ SegLengthLinear()
float Movement::SplineBase::SegLengthLinear |
( |
index_type |
index | ) |
const |
|
protected |
◆ ToString()
std::string Movement::SplineBase::ToString |
( |
| ) |
const |
292 {
293 std::stringstream str;
294 const char* mode_str[
ModesEnd] = {
"Linear",
"CatmullRom",
"Bezier3",
"Uninitialized"};
295
297 str <<
"mode: " << mode_str[
mode()] << std::endl;
298 str << "points count: " << count << std::endl;
300 str <<
"point " << i <<
" : " <<
points[i].toString() << std::endl;
301
302 return str.str();
303 }
EvaluationMode mode() const
Definition Spline.h:110
References mode(), ModesEnd, and points.
Referenced by Movement::MoveSpline::ToString().
◆ UninitializedSplineEvaluationMethod()
void Movement::SplineBase::UninitializedSplineEvaluationMethod |
( |
index_type |
, |
|
|
float |
, |
|
|
Vector3 & |
|
|
) |
| const |
|
inlineprotected |
#define ABORT
Definition Errors.h:76
References ABORT.
◆ UninitializedSplineInitMethod()
void Movement::SplineBase::UninitializedSplineInitMethod |
( |
Vector3 const * |
, |
|
|
index_type |
, |
|
|
bool |
, |
|
|
index_type |
|
|
) |
| |
|
inlineprotected |
◆ UninitializedSplineSegLenghtMethod()
float Movement::SplineBase::UninitializedSplineSegLenghtMethod |
( |
index_type |
| ) |
const |
|
inlineprotected |
◆ cyclic
bool Movement::SplineBase::cyclic {false} |
|
protected |
◆ derivative_evaluators
Initial value:=
{
}
void EvaluateDerivativeCatmullRom(index_type, float, Vector3 &) const
Definition Spline.cpp:140
void EvaluateDerivativeBezier3(index_type, float, Vector3 &) const
Definition Spline.cpp:146
void EvaluateDerivativeLinear(index_type, float, Vector3 &) const
Definition Spline.cpp:134
void UninitializedSplineEvaluationMethod(index_type, float, Vector3 &) const
Definition Spline.h:86
◆ evaluators
Initial value:=
{
}
void EvaluateCatmullRom(index_type, float, Vector3 &) const
Definition Spline.cpp:121
void EvaluateBezier3(index_type, float, Vector3 &) const
Definition Spline.cpp:127
void EvaluateLinear(index_type, float, Vector3 &) const
Definition Spline.cpp:115
◆ index_hi
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().
◆ index_lo
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().
◆ initializers
Initial value:=
{
}
void UninitializedSplineInitMethod(Vector3 const *, index_type, bool, index_type)
Definition Spline.h:88
void InitBezier3(const Vector3 *, index_type, bool, index_type)
Definition Spline.cpp:271
void InitCatmullRom(const Vector3 *, index_type, bool, index_type)
Definition Spline.cpp:238
Referenced by init_cyclic_spline(), and init_spline().
◆ m_mode
◆ points
Referenced by clear(), EvaluateBezier3(), EvaluateCatmullRom(), EvaluateDerivativeBezier3(), EvaluateDerivativeCatmullRom(), EvaluateDerivativeLinear(), EvaluateLinear(), getPoint(), getPointCount(), getPoints(), init_spline_custom(), InitBezier3(), InitCatmullRom(), InitLinear(), SegLengthBezier3(), SegLengthCatmullRom(), SegLengthLinear(), and ToString().
◆ seglengths
Initial value:=
{
}
float SegLengthLinear(index_type) const
Definition Spline.cpp:153
float SegLengthBezier3(index_type) const
Definition Spline.cpp:179
float UninitializedSplineSegLenghtMethod(index_type) const
Definition Spline.h:87
float SegLengthCatmullRom(index_type) const
Definition Spline.cpp:159
The documentation for this class was generated from the following files:
- azerothcore-wotlk/src/server/game/Movement/Spline/Spline.h
- azerothcore-wotlk/src/server/game/Movement/Spline/Spline.cpp