Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
motive::MotivatorNf Class Reference
Inheritance diagram for motive::MotivatorNf:
motive::Motivator motive::MotivatorXfTemplate< VectorConverter, kDimensionsParam >

Public Member Functions

 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)
 
- Public Member Functions inherited from motive::Motivator
 Motivator (const Motivator &original)
 
Motivatoroperator= (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
 

Protected Member Functions

MotiveProcessorNfProcessor ()
 
const MotiveProcessorNfProcessor () const
 
- Protected Member Functions inherited from motive::Motivator
 Motivator (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions)
 
void InitializeWithDimension (const MotivatorInit &init, MotiveEngine *engine, MotiveDimension dimensions)
 
void Init (MotiveProcessor *processor, MotiveIndex index)
 These should only be called by MotiveProcessor!
 
void Reset ()
 
const MotiveProcessorProcessor () const
 

Additional Inherited Members

- Protected Attributes inherited from motive::Motivator
MotiveProcessorprocessor_
 
MotiveIndex index_
 

Constructor & Destructor Documentation

motive::MotivatorNf::MotivatorNf ( )
inline

Motivator is created in a reset state. When in the reset state, it is not being driven, and Value(), Velocity(), etc. cannot be called.

motive::MotivatorNf::MotivatorNf ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions 
)
inline

Initialize to the motion algorithm specified by init. Current and target values are not set.

motive::MotivatorNf::MotivatorNf ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions,
const MotiveTarget1f ts 
)
inline

Initialize to the motion algorithm specified by init. Set current and target values as specified by ts.

Member Function Documentation

void motive::MotivatorNf::Initialize ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions 
)
inline

Initialize this Motivator to the type specified in init.type.

Parameters
initDefines the type and initial state of the Motivator.
engineThe engine that will update this Motivator when engine->AdvanceFrame() is called.
dimensionsThe number of slots to occupy. For example, a 3D position would occupy three slots.
void motive::MotivatorNf::InitializeWithSplines ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions,
const CompactSpline splines,
const SplinePlayback playback 
)
inline

Initialize to the motion algorithm specified by init. Set movement to follow the curves specified in splines, an array of length dimensions, and modified byplayback`.

void motive::MotivatorNf::InitializeWithTargets ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions,
const MotiveTarget1f targets 
)
inline

Initialize to the motion algorithm specified by init. Set current and target values as specified by targets, an array of length dimensions.

void motive::MotivatorNf::InitializeWithTargetShape ( const MotivatorInit init,
MotiveEngine engine,
MotiveDimension  dimensions,
const MotiveCurveShape shape,
const float *  target_values,
const float *  target_velocities 
)
inline

Initialize to the motion algorithm specified by init. Set target values and velocities as specified by 'target_values' and 'target_velocities', arrays of length dimensions, with shape specified by 'shape'.

void motive::MotivatorNf::SetSpline ( const CompactSpline spline,
const SplinePlayback playback 
)
inline

Follow the curve specified in spline. Overrides the existing current value.

Parameters
splineThe spline to follow. Array of length Dimensions().
playbackThe time into the splines to initiate playback, the blend time to the splines, and whether to repeat from the beginning after the end of the spline is reached.
void motive::MotivatorNf::SetSplinePlaybackRate ( float  playback_rate)
inline

Set rate at which we consume the spline set in SetSpline(). 0 ==> paused 0.5 ==> half speed (slow motion) 1 ==> authored speed 2 ==> double speed (fast forward)

void motive::MotivatorNf::SetSplines ( const CompactSpline splines,
const SplinePlayback playback 
)
inline

Follow the curves specified in splines. Overrides the existing current value.

Parameters
splinesThe splines that the curves should follow. Array of length Dimensions().
playbackThe time into the splines to initiate playback, the blend time to the splines, and whether to repeat from the beginning after the end of the spline is reached.
void motive::MotivatorNf::SetSplinesAndTargets ( const CompactSpline *const *  splines,
const SplinePlayback playback,
const MotiveTarget1f targets 
)
inline

Drive some channels with splines and others with targets. For i between 0 and Dimensions()-1, if splines[i] != NULL drive channel i with splines[i]. Otherwise, drive channel i with targets[i].

Parameters
splinesArray of pointers to splines, length Dimensions(). Pointers can be NULL.
playbackVarious parameters for splines.
targetsArray of targets that are used when splines are not specified. Length Dimensions().
void motive::MotivatorNf::SetSplineTime ( MotiveTime  time)
inline

Seek to a specific time in the spline.

Parameters
timeThe time (in the spline's x-axis) to seek to.
void motive::MotivatorNf::SetTargets ( const MotiveTarget1f targets)
inline

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.

Parameters
targetsThe targets that each value should achieve. An array of length Dimensions().
void motive::MotivatorNf::SetTargetWithShape ( const float *  target_values,
const float *  target_velocities,
const MotiveCurveShape shape 
)
inline

Set the target values, velocities, and curve shape for the motivator. Procedurally drive the Motivator to 'target_values' and 'target_velocities' following a curve defined by 'shape'. 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_valueArray of target values with length Dimensions.
target_velocityArray of target velocities with length Dimensions.
shapeThe shape of the curve we'll create, as determined by the curve's typical delta value, typical total time, and bias.
void motive::MotivatorNf::Splines ( const CompactSpline **  splines) const
inline

Gather pointers to the splines currently being played, on each dimension.

Parameters
splinesOutput array of length Dimensions().
MotiveTime motive::MotivatorNf::SplineTime ( ) const
inline

Returns the current time (i.e. the x-value) in the current spline. If Motivator is not being driven by a spline, returns 0. Whenever SetSpline() is called, this value will be reset to the start_time specified in SplinePlayback. Every time MotiveEngine::AdvanceFrame() is called, it will increment by delta_time * playback_rate. If the SplinePlayback has repeat=true, then SplineTime() will periodically loop back to time 0.

MotiveTime motive::MotivatorNf::TargetTime ( ) const
inline

Returns time remaining until target is reached. The unit of time is determined by the calling program.


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