-
Notifications
You must be signed in to change notification settings - Fork 0
/
sampled_animation.h
42 lines (32 loc) · 1.06 KB
/
sampled_animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "common.h"
struct Xform_State
{
Vector3 translation = Vector3(0, 0, 0);
Vector3 scale = Vector3(0, 0, 0);
Quaternion orientation = Quaternion(1, 0, 0, 0);
};
struct Node_Info
{
String name;
// Only the root can have parent_index of -1. If anyone
// else has -1 for their parent's index, that's an error.
i32 parent_index = -1;
};
struct Keyframe
{
SArr<Xform_State> xform_states; // Has a count == 'nodes_info'.
};
struct Sampled_Animation
{
String name; // For catalog.
String full_path; // For catalog.
SArr<Node_Info> nodes_info;
SArr<Keyframe> keyframes;
i32 num_samples = 0; // Number of samples per node.
i32 frame_rate = 0; // Frames per second.
f64 duration = 0; // Duration in second.
Matrix4 g_matrix; // Global matrix.
bool loaded = false; // For catalog
};
bool load_sampled_animation(Sampled_Animation *anim, String full_path); // @Cleanup: We don't even need the full_path now that there is a full_path inside Sampled_Animation?