Emergency 2017 Dokumentation  v3.0.1
qsf::InterpolationPolicy< float > Struct Template Reference

#include <InterpolationPolicyFloat.h>

Static Public Member Functions

static void interpolate (const float &from, const float &to, float t, float &out)
 
static void bezierInterpolation (const float &from, const float &cp0, const float &cp1, const float &to, float t, float &out)
 Really simple bezier interpolation algorithm in here. This one could be improved by A LOT in terms of performance. More...
 
static float approximateBezierInterpolationTime (float searchedT, float p0t, float cp0t, float cp1t, float p1t)
 

Detailed Description

template<>
struct qsf::InterpolationPolicy< float >

Definition at line 27 of file InterpolationPolicyFloat.h.

Member Function Documentation

static float qsf::InterpolationPolicy< float >::approximateBezierInterpolationTime ( float  searchedT,
float  p0t,
float  cp0t,
float  cp1t,
float  p1t 
)
inlinestatic
Todo:
  • TODO(oi) This is the best I can do for proper bezier interpolation. This algorithm looks for the interpolation value that can be passed as t to the bezier interpolator method by analysing the time axis and doing a binary search. As you couldn't already tell, that is slow as hell. Someone MIGHT have a clue how to speed bezier interpolation up by eliminating this.

Definition at line 80 of file InterpolationPolicyFloat.h.

static void qsf::InterpolationPolicy< float >::bezierInterpolation ( const float &  from,
const float &  cp0,
const float &  cp1,
const float &  to,
float  t,
float &  out 
)
inlinestatic

Really simple bezier interpolation algorithm in here. This one could be improved by A LOT in terms of performance.

Parameters
fromThe first point to interpolate from, reached at t=0
cp0The value of the control point next to the first point
cp1The value of the second control point, just before the second point
toThe second (target) point reached at t=1
tThe interpolation vector in the range of [0.0f, 1.0f]
[out]outInterpolated value is written to that point
Todo:
  • TODO(oi) Have some smart mathematician improve performance of this algorithm

Definition at line 54 of file InterpolationPolicyFloat.h.

static void qsf::InterpolationPolicy< float >::interpolate ( const float &  from,
const float &  to,
float  t,
float &  out 
)
inlinestatic

Definition at line 29 of file InterpolationPolicyFloat.h.


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