Motive Animation System
An open source project by FPL.
 All Classes Functions Variables Typedefs Friends Pages
motive::SimpleProcessorTemplate< T > Class Template Reference
Inheritance diagram for motive::SimpleProcessorTemplate< T >:
motive::MotiveProcessorNf motive::MotiveProcessor

Public Member Functions

virtual const float * Values (MotiveIndex index) const
 
virtual void Velocities (MotiveIndex index, MotiveDimension dimensions, float *out) const
 
virtual void TargetValues (MotiveIndex index, MotiveDimension dimensions, float *out) const
 
virtual void TargetVelocities (MotiveIndex index, MotiveDimension dimensions, float *out) const
 
virtual void Differences (MotiveIndex index, MotiveDimension dimensions, float *out) const
 
virtual MotiveTime TargetTime (MotiveIndex index, MotiveDimension dimensions) const
 
- Public Member Functions inherited from motive::MotiveProcessorNf
float Value (MotiveIndex index) const
 
float Velocity (MotiveIndex index) const
 
float Direction (MotiveIndex index) const
 
float TargetValue (MotiveIndex index) const
 
float TargetVelocity (MotiveIndex index) const
 
float Difference (MotiveIndex index) const
 
virtual void Directions (MotiveIndex index, MotiveDimension dimensions, float *out) const
 
virtual MotiveTime SplineTime (MotiveIndex) const
 
virtual MotiveCurveShape MotiveShape (MotiveIndex) const
 
virtual void SetTargets (MotiveIndex, MotiveDimension, const MotiveTarget1f *)
 
virtual void SetTargetWithShape (MotiveIndex, MotiveDimension, const float *, const float *, const MotiveCurveShape &)
 
virtual void SetSplines (MotiveIndex, MotiveDimension, const CompactSpline *, const SplinePlayback &)
 
virtual void Splines (MotiveIndex, MotiveIndex count, const CompactSpline **splines) const
 
virtual void SetSplinesAndTargets (MotiveIndex, MotiveDimension, const CompactSpline *const *, const SplinePlayback &, const MotiveTarget1f *)
 
virtual void SetSplineTime (MotiveIndex, MotiveDimension, MotiveTime)
 
virtual void SetSplinePlaybackRate (MotiveIndex, MotiveDimension, float)
 
- Public Member Functions inherited from motive::MotiveProcessor
void InitializeMotivator (const MotivatorInit &init, MotiveEngine *engine, Motivator *motivator, MotiveDimension dimensions)
 
void RemoveMotivator (MotiveIndex index)
 
void TransferMotivator (MotiveIndex index, Motivator *new_motivator)
 
bool IsMotivatorIndex (MotiveIndex index) const
 
bool ValidIndex (MotiveIndex index) const
 
bool ValidMotivatorIndex (MotiveIndex index) const
 
bool ValidMotivator (MotiveIndex index, const Motivator *motivator) const
 
virtual void AdvanceFrame (MotiveTime delta_time)=0
 
virtual MotivatorType Type () const =0
 
virtual int Priority () const =0
 
MotiveDimension Dimensions (MotiveIndex index) const
 
void VerifyInternalState () const
 
void RegisterBenchmarks ()
 
int benchmark_id_for_advance_frame () const
 
int benchmark_id_for_init () const
 

Protected Member Functions

virtual void InitializeIndices (const MotivatorInit &init, MotiveIndex index, MotiveDimension dimensions, MotiveEngine *)
 
virtual void RemoveIndices (MotiveIndex index, MotiveDimension dimensions)
 
virtual void MoveIndices (MotiveIndex old_index, MotiveIndex new_index, MotiveDimension dimensions)
 
virtual void SetNumIndices (MotiveIndex num_indices)
 
const T & Data (MotiveIndex index) const
 
T & Data (MotiveIndex index)
 
- Protected Member Functions inherited from motive::MotiveProcessor
void Defragment ()
 

Protected Attributes

std::vector< T > data_
 
std::vector< float > values_
 

Member Function Documentation

template<class T >
virtual void motive::SimpleProcessorTemplate< T >::InitializeIndices ( const MotivatorInit init,
MotiveIndex  index,
MotiveDimension  dimensions,
MotiveEngine engine 
)
inlineprotectedvirtual

Initialize data at [index, index + dimensions). The meaning of index is determined by the MotiveProcessor implementation (most likely it is the index into one or more data_ arrays though). MotiveProcessor tries to keep the index as low as possible, by recycling ones that have been freed, and by providing a Defragment() function to move later indices to indices that have been freed.

Implements motive::MotiveProcessor.

template<class T >
virtual void motive::SimpleProcessorTemplate< T >::MoveIndices ( MotiveIndex  old_index,
MotiveIndex  new_index,
MotiveDimension  dimensions 
)
inlineprotectedvirtual

Move the data chunk of length dimensions from old_index into new_index. Used by Defragment(). Note that the index range starting at new_index is guaranteed to be inactive.

Implements motive::MotiveProcessor.

template<class T >
virtual void motive::SimpleProcessorTemplate< T >::RemoveIndices ( MotiveIndex  index,
MotiveDimension  dimensions 
)
inlineprotectedvirtual

Reset data at [index, index + dimensions). See comment above InitializeIndex for meaning of index. If your MotiveProcessor stores data in a plain array, you probably have nothing to do. But if you use dynamic memory per index, (which you really shouldn't - too slow!), you should deallocate it here. For debugging, it might be nice to invalidate the data.

Implements motive::MotiveProcessor.

template<class T >
virtual void motive::SimpleProcessorTemplate< T >::SetNumIndices ( MotiveIndex  num_indices)
inlineprotectedvirtual

Increase or decrease the total number of indices. If decreased, existing indices >= num_indices should be uninitialized. If increased, internal arrays should be extended to new_indices, and new items in the arrays should be initialized as reset.

Implements motive::MotiveProcessor.


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