template<class VectorConverter, MotiveDimension kDimensionsParam>
class motive::MotivatorXfTemplate< VectorConverter, kDimensionsParam >
Animate a vector of floating-point values.
Wraps MotivatorNf to return by value, instead of using out arrays. For kDimension = 1, the vector type is just float. For kDimension > 1, the vector type is determined by VectorConverter. We use MathFuVectorConverter below to create 2, 3, and 4 dimensional motivators (see Motivator2f, Motivator3f, and Motivator4f). You can use your own VectorConverter to create Motivators of that match your vector types.
|
| | MotivatorXfTemplate () |
| |
| | MotivatorXfTemplate (const MotivatorInit &init, MotiveEngine *engine) |
| |
| | MotivatorXfTemplate (const MotivatorInit &init, MotiveEngine *engine, const Target &t) |
| |
|
void | Initialize (const MotivatorInit &init, MotiveEngine *engine) |
| | Initialize to the motion algorithm specified by init.
|
| |
| void | InitializeWithTarget (const MotivatorInit &init, MotiveEngine *engine, const Target &t) |
| |
| void | InitializeWithTargetShape (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions, const MotiveCurveShape &shape, const Vec &target_values, const Vec &target_velocities) |
| |
| Vec | Value () const |
| |
| Vec | Velocity () const |
| |
| Vec | Direction () const |
| |
| Vec | TargetValue () const |
| |
| Vec | TargetVelocity () const |
| |
| Vec | Difference () const |
| |
| void | SetTarget (const Target &t) |
| |
| void | SetTargetWithShape (const Vec &target_value, const Vec &target_velocity, const MotiveCurveShape &shape) |
| |
|
MotiveDimension | Dimensions () const |
| |
| | MotivatorNf () |
| |
| | MotivatorNf (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions) |
| |
| | MotivatorNf (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions, const MotiveTarget1f *ts) |
| |
| void | Initialize (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions) |
| |
| void | InitializeWithTargets (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions, const MotiveTarget1f *targets) |
| |
| void | InitializeWithTargetShape (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions, const MotiveCurveShape &shape, const float *target_values, const float *target_velocities) |
| |
| void | InitializeWithSplines (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions, const CompactSpline *splines, const SplinePlayback &playback) |
| |
|
const float * | Values () const |
| |
|
void | Velocities (float *out) const |
| |
|
void | Directions (float *out) const |
| |
|
void | TargetValues (float *out) const |
| |
|
void | TargetVelocities (float *out) const |
| |
|
void | Differences (float *out) const |
| |
| MotiveTime | TargetTime () const |
| |
|
MotiveCurveShape | MotiveShape () const |
| | Returns the shape of the current curve.
|
| |
| MotiveTime | SplineTime () const |
| |
| void | Splines (const CompactSpline **splines) const |
| |
| void | SetSpline (const CompactSpline &spline, const SplinePlayback &playback) |
| |
| void | SetSplines (const CompactSpline *splines, const SplinePlayback &playback) |
| |
| void | SetSplineTime (MotiveTime time) |
| |
| void | SetSplinePlaybackRate (float playback_rate) |
| |
| void | SetTargets (const MotiveTarget1f *targets) |
| |
| void | SetTargetWithShape (const float *target_values, const float *target_velocities, const MotiveCurveShape &shape) |
| |
| void | SetSplinesAndTargets (const CompactSpline *const *splines, const SplinePlayback &playback, const MotiveTarget1f *targets) |
| |
| | Motivator (const Motivator &original) |
| |
| Motivator & | operator= (const Motivator &original) |
| |
|
| ~Motivator () |
| | Remove ourselves from the MotiveProcessor when we're deleted.
|
| |
| void | Invalidate () |
| |
| bool | Valid () const |
| |
| bool | Sane () const |
| |
| MotivatorType | Type () const |
| |
| MotiveDimension | Dimensions () const |
| |
template<class VectorConverter , MotiveDimension kDimensionsParam>
Set the target and (optionally the current) motivator values. Use this call to procedurally drive the Motivator towards a specific target. The Motivator will transition smoothly to the new target. You can change the target value every frame if you like, and the Motivator value should behave calmly but responsively, with the movement qualities of the underlying MotiveProcessor. Note that the underlying MotiveProcessor is allowed to ignore parts of t that are irrelevent to its algorithm. Note also that if the time needed to achieve a value is to be user-provided, this function should be used. If the time should be calculated instead of user-specified, SetTargetWithShape should be used instead.
- Parameters
-
| t | A set of waypoints to hit, optionally including the current value. If the current value is not included, maintain the existing current value. |
template<class VectorConverter , MotiveDimension kDimensionsParam>
Set the target values, velocity, and curve shape for the motivator. Use this call to procedurally drive the Motivator towards that target. Setting the target with the shape makes it so that a time does not need to be specified, as it will be calculated. In contrast, if the time needed to achieve a value is to be user-provided, SetTarget should be used instead.
- Parameters
-
| target_value | The target value to hit. |
| target_velocity | The velocity with which to hit the target value. |
| shape | The shape of the curve we'll create, such as the curve's typical delta value, typical total time, and bias. |