|
Motive Animation System
An open source project by
FPL.
|
Drive a 4x4 float matrix from a series of basic transformations. More...
#include <motivator.h>
Drive a 4x4 float matrix from a series of basic transformations.
The underlying basic transformations can be animated with SetChildTarget1f(), and set to fixed values with SetChildValue1f() and SetChildValue3f().
Internally, we use mathfu::mat4 as our matrix type and mathfu::vec3 as our vector type, but external we allow any matrix type to be specified via the VectorConverter template parameter.
Public Types | |
| typedef VectorConverter | C |
| typedef VectorConverter::Matrix4 | Mat4 |
| typedef VectorConverter::Vector3 | Vec3 |
| typedef MotivatorXfTemplate< C, 1 > | Mot1f |
Public Member Functions | |
| MatrixMotivator4fTemplate (const MotivatorInit &init, MotiveEngine *engine) | |
| void | Initialize (const MotivatorInit &init, MotiveEngine *engine) |
Initialize to the type specified by init. | |
| const Mat4 & | Value () const |
| Vec3 | Position () const |
| MotiveTime | TimeRemaining () const |
| int | NumChildren () const |
| float | ChildValue1f (MotiveChildIndex child_index) const |
| Vec3 | ChildValue3f (MotiveChildIndex child_index) const |
| const Mot1f * | ChildMotivator1f (MotiveChildIndex child_index) const |
| void | SetChildTarget1f (MotiveChildIndex child_index, const MotiveTarget1f &t) |
| void | SetChildValue1f (MotiveChildIndex child_index, float value) |
| void | SetChildValue3f (MotiveChildIndex child_index, const Vec3 &value) |
| void | BlendToOps (const MatrixOpArray &ops, const SplinePlayback &playback) |
| void | SetPlaybackRate (float playback_rate) |
Public Member Functions inherited from motive::Motivator | |
| 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 |
Additional Inherited Members | |
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 MotiveProcessor * | Processor () const |
Protected Attributes inherited from motive::Motivator | |
| MotiveProcessor * | processor_ |
| MotiveIndex | index_ |
|
inline |
Match existing MatrixOps with those in ops and smoothly transition to the new parameters in ops.
|
inline |
Returns the Motivator1f that's driving this child, if it's driven by a Motivator1f. Otherwise, returns nullptr.
|
inline |
Return the current value of the child_indexth basic transform that drives this matrix.
| child_index | The index into MatrixInit::ops(). The ops() array is a series of basic transformation operations that compose this matrix. Each basic transformation has a current value. We gather this value here. |
|
inline |
Returns the current values of the basic transforms at indices (child_index, child_index + 1, child_index + 2). Useful when you drive all the (x,y,z) components of a translation, scale, or rotation.
| child_index | The first index into MatrixInit::ops(). The value at this index is returned in the x component of Vec3. y gets child_index + 1's value, and z gets child_index + 2's value. |
|
inline |
Query the number of matrix operations. This equals the number of operations in the init initializer.
|
inline |
Return the translation component of the matrix. The matrix is a 3D affine transform, so the translation component is the fourth column.
|
inline |
Set the target the 'child_index'th basic transform. Each basic transform can be driven by a child motivator. This call lets us control those child motivators.
| child_index | The index into the MatrixInit::ops() that was passed into Initialize(). This operation must have been initialized with a MotivatorInit, not a constant value. |
| t | The target values for the basic transform to animate towards. Also, optionally, the current value for it to jump to. |
|
inline |
Set the constant value of a child. Each basic matrix transformation can be driven by a constant value instead of a Motivator. This call lets us set those constant values.
| child_index | The index into the MatrixInit::ops() that was passed into Initialize(). This operation must have been initialized with a constant value, not a MotivatorInit. |
| value | The new constant value of this operation. |
|
inline |
Set the constant values of the basic transforms at indices (child_index, child_index + 1, child_index + 2).
| child_index | The first index into MatrixInit::ops(). The constant value at this index is set to the x component of value. child_index + 1's constant is set to value.y, and child_index + 2's constant is set to value.z. |
| value | The new constant value for this 3-dimensional operation. |
|
inline |
Return the time remaining in the current spline animation. Time units are defined by the user.
|
inline |
Return the current value of the Motivator. The processor returns a vector-aligned matrix, so the cast should be valid for any user-defined matrix type.