Utility class to build Assimp animations from LWO envelopes.
More...
|
void | ClearAnimRangeSetup () |
| Delete all keys which we inserted to match anim setup. More...
|
|
void | DoInterpolation (std::vector< LWO::Key >::const_iterator cur, LWO::Envelope *envl, double time, float &fill) |
| Resolve a single animation key by applying the right interpolation to it. More...
|
|
void | DoInterpolation2 (std::vector< LWO::Key >::const_iterator beg, std::vector< LWO::Key >::const_iterator end, double time, float &fill) |
| Almost the same, except we won't handle pre/post conditions here. More...
|
|
void | GetKeys (std::vector< aiVectorKey > &out, LWO::Envelope *envl_x, LWO::Envelope *envl_y, LWO::Envelope *envl_z, unsigned int flags) |
| Build linearly subsampled keys from 3 single envelopes. More...
|
|
void | InterpolateTrack (std::vector< aiVectorKey > &out, aiVectorKey &key_out, double time) |
| Interpolate 2 tracks if one is given. More...
|
|
void | SubsampleAnimTrack (std::vector< aiVectorKey > &out, double time, double sample_delta) |
| Subsample an animation track by a given sampling rate. More...
|
|
void | UpdateAnimRangeSetup () |
| Insert extra keys to match LWO's pre and post behaviours in a given time range [first...last]. More...
|
|
Utility class to build Assimp animations from LWO envelopes.
Used for both LWO and LWS (MOT also).
§ AnimResolver()
AnimResolver::AnimResolver |
( |
std::list< Envelope > & |
envelopes, |
|
|
double |
tick |
|
) |
| |
Construct an AnimResolver from a given list of envelopes.
- Parameters
-
envelopes | Input envelopes. May be empty. |
Output | tick rate, per second |
- Note
- The input envelopes are possibly modified.
§ ClearAnimRangeSetup()
void AnimResolver::ClearAnimRangeSetup |
( |
| ) |
|
|
protected |
Delete all keys which we inserted to match anim setup.
§ DoInterpolation()
void AnimResolver::DoInterpolation |
( |
std::vector< LWO::Key >::const_iterator |
cur, |
|
|
LWO::Envelope * |
envl, |
|
|
double |
time, |
|
|
float & |
fill |
|
) |
| |
|
protected |
Resolve a single animation key by applying the right interpolation to it.
- Parameters
-
cur | Current key |
envl | Envelope working on |
time | time to be interpolated |
fill | Receives the interpolated output value. |
§ DoInterpolation2()
void AnimResolver::DoInterpolation2 |
( |
std::vector< LWO::Key >::const_iterator |
beg, |
|
|
std::vector< LWO::Key >::const_iterator |
end, |
|
|
double |
time, |
|
|
float & |
fill |
|
) |
| |
|
protected |
Almost the same, except we won't handle pre/post conditions here.
- See also
- DoInterpolation
§ ExtractAnimChannel()
void AnimResolver::ExtractAnimChannel |
( |
aiNodeAnim ** |
out, |
|
|
unsigned int |
flags = 0 |
|
) |
| |
Extract a node animation channel.
- Parameters
-
out | Receives a pointer to a newly allocated node anim. If there's just one keyframe defined, *out is set to NULL and no animation channel is computed. |
flags | Any combination of the AI_LWO_ANIM_FLAG_XXX flags. |
§ ExtractBindPose()
void AnimResolver::ExtractBindPose |
( |
aiMatrix4x4 & |
out | ) |
|
Extract the bind-pose transformation matrix.
- Parameters
-
out | Receives bind-pose transformation matrix |
§ GetKeys()
Build linearly subsampled keys from 3 single envelopes.
- Parameters
-
out | Receives output keys |
envl_x | X-component envelope |
envl_y | Y-component envelope |
envl_z | Z-component envelope |
flags | Any combination of the AI_LWO_ANIM_FLAG_XXX flags. |
- Note
- Up to two input envelopes may be NULL
§ GetSampleRate()
double Assimp::LWO::AnimResolver::GetSampleRate |
( |
| ) |
const |
|
inline |
§ InterpolateTrack()
Interpolate 2 tracks if one is given.
- Parameters
-
out | Receives extra output keys |
key_out | Primary output key |
time | Time to interpolate for |
§ SetAnimationRange()
void Assimp::LWO::AnimResolver::SetAnimationRange |
( |
double |
_first, |
|
|
double |
_last |
|
) |
| |
|
inline |
Set the animation time range.
- Parameters
-
first | Time where the animation starts, in ticks |
last | Time where the animation ends, in ticks |
§ SetSampleRate()
void Assimp::LWO::AnimResolver::SetSampleRate |
( |
double |
sr | ) |
|
|
inline |
Set the sampling rate for ExtractAnimChannel().
Non-linear interpolations are subsampled with this rate (keys per second). Closer sampling positions, if existent, are kept. The sampling rate defaults to 0, if this value is not changed and AI_LWO_ANIM_FLAG_SAMPLE_ANIMS is specified for ExtractAnimChannel(), the class finds a suitable sample rate by itself.
§ SubsampleAnimTrack()
void AnimResolver::SubsampleAnimTrack |
( |
std::vector< aiVectorKey > & |
out, |
|
|
double |
time, |
|
|
double |
sample_delta |
|
) |
| |
|
protected |
Subsample an animation track by a given sampling rate.
- Parameters
-
out | Receives output keys. Last key at input defines the time where subsampling starts. |
time | Time to end subsampling at |
sample_delta | Time delta between two samples |
§ UpdateAnimRangeSetup()
void AnimResolver::UpdateAnimRangeSetup |
( |
| ) |
|
|
protected |
Insert extra keys to match LWO's pre and post behaviours in a given time range [first...last].
The documentation for this class was generated from the following files: