Toast Engine
Loading...
Searching...
No Matches
assets::AnimationTrack Struct Reference

One animated channel: a keyframe curve driving one component of one node's transform. More...

#include <animation.hpp>

Public Member Functions

auto keyframeCount () const -> size_t
auto sampleVec3 (float time) const -> glm::vec3
 Evaluates this track at time, in seconds from clip start.
auto sampleQuat (float time) const -> glm::quat

Public Attributes

std::string target_node
 node name, resolved against the instantiated tree at playback time
TrackTarget target = TrackTarget::translation
Interpolation interpolation = Interpolation::linear
std::vector< float > times
std::vector< glm::vec3 > vec3_values
std::vector< glm::quat > quat_values

Detailed Description

One animated channel: a keyframe curve driving one component of one node's transform.

Times are seconds from clip start. Only one of vec3_values / quat_values is populated, chosen by target

Member Function Documentation

◆ keyframeCount()

auto assets::AnimationTrack::keyframeCount ( ) const -> size_t
inlinenodiscard
Returns
keyframe count, accounting for cubic spline storing three values per key

◆ sampleVec3()

auto assets::AnimationTrack::sampleVec3 ( float time) const -> glm::vec3
nodiscard

Evaluates this track at time, in seconds from clip start.

Clamps rather than loops - looping is the player's decision and it wraps the time first. A track with no keys returns identity, so a malformed one poses to something sane rather than to garbage


The documentation for this struct was generated from the following files:
  • engine/src/toast/assets/animation.hpp
  • engine/src/toast/assets/animation.cpp