18#ifndef TRINITYSERVER_SPLINE_H
19#define TRINITYSERVER_SPLINE_H
23#include <G3D/Vector3.h>
61 static_assert(
STEPS_PER_SEGMENT > 0,
"STEPS_PER_SEGMENT shouldn't be lesser than 1");
138template<
typename length_type>
188 length_type prev_length = 0, new_length = 0;
191 new_length = cacher(*
this, i);
194 new_length = std::numeric_limits<length_type>::max();
197 ASSERT(prev_length <= new_length);
198 prev_length = new_length;
void init_spline_custom(Init &initializer)
std::vector< Vector3 > ControlArray
float SegLengthLinear(index_type) const
ControlArray const & getPoints() const
void init_cyclic_spline(const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point, float orientation)
static InitMethtod initializers[ModesEnd]
void EvaluateCatmullRom(index_type, float, Vector3 &) const
void EvaluateDerivativeCatmullRom(index_type, float, Vector3 &) const
void evaluate_percent(index_type Idx, float u, Vector3 &c) const
void init_spline(const Vector3 *controls, index_type count, EvaluationMode m, float orientation)
void evaluate_derivative(index_type Idx, float u, Vector3 &hermite) const
void EvaluateBezier3(index_type, float, Vector3 &) const
float SegLengthBezier3(index_type) const
float UninitializedSplineSegLenghtMethod(index_type) const
float SegLengthCatmullRom(index_type) const
void UninitializedSplineInitMethod(Vector3 const *, index_type, index_type)
float SegLength(index_type i) const
void EvaluateDerivativeBezier3(index_type, float, Vector3 &) const
void EvaluateDerivativeLinear(index_type, float, Vector3 &) const
Vector3 const & getPoint(index_type i) const
void InitBezier3(Vector3 const *, index_type, index_type)
void(SplineBase::* EvaluationMethtod)(index_type, float, Vector3 &) const
void(SplineBase::* InitMethtod)(Vector3 const *, index_type, index_type)
void EvaluateLinear(index_type, float, Vector3 &) const
void InitLinear(Vector3 const *, index_type, index_type)
std::string ToString() const
float(SplineBase::* SegLenghtMethtod)(index_type) const
static EvaluationMethtod derivative_evaluators[ModesEnd]
static SegLenghtMethtod seglengths[ModesEnd]
index_type getPointCount() const
void UninitializedSplineEvaluationMethod(index_type, float, Vector3 &) const
static EvaluationMethtod evaluators[ModesEnd]
EvaluationMode mode() const
void InitCatmullRom(Vector3 const *, index_type, index_type)
std::vector< length_type > LengthArray
void evaluate_percent(index_type Idx, float u, Vector3 &c) const
void init_spline(const Vector3 *controls, index_type count, EvaluationMode m, float orientation=0)
length_type length(index_type first, index_type last) const
void computeIndex(float t, index_type &out_idx, float &out_u) const
void initLengths(T &cacher)
length_type length(index_type Idx) const
void set_length(index_type i, length_type length)
index_type computeIndexInBounds(length_type length) const
length_type length() const
void evaluate_derivative(float t, Vector3 &hermite) const
void init_cyclic_spline(const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point, float orientation=0)
void evaluate_percent(float t, Vector3 &c) const
void evaluate_derivative(index_type Idx, float u, Vector3 &c) const