@@ -26,15 +26,16 @@ class ModelAnimation : public ::ModelAnimation {
2626 other.keyframePoses = nullptr ;
2727 }
2828
29- // TODO: Implement a way to unload all animations at once, as the current Unload () only unloads one animation .
30- ~ModelAnimation () { Unload (1 ); }
29+ // Unloads animation data using populated animCount field, which is set by Load () method .
30+ ~ModelAnimation () { Unload (); }
3131
3232 /* *
3333 * Load model animations from file
3434 */
3535 static std::vector<ModelAnimation> Load (const std::string& fileName) {
3636 int count = 0 ;
3737 ::ModelAnimation* modelAnimations = ::LoadModelAnimations (fileName.c_str (), &count);
38+
3839 std::vector<ModelAnimation> mats (modelAnimations, modelAnimations + count);
3940
4041 RL_FREE (modelAnimations);
@@ -58,7 +59,7 @@ class ModelAnimation : public ::ModelAnimation {
5859 return *this ;
5960 }
6061
61- Unload (1 );
62+ Unload ();
6263 set (other);
6364
6465 other.boneCount = 0 ;
@@ -71,24 +72,31 @@ class ModelAnimation : public ::ModelAnimation {
7172 /* *
7273 * Unload animation data
7374 */
74- void Unload (int animCount) { ::UnloadModelAnimations (this , animCount); }
75+ void Unload () {
76+ ::UnloadModelAnimations (this , 1 );
77+ }
78+
79+ static void Unload (ModelAnimation *modelAnimation, int count) {
80+ ::UnloadModelAnimations (modelAnimation, count);
81+ }
7582
7683 /* *
7784 * Update model animation pose
7885 */
79- ModelAnimation& Update (const ::Model& model, int frame) {
86+ ModelAnimation& Update (const ::Model& model, float frame) {
8087 ::UpdateModelAnimation (model, *this , frame);
8188 return *this ;
8289 }
8390
8491 /* *
85- * Update model animation mesh bone matrices (GPU skinning)
92+ * Blend two animation poses
8693 */
87- ModelAnimation& UpdateBones (const ::Model& model, int frame ) {
88- ::UpdateModelAnimation (model, *this , frame );
94+ ModelAnimation& Blend (const ::Model& model, float frameA, const ::ModelAnimation& animB, float frameB, float blend ) {
95+ ::UpdateModelAnimationEx (model, *this , frameA, animB, frameB, blend );
8996 return *this ;
9097 }
9198
99+
92100 /* *
93101 * Check model animation skeleton match
94102 */
0 commit comments