@@ -70,26 +70,31 @@ pub struct GltfPrimitive {
70
70
pub material : Option < Handle < StandardMaterial > > ,
71
71
}
72
72
73
+ /// Part of a [`GltfNodeAnimation`], interpolation method for an animation.
73
74
#[ derive( Clone , Debug ) ]
74
75
pub enum GltfAnimationInterpolation {
75
76
Linear ,
76
77
Step ,
77
78
CubicSpline ,
78
79
}
79
80
81
+ /// How a property of a gLTF node should be animated. The property and its value can be found
82
+ /// through the [`GltfNodeAnimationKeyframes`] attribute.
80
83
#[ derive( Clone , Debug ) ]
81
84
pub struct GltfNodeAnimation {
82
85
pub keyframe_timestamps : Vec < f32 > ,
83
86
pub keyframes : GltfNodeAnimationKeyframes ,
84
87
pub interpolation : GltfAnimationInterpolation ,
85
88
}
86
89
90
+ /// A gLTF animation, listing how each node (by its index) that is part of it should be animated.
87
91
#[ derive( Default , Clone , TypeUuid , Debug ) ]
88
92
#[ uuid = "d81b7179-0448-4eb0-89fe-c067222725bf" ]
89
93
pub struct GltfAnimation {
90
94
pub node_animations : HashMap < usize , Vec < GltfNodeAnimation > > ,
91
95
}
92
96
97
+ /// Key frames of an animation.
93
98
#[ derive( Clone , Debug ) ]
94
99
pub enum GltfNodeAnimationKeyframes {
95
100
Rotation ( Vec < Vec4 > ) ,
@@ -107,6 +112,7 @@ impl Default for GltfNodeAnimation {
107
112
}
108
113
}
109
114
115
+ /// A gLTF node that is part of an animation, with its index.
110
116
#[ derive( Component , Debug , Clone , Reflect , Default ) ]
111
117
#[ reflect( Component ) ]
112
118
pub struct GltfAnimatedNode {
0 commit comments