MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Static Public Member Functions | List of all members
Mezzanine::BezierInterpolator< T > Class Template Reference

A simple functor for interpolating data points in a simple way. More...

#include <interpolator.h>

Public Types

typedef T InterpolatableType
 The type this will interpolate. More...
 
typedef std::vector
< InterpolatableType
Storage
 The storage to use with thison tracks.
 

Static Public Member Functions

template<typename TIterator >
static T Interpolate (TIterator Begin, TIterator End, Real Location)
 Get a value at a given location between two others. More...
 

Detailed Description

template<typename T>
class Mezzanine::BezierInterpolator< T >

A simple functor for interpolating data points in a simple way.

This interpolator provides different guarantees different from the linear one:

Definition at line 194 of file interpolator.h.

Member Typedef Documentation

template<typename T >
typedef T Mezzanine::BezierInterpolator< T >::InterpolatableType

The type this will interpolate.

Note
All Interpolators need to declare an InterpolatableType

Definition at line 199 of file interpolator.h.

Member Function Documentation

template<typename T >
template<typename TIterator >
static T Mezzanine::BezierInterpolator< T >::Interpolate ( TIterator  Begin,
TIterator  End,
Real  Location 
)
inlinestatic

Get a value at a given location between two others.

This uses Linear interpolation recursively to produce a single curve following Bézier's curve algorithm. For example if interpolating the location 0.5 on a set of 3 data points A,B,C and therefor 2 data segments AB and BC, you can imagine this as getting the point halfway down AB and the point halfway down down BC. Then this will get return the halfway between each of those points. This produces smooth curves but could perform slowly. For more details see the wikiedia pages on Bézier curves: http://en.wikipedia.org/wiki/Bézier_curve or http://en.wikipedia.org/wiki/B%C3%A9zier_curve

Parameters
BeginAn Iterator to the begining of the range of the instances of the type to be Interpolated
EndThe end (not one past the end) of the range that Begin started.
Avalue between 0.0 and 1.0 indicate what point on the beziear spline defined by Begin and End you want.
Returns
A Value equal or near to Begin if 0.0 is passed, equal to or near to End if 1.0 is passed equal to a point exactly in the middle if 0.5 is passed.
Warning
This is implemented as a recursive function with the only termination condition being the Edn iterator.

Definition at line 217 of file interpolator.h.


The documentation for this class was generated from the following file: