diff options
Diffstat (limited to 'gfx/src/scene/animation_impl.h')
-rw-r--r-- | gfx/src/scene/animation_impl.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gfx/src/scene/animation_impl.h b/gfx/src/scene/animation_impl.h index 7265858..4408158 100644 --- a/gfx/src/scene/animation_impl.h +++ b/gfx/src/scene/animation_impl.h | |||
@@ -24,18 +24,19 @@ typedef struct Buffer Buffer; | |||
24 | /// Joints are mutable and store the transform and joint matrices that result | 24 | /// Joints are mutable and store the transform and joint matrices that result |
25 | /// from animation, aside from the inverse bind matrix. | 25 | /// from animation, aside from the inverse bind matrix. |
26 | typedef struct Joint { | 26 | typedef struct Joint { |
27 | rel_idx child; /// First child Joint; index into Anima's joints. | 27 | joint_idx child; /// First child Joint; index into Anima's joints. |
28 | rel_idx next; /// Next sibling Joint; index into Anima's joints. | 28 | joint_idx next; /// Next sibling Joint; index into Anima's joints. |
29 | mat4 transform; /// Local transform relative to parent. | 29 | mat4 transform; /// Local transform relative to parent. |
30 | mat4 inv_bind_matrix; /// Transforms the mesh into the joint's local space. | 30 | mat4 inv_bind_matrix; /// Transforms the mesh into the joint's local space. |
31 | mat4 joint_matrix; /// inv(global) * global joint transform * inv(bind). | 31 | mat4 joint_matrix; /// inv(global) * global joint transform * inv(bind). |
32 | aabb3 box; /// Bounding box of vertices affected by joint. | ||
32 | } Joint; | 33 | } Joint; |
33 | 34 | ||
34 | /// Animation skeleton. | 35 | /// Animation skeleton. |
35 | typedef struct Skeleton { | 36 | typedef struct Skeleton { |
36 | skeleton_idx next; | 37 | skeleton_idx next; |
37 | size_t num_joints; | 38 | size_t num_joints; |
38 | rel_idx joints[GFX_MAX_NUM_JOINTS]; /// Indices into Anima's joints array. | 39 | joint_idx joints[GFX_MAX_NUM_JOINTS]; /// Indices into Anima's joints array. |
39 | } Skeleton; | 40 | } Skeleton; |
40 | 41 | ||
41 | /// A keyframe of animation. | 42 | /// A keyframe of animation. |
@@ -49,7 +50,7 @@ typedef struct Keyframe { | |||
49 | 50 | ||
50 | /// Animation channel. | 51 | /// Animation channel. |
51 | typedef struct Channel { | 52 | typedef struct Channel { |
52 | rel_idx target; /// Index into Anima's joints array. | 53 | joint_idx target; /// Index into Anima's joints array. |
53 | ChannelType type; | 54 | ChannelType type; |
54 | AnimationInterpolation interpolation; | 55 | AnimationInterpolation interpolation; |
55 | size_t num_keyframes; | 56 | size_t num_keyframes; |