V-ART
Public Member Functions | Protected Attributes | List of all members
VART::NaturalInterpolator Class Reference

An interpolator for natural joint movement. More...

#include <naturalinterpolator.h>

Inheritance diagram for VART::NaturalInterpolator:
VART::SineInterpolator VART::Interpolator

Public Member Functions

 NaturalInterpolator ()
 Creates an unitialized natural interpolator. More...
 
 NaturalInterpolator (float offsetLevel, float overshootLevel)
 
virtual float GetValue (float linearIndex, float initialValue, float range) const
 Evaluates a goal position for DOF interpolation. More...
 
void SetOffset (float value)
 
float GetOffset ()
 
void SetOvershoot (float value)
 
float GetOvershoot ()
 
void SetNoise (float newNoiseAmplitude, float newNoiseWaveLenght)
 
- Public Member Functions inherited from VART::SineInterpolator
 SineInterpolator ()
 
virtual TypeID GetID () const
 
- Public Member Functions inherited from VART::Interpolator
 Interpolator ()
 
virtual ~Interpolator ()
 

Protected Attributes

float offset
 how much to miss the target More...
 
float overshoot
 how much to pass the target before correction More...
 
float peakTime
 Overshoot time. More...
 
float noiseAmplitude
 Noise amplitude (noise level) More...
 
float noiseWaveLenght
 Noise wave length. More...
 

Additional Inherited Members

- Public Types inherited from VART::Interpolator
enum  TypeID { LINEAR, EASE_IN_EASE_OUT, RANGED, HERMITE }
 

Detailed Description

An interpolator for natural joint movement.

Natural Interpolators provide an ease-in ease-out interpolator with noise, overshoot and offset.

Definition at line 18 of file naturalinterpolator.h.

Constructor & Destructor Documentation

VART::NaturalInterpolator::NaturalInterpolator ( )

Creates an unitialized natural interpolator.

Definition at line 24 of file naturalinterpolator.cpp.

VART::NaturalInterpolator::NaturalInterpolator ( float  offsetLevel,
float  overshootLevel 
)

Definition at line 28 of file naturalinterpolator.cpp.

Member Function Documentation

float VART::NaturalInterpolator::GetOffset ( )
inline

Definition at line 26 of file naturalinterpolator.h.

References offset.

float VART::NaturalInterpolator::GetOvershoot ( )
inline

Definition at line 28 of file naturalinterpolator.h.

References overshoot.

float VART::NaturalInterpolator::GetValue ( float  linearIndex,
float  initialPos,
float  range 
) const
virtual

Evaluates a goal position for DOF interpolation.

Parameters
linearIndex[in] A number in range [0..1]. Usually related to a linear time function.
initialPos[in] A number in range [0..1]. DOF's initial movement position.
range[in] DOF's position range on movement.
Returns
DOF's current position. An interpolator basically converts a linear interpolation (GetValue input) into other, more sophisticated interpolation (GetValue output). Each derived class implents a specific mapping.

Reimplemented from VART::SineInterpolator.

Definition at line 67 of file naturalinterpolator.cpp.

void VART::NaturalInterpolator::SetNoise ( float  newNoiseAmplitude,
float  newNoiseWaveLenght 
)

Definition at line 35 of file naturalinterpolator.cpp.

void VART::NaturalInterpolator::SetOffset ( float  value)
inline

Definition at line 25 of file naturalinterpolator.h.

References offset.

void VART::NaturalInterpolator::SetOvershoot ( float  value)
inline

Definition at line 27 of file naturalinterpolator.h.

References overshoot.

Member Data Documentation

float VART::NaturalInterpolator::noiseAmplitude
protected

Noise amplitude (noise level)

Definition at line 48 of file naturalinterpolator.h.

float VART::NaturalInterpolator::noiseWaveLenght
protected

Noise wave length.

Time space between randoms in DOF's normalized time.

Definition at line 52 of file naturalinterpolator.h.

float VART::NaturalInterpolator::offset
protected

how much to miss the target

On a natural interpolator, values go from zero to 1+offset, creating positioning errors that may help creating natural movements.

Definition at line 37 of file naturalinterpolator.h.

Referenced by GetOffset(), and SetOffset().

float VART::NaturalInterpolator::overshoot
protected

how much to pass the target before correction

On a natural interpolator, values may pass the desired target and then fall back to the target position. This may help creating an effect associated with inertia.

Definition at line 42 of file naturalinterpolator.h.

Referenced by GetOvershoot(), and SetOvershoot().

float VART::NaturalInterpolator::peakTime
protected

Overshoot time.

Peak time is the (normalized) time of maximum overshoot error.

Definition at line 46 of file naturalinterpolator.h.


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