|
Untitled
|
#include "core/engine_types.h"#include "load/init.h"#include "utilities/types.h"#include <string.h>#include "utilities/utilities.h"#include "utilities/mathf.h"Go to the source code of this file.
Functions | |
| float | animation_length (Animation *anim) |
| Finds the length of an animation. | |
| void | sample_animation (const AnimationSampler *sampler, float t, float *out_value) |
| Samples a value for an animation sampler at a certain time value. | |
| void | play_animation (Animation *anim, float time, int asset_instance) |
| Plays an animation at a certain time value. | |
| Animation * | find_animation (const char *name, int asset_instance) |
| Finds an animation via name. | |
| void | update_animation_components (float dt) |
| Updates animation components (not skeletal) once a frame. | |
| float animation_length | ( | Animation * | anim | ) |
Finds the length of an animation.
| anim | The animation to use. |
Definition at line 10 of file animation.c.
References animation_length(), AnimationSampler::count, Animation::sampler_count, Animation::samplers, and AnimationSampler::times.
Referenced by animation_length(), and render().
| void sample_animation | ( | const AnimationSampler * | sampler, |
| float | t, | ||
| float * | out_value ) |
Samples a value for an animation sampler at a certain time value.
| sample | The animation sampler to sample. |
| t | The time to sample at. |
| out_value | Pointer to the float that recieves the value. |
Definition at line 23 of file animation.c.
References AnimationSampler::count, CUBICSPLINE, AnimationSampler::elem_count, AnimationSampler::interpolation, lerp(), LINEAR, sample_animation(), STEP, AnimationSampler::times, and AnimationSampler::values.
Referenced by play_animation(), and sample_animation().
| void play_animation | ( | Animation * | anim, |
| float | time, | ||
| int | entity_id ) |
Plays an animation at a certain time value.
| anim | The animation to play. |
| time | The time to play the animation at. |
| entity_id | The entity that plays the animation. |
Definition at line 68 of file animation.c.
References ASSET_INSTANCES, CAST_VEC, Animation::channel_count, Animation::channels, GLOBALS, Globals::mesh_nodes, AssetInstance::node_indices, GLTFAnimationChannel::path, play_animation(), MeshNode::rotation, sample_animation(), GLTFAnimationChannel::sampler, Animation::samplers, MeshNode::scale, GLTFAnimationChannel::target_node, TARGET_ROTATION, TARGET_SCALE, TARGET_TRANSLATION, TARGET_WEIGHTS, time, and MeshNode::translation.
Referenced by play_animation(), and render().
| Animation * find_animation | ( | const char * | name, |
| int | entity_id ) |
Finds an animation via name.
| name | The name of the animation. |
| entity_id | The entity to query. |
Definition at line 91 of file animation.c.
References GLTFSkin::animation_indices, GLTFSkin::animation_indices_count, Asset::animations, AssetInstance::asset_id, ASSET_INSTANCES, Globals::assets, CAST_VEC, find_animation(), GLOBALS, Animation::name, AssetInstance::skin_count, AssetInstance::skin_indices, and Globals::skins.
Referenced by find_animation(), and render().
| void update_animation_components | ( | float | dt | ) |
Updates animation components (not skeletal) once a frame.
| dt | The time to play all components at. |
Definition at line 115 of file animation.c.
References AnimationTrack::active, ANIM_TARGET_BOOL, ANIM_TARGET_FLOAT, ANIM_TARGET_INT, ANIM_TARGET_VEC3, ANIMATION_COMPONENTS, AnimationTrack::completion_data, AnimationTrack::completion_type, AnimationTrack::current_time, AnimationTrack::data, dt, AnimationTrack::duration, AnimationComponent::free, AnimationTrack::kf, AnimationTrack::kf_count, lerp(), AnimationTrack::loop, MAX_ANIMATION_COMPONENTS, AnimationKeyframe::time, AnimationComponent::track_count, AnimationComponent::tracks, AnimationTrack::type, update_animation_components(), AnimationKeyframe::val, and vec3_lerp().
Referenced by main(), and update_animation_components().