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

Set the current and/or target state for a one-dimensional Motivator. More...

#include <target.h>

Detailed Description

Set the current and/or target state for a one-dimensional Motivator.

A series of waypoints through which we animate. If the first waypoint has time = 0, the current value and velocity jumps to that waypoint's value and velocity.

MotiveTarget1fs are most easily created with the utility functions below, for example Current1f, Target1f, CurrentToTarget1f.

If the current value and velocity are not specified (i.e. if the first waypoint has time > 0), then the current value and velocity in the Motivator are maintained.

If the target is not specified (i.e. only one waypoint which has time = 0), then the current value is set as specified, and the velocity is set to 0.

Public Member Functions

 MotiveTarget1f (const MotiveNode1f &n0)
 
 MotiveTarget1f (const MotiveNode1f &n0, const MotiveNode1f &n1)
 
 MotiveTarget1f (const MotiveNode1f &n0, const MotiveNode1f &n1, const MotiveNode1f &n2)
 
void Reset ()
 Empty the target of all waypoints.
 
const MotiveNode1fNode (int node_index) const
 
motive::Range ValueRange (float start_value) const
 
MotiveTime EndTime () const
 Return time of the last waypoint.
 
int num_nodes () const
 
const MotiveTarget1ftargets () const
 

Static Public Attributes

static const int kMaxNodes = 3
 

Constructor & Destructor Documentation

motive::MotiveTarget1f::MotiveTarget1f ( const MotiveNode1f n0)
inlineexplicit

Create with only one waypoint. If n0.time = 0, set the current value and velocity. If n0.time > 0, maintain the current value and velocity and animate to n0's value and velocity in n0.time.

motive::MotiveTarget1f::MotiveTarget1f ( const MotiveNode1f n0,
const MotiveNode1f n1 
)
inline

Create with two waypoints. Can be current to target, if n0.time = 0. Or can maintain the current and to through two targets: first n0, then n1. Precondition: n0.time < n1.time.

motive::MotiveTarget1f::MotiveTarget1f ( const MotiveNode1f n0,
const MotiveNode1f n1,
const MotiveNode1f n2 
)
inline

Create with three waypoints. 0 <= n0.time < n1.time < n2.time

Member Function Documentation

const MotiveNode1f& motive::MotiveTarget1f::Node ( int  node_index) const
inline

Return nth waypoint.

Parameters
node_indexnth waypoint. 0 <= node_index < num_nodes()
motive::Range motive::MotiveTarget1f::ValueRange ( float  start_value) const
inline

Return smallest range that covers the values of all waypoints.

Parameters
start_valueAn extra value to include in the min/max calculation. Most often is the current value of the Motivator1f.

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