vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
pose_evaluator.h
1#pragma once
2
3#include "ecs/component/animation/animator.h"
4#include "system/animation/pose_buffer.h"
5
6namespace Vkm::Engine {
7
9struct SkeletonAsset;
10
17struct PoseSample {
18 const AnimationClipAsset* clip = nullptr;
19 float time = 0.0f;
20
21 const AnimationClipAsset* from = nullptr;
22 float fromTime = 0.0f;
23
24 float weight = 1.0f;
25
32 const BoneAdjust* adjust = nullptr;
33 uint32_t adjustCount = 0;
34};
35
44 float from = 0.0f;
45 float to = 0.0f;
46 float travel = 0.0f;
47};
48
61bool advanceHead(float& time, float duration, float delta, bool looping);
62
74void rewindSpentHead(float& time, float duration, float delta, bool looping);
75
91PlaybackStep advancePlayback(Animator& animator, float duration, float fromDuration, float simDelta);
92
106bool crossesMarker(const PlaybackStep& step, float marker, float duration);
107
122void composePose(const SkeletonAsset& skeleton, const PoseSample& sample, const PoseWrite& out);
123
124} // namespace Vkm::Engine
A baked animation: every bone's keys, in six flat arrays.
Definition animation_clip_asset.h:50
What drives a rig: the skeleton, the clip playing on it, and the playback position.
Definition animator.h:45
What a behavior adds to one bone on top of the clip, this frame.
Definition animator.h:28
The sweep a playback head made this frame.
Definition pose_evaluator.h:43
float travel
Signed seconds covered; 0 when nothing moved.
Definition pose_evaluator.h:46
float from
Head before the advance.
Definition pose_evaluator.h:44
float to
Head after it, as the Animator now carries it.
Definition pose_evaluator.h:45
The clips a rig reads this frame, how much of each, and what a behavior adds on top.
Definition pose_evaluator.h:17
const AnimationClipAsset * from
Clip being left; null when nothing is fading.
Definition pose_evaluator.h:21
float fromTime
Its own playback head.
Definition pose_evaluator.h:22
float weight
0 is all from, 1 is all clip.
Definition pose_evaluator.h:24
float time
Its playback head, seconds.
Definition pose_evaluator.h:19
const BoneAdjust * adjust
The Animator's adjustments, applied after the blend; none when null.
Definition pose_evaluator.h:32
const AnimationClipAsset * clip
Clip playing; null holds the bind pose.
Definition pose_evaluator.h:18
Writable view of one slice, handed to whatever composes the pose.
Definition pose_buffer.h:34
A rig: a flat, parent-before-child bone array plus its bind pose.
Definition skeleton_asset.h:33