浏览代码

moved update out of draw area (#4413)

Anthony Carbajal 10 月之前
父节点
当前提交
fe66bfb785
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      examples/models/models_gpu_skinning.c

+ 2 - 2
examples/models/models_gpu_skinning.c

@@ -81,6 +81,8 @@ int main(void)
         // Update model animation
         // Update model animation
         ModelAnimation anim = modelAnimations[animIndex];
         ModelAnimation anim = modelAnimations[animIndex];
         animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
         animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount;
+        characterModel.transform = MatrixTranslate(position.x, position.y, position.z);
+        UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame);
         //----------------------------------------------------------------------------------
         //----------------------------------------------------------------------------------
 
 
         // Draw
         // Draw
@@ -92,8 +94,6 @@ int main(void)
             BeginMode3D(camera);
             BeginMode3D(camera);
             
             
                 // Draw character
                 // Draw character
-                characterModel.transform = MatrixTranslate(position.x, position.y, position.z);
-                UpdateModelAnimationBoneMatrices(characterModel, anim, animCurrentFrame);
                 DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
                 DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);
 
 
                 DrawGrid(10, 1.0f);
                 DrawGrid(10, 1.0f);