Animation for a RigMotivator. Drives a fully rigged model.
More...
#include <anim.h>
Animation for a RigMotivator. Drives a fully rigged model.
| const std::string& motive::RigAnim::anim_name |
( |
| ) |
const |
|
inline |
For debugging. The name of the animation currently being played. Only valid if record_names is true in Init().
| const BoneIndex* motive::RigAnim::bone_parents |
( |
| ) |
const |
|
inline |
| const char* motive::RigAnim::BoneName |
( |
BoneIndex |
idx | ) |
const |
|
inline |
For debugging. If record_names was specified in Init(), the names of the bones are stored. Very useful when an animation is applied to a mesh that doesn't match: with the bone names you can determine whether the mesh or the animation is out of date.
| std::string motive::RigAnim::CsvHeaderForDebugging |
( |
int |
line | ) |
const |
Output a line of comma-separated-values that has header information for the CSV data output by RigMotivator::CsvValues().
| MotiveTime motive::RigAnim::end_time |
( |
| ) |
const |
|
inline |
Amount of time required by this animation. Time units are set by the caller. If animation repeats, returns infinity. TODO: Add function to return non-repeated end time, even when repeatable.
| void motive::RigAnim::GetSplinesAndConstants |
( |
BoneIndex |
bone, |
|
|
const MatrixOperationType * |
ops, |
|
|
int |
num_ops, |
|
|
const CompactSpline ** |
splines, |
|
|
float * |
constants |
|
) |
| const |
Gets the splines and constants that drive the operations in ops, for the specified bone. If an operation is not driven by the bone, return the default value for that op in constants.
If the bone has multiple operations that match ops[i], return the first one.
- Parameters
-
| bone | The bone whose operations you want to pull data for. |
| ops | And array of length num_ops with the operations you're interested in. num_ops Length of the ops array. splines Output array, length num_ops. For each element of ops, receives the driving spline, or nullptr if that operation is not driven by a spline. constants Output array, length num_ops. For each element of ops, receives the constant value of that operation, if no spline drives that operation. |
| void motive::RigAnim::Init |
( |
const char * |
anim_name, |
|
|
BoneIndex |
num_bones, |
|
|
bool |
record_names |
|
) |
| |
Initialize the basic data. After calling this function, InitMatrixAnim() should be called once for every bone in the animation.
| MatrixAnim& motive::RigAnim::InitMatrixAnim |
( |
BoneIndex |
idx, |
|
|
BoneIndex |
parent, |
|
|
const char * |
bone_name |
|
) |
| |
For construction. Return the idxth bone's animation for initialization.
- Parameters
-
| idx | The bone whose animation you want to initialize. |
| parent | If no parent exists, pass in kInvalidBoneIdx. |
| bone_name | For debugging. Recorded if record_names was true in Init(). |
| BoneIndex motive::RigAnim::NumBones |
( |
| ) |
const |
|
inline |
Number of bones. Bones are arranged in an hierarchy. Each bone animates a matrix. The matrix describes the transform of the bone from its parent.
| int motive::RigAnim::NumCsvHeaderLines |
( |
| ) |
const |
|
inline |
For debugging. The number of lines in the header. You call them separately in case you want to prefix or append extra columns.
| bool motive::RigAnim::repeat |
( |
| ) |
const |
|
inline |
Animation is repeatable. That is, when the end of the animation is reached, it can be started at the beginning again without glitching. Generally, an animation is repeatable if it's curves have the same values and derivatives at the start and end.
| void motive::RigAnim::set_end_time |
( |
MotiveTime |
t | ) |
|
|
inline |
For construction. The end time should be set to the maximal end time of all the anims_.
The documentation for this class was generated from the following file: