Emergency 20 Dokumentation  4.1.0
Static Public Member Functions | List of all members
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)
 

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 analyzing 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.
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
static void qsf::InterpolationPolicy< float >::interpolate ( const float &  from,
const float &  to,
float  t,
float &  out 
)
inlinestatic

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