|
Motive Animation System
An open source project by
FPL.
|
Set the current and/or target state for a one-dimensional Motivator. More...
#include <target.h>
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 MotiveNode1f & | Node (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 MotiveTarget1f * | targets () const |
Static Public Attributes | |
| static const int | kMaxNodes = 3 |
|
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.
|
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.
|
inline |
Create with three waypoints. 0 <= n0.time < n1.time < n2.time
|
inline |
Return nth waypoint.
| node_index | nth waypoint. 0 <= node_index < num_nodes() |
|
inline |
Return smallest range that covers the values of all waypoints.
| start_value | An extra value to include in the min/max calculation. Most often is the current value of the Motivator1f. |