6#ifndef SKYFIRESERVER_SPLINE_H
7#define SKYFIRESERVER_SPLINE_H
10#include <G3D/Vector3.h>
46 static_assert(
STEPS_PER_SEGMENT > 0,
"STEPS_PER_SEGMENT shouldn't be lesser than 1");
120 template<
typename length_type>
169 length_type prev_length = 0, new_length = 0;
172 new_length = cacher(*
this, i);
175 new_length = std::numeric_limits<length_type>::max();
178 ASSERT(prev_length <= new_length);
179 prev_length = new_length;
std::vector< Vector3 > ControlArray
float SegLengthLinear(index_type) const
void UninitializedSpline() const
const Vector3 & getPoint(index_type i) const
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 evaluate_derivative(index_type Idx, float u, Vector3 &hermite) const
void EvaluateBezier3(index_type, float, Vector3 &) const
void(SplineBase::* InitMethtod)(const Vector3 *, index_type, bool, index_type)
float SegLengthBezier3(index_type) const
float SegLengthCatmullRom(index_type) const
void InitLinear(const Vector3 *, index_type, bool, index_type)
float SegLength(index_type i) const
void init_spline(Init &initializer)
void EvaluateDerivativeBezier3(index_type, float, Vector3 &) const
void EvaluateDerivativeLinear(index_type, float, Vector3 &) const
void init_spline(const Vector3 *controls, index_type count, EvaluationMode m)
void(SplineBase::* EvaluationMethtod)(index_type, float, Vector3 &) const
const ControlArray & getPoints() const
void EvaluateLinear(index_type, float, Vector3 &) const
std::string ToString() const
void InitBezier3(const Vector3 *, index_type, bool, index_type)
float(SplineBase::* SegLenghtMethtod)(index_type) const
void init_cyclic_spline(const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point)
void InitCatmullRom(const Vector3 *, index_type, bool, index_type)
static EvaluationMethtod derivative_evaluators[ModesEnd]
static SegLenghtMethtod seglengths[ModesEnd]
index_type getPointCount() const
static EvaluationMethtod evaluators[ModesEnd]
EvaluationMode mode() const
void init_spline(const Vector3 *controls, index_type count, EvaluationMode m)
std::vector< double > LengthArray
void evaluate_percent(index_type Idx, float u, Vector3 &c) const
void init_cyclic_spline(const Vector3 *controls, index_type count, EvaluationMode m, index_type cyclic_point)
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
index_type computeIndexInBounds(float t) const
void evaluate_derivative(float t, Vector3 &hermite) const
void evaluate_percent(float t, Vector3 &c) const
void evaluate_derivative(index_type Idx, float u, Vector3 &c) const