Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
motive::QuadraticEaseInEaseOut Class Reference

Represent a curve containing an ease in and ease out quadratic curve. More...

#include <curve_util.h>

Detailed Description

Represent a curve containing an ease in and ease out quadratic curve.

This class parameterizes two curves: ease-in followed by ease-out. The ease-in curve ends after intersection_x, and the ease-out curve matches the ease-in curve's value and derivative at that x. The ease-in curve begins at x = 0. The ease-out curve ends at x = total_x.

Public Member Functions

 QuadraticEaseInEaseOut (const QuadraticCurve &in, const QuadraticCurve &out, float intersection_x, float total_x)
 
 QuadraticEaseInEaseOut (const QuadraticCurve &in, float end_x)
 
float Evaluate (float x) const
 Return the curve's value at x.
 
float Derivative (float x) const
 Return the curve's derivative at 'x'.
 
float SecondDerivative (float x) const
 
float ThirdDerivative (float x) const
 
float intersection_x () const
 Return the x at which in_curve and out_curve intersect.
 
float total_x () const
 Return the x where the curve reaches its end_value.
 
const QuadraticCurvein_curve () const
 Return the in_curve.
 
const QuadraticCurveout_curve () const
 Return the out_curve.
 
const QuadraticCurveCurve (float x) const
 
bool operator== (const QuadraticEaseInEaseOut &rhs) const
 Equality. Checks for exact match. Useful for testing.
 
bool operator!= (const QuadraticEaseInEaseOut &rhs) const
 

Member Function Documentation

const QuadraticCurve& motive::QuadraticEaseInEaseOut::Curve ( float  x) const
inline

Return either the in_curve or the out_curve, depending on if x is before or after intersection_x.

float motive::QuadraticEaseInEaseOut::SecondDerivative ( float  x) const
inline

Return the curve's second derivative at 'x' using either the in_curve or out_curve.

float motive::QuadraticEaseInEaseOut::ThirdDerivative ( float  x) const
inline

Return the quadratic function's third derivative: 0. Even though x is unused, we pass it in for consistency with other curve classes.


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