Spline class to get a point on it based off the interpolation mode. More...

#include <Urho3D/Core/Spline.h>

Collaboration diagram for Urho3D::Spline:
[legend]

Public Member Functions

 Spline ()
 Default constructor.
 
 Spline (InterpolationMode mode)
 Constructor setting interpolation mode.
 
 Spline (const Vector< Variant > &knots, InterpolationMode mode=BEZIER_CURVE)
 Constructor setting knots and interpolation mode.
 
 Spline (const Spline &rhs)=default
 Copy constructor.
 
Splineoperator= (const Spline &rhs)=default
 Copy operator.
 
bool operator== (const Spline &rhs) const
 Equality operator.
 
bool operator!= (const Spline &rhs) const
 Inequality operator.
 
InterpolationMode GetInterpolationMode () const
 
const VariantVectorGetKnots () const
 Return the knots of the spline.
 
Variant GetKnot (unsigned index) const
 
Variant GetPoint (float f) const
 Return the T of the point of the spline at f from 0.f - 1.f. More...
 
void SetInterpolationMode (InterpolationMode interpolationMode)
 
void SetKnots (const Vector< Variant > &knots)
 Set the knots of the spline.
 
void SetKnot (const Variant &knot, unsigned index)
 Set the value of an existing knot.
 
void AddKnot (const Variant &knot)
 Add a knot to the end of the spline.
 
void AddKnot (const Variant &knot, unsigned index)
 Add a knot to the spline at a specific index.
 
void RemoveKnot ()
 Remove the last knot on the spline.
 
void RemoveKnot (unsigned index)
 Remove the knot at the specific index.
 
void Clear ()
 Clear the spline.
 

Private Member Functions

Variant BezierInterpolation (const Vector< Variant > &knots, float t) const
 Perform Bezier interpolation on the spline. More...
 
Variant CatmullRomInterpolation (const Vector< Variant > &knots, float t) const
 Perform Spline interpolation on the spline.
 
Variant LinearInterpolation (const Vector< Variant > &knots, float t) const
 Perform linear interpolation on the spline.
 
Variant LinearInterpolation (const Variant &lhs, const Variant &rhs, float t) const
 Linear interpolation between two Variants based on underlying type.
 

Private Attributes

InterpolationMode interpolationMode_
 Interpolation mode.
 
VariantVector knots_
 Knots on the spline.
 

Detailed Description

Spline class to get a point on it based off the interpolation mode.

Member Function Documentation

◆ BezierInterpolation()

Variant Urho3D::Spline::BezierInterpolation ( const Vector< Variant > &  knots,
float  t 
) const
private

Perform Bezier interpolation on the spline.

Todo:
Do not allocate a new vector each time
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInterpolationMode()

InterpolationMode Urho3D::Spline::GetInterpolationMode ( ) const
inline

Return the interpolation mode.

◆ GetKnot()

Variant Urho3D::Spline::GetKnot ( unsigned  index) const
inline

Return the knot at the specific index.

Here is the caller graph for this function:

◆ GetPoint()

Variant Urho3D::Spline::GetPoint ( float  f) const

Return the T of the point of the spline at f from 0.f - 1.f.

Todo:
Do not allocate a new vector each time
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInterpolationMode()

void Urho3D::Spline::SetInterpolationMode ( InterpolationMode  interpolationMode)
inline

Set the interpolation mode.

Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • Source/Urho3D/Core/Spline.h
  • Source/Urho3D/Core/Spline.cpp