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

Initialize a MotivatorNf move towards a target using spring physics. More...

#include <init.h>

Inheritance diagram for motive::OvershootInit:
motive::MotivatorInit

Detailed Description

Initialize a MotivatorNf move towards a target using spring physics.

Call MotivatorNf::SetTargets() to set the target that we swing towards. The name comes from the movement overshooting the target then coming back, the way a dampened oscillator overshoots its resting point.

Public Member Functions

 MOTIVE_INTERFACE ()
 
float ClampVelocity (float velocity) const
 Ensure velocity is within the reasonable limits.
 
float ClampDelta (float delta) const
 
bool AtTarget (float dist, float velocity) const
 
const Rangerange () const
 
void set_range (const Range &r)
 
bool modular () const
 
void set_modular (bool modular)
 
float max_velocity () const
 
float max_delta () const
 
const Settled1fat_target () const
 
Settled1fat_target ()
 
float accel_per_difference () const
 
float wrong_direction_multiplier () const
 
MotiveTime max_delta_time () const
 
void set_max_velocity (float max_velocity)
 
void set_max_delta (float max_delta)
 
void set_at_target (const Settled1f &at_target)
 
void set_accel_per_difference (float accel_per_difference)
 
void set_wrong_direction_multiplier (float wrong_direction_multiplier)
 
void set_max_delta_time (MotiveTime max_delta_time)
 
- Public Member Functions inherited from motive::MotivatorInit
 MotivatorInit (MotivatorType type)
 The derived class's constructor should set 'type'.
 
MotivatorType type () const
 
void set_type (MotivatorType type)
 

Member Function Documentation

bool motive::OvershootInit::AtTarget ( float  dist,
float  velocity 
) const
inline

Return true if we're close to the target and almost stopped. The definition of "close to" and "almost stopped" are given by the "at_target" member.

float motive::OvershootInit::ClampDelta ( float  delta) const
inline

Ensure the Motivator's 'value' doesn't increment by more than 'max_delta'. This is different from ClampVelocity because it is independent of time. No matter how big the timestep, the delta will not be too great.


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