vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
animation_clip_asset.h
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7#include <glm/glm.hpp>
8#include <glm/gtc/quaternion.hpp>
9
10#include "resource/resource.h"
11#include "resource/resource_handle.h"
12
13namespace Vkm::Engine {
14
19 uint32_t first = 0;
20 uint32_t count = 0;
21};
22
26struct ClipBone {
27 ClipChannel position;
28 ClipChannel rotation;
29 ClipChannel scale;
30};
31
38struct ClipMarker {
39 std::string name;
40 float time = 0.0f;
41};
42
50struct AnimationClipAsset : public Resource {
51 std::string skeleton;
52
58 float duration = 0.0f;
59
60 std::vector<ClipBone> bones;
61
67 std::vector<ClipMarker> markers;
68
69 std::vector<float> positionTimes;
70 std::vector<glm::vec3> positions;
71 std::vector<float> rotationTimes;
72 std::vector<glm::quat> rotations;
73 std::vector<float> scaleTimes;
74 std::vector<glm::vec3> scales;
75};
76
86std::string findClipFault(const AnimationClipAsset& clip);
87
88using AnimationClipHandle = Handle<AnimationClipAsset>;
89
90} // namespace Vkm::Engine
A baked animation: every bone's keys, in six flat arrays.
Definition animation_clip_asset.h:50
std::string skeleton
Name of the rig whose bone order bones addresses.
Definition animation_clip_asset.h:51
float duration
Length in seconds.
Definition animation_clip_asset.h:58
std::vector< ClipMarker > markers
Instants the clip announces as the head passes them, in time order.
Definition animation_clip_asset.h:67
std::vector< ClipBone > bones
Parallel to the skeleton's bones.
Definition animation_clip_asset.h:60
The three channel ranges belonging to one bone of the clip's skeleton.
Definition animation_clip_asset.h:26
One bone's keys for one channel, as a range into the clip's flat arrays.
Definition animation_clip_asset.h:18
uint32_t count
0 means the channel is absent and the bind pose stands.
Definition animation_clip_asset.h:20
A named instant a clip announces as its playback head reaches it.
Definition animation_clip_asset.h:38
float time
Seconds into the clip; within [0, duration].
Definition animation_clip_asset.h:40
Opaque, type-safe handle for resources, distinguished by ResourceType.
Definition resource_handle.h:16