diff options
| author | Ray <[email protected]> | 2023-01-02 20:59:25 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2023-01-02 20:59:25 +0100 |
| commit | 39f9045703268f0b844916b07643d3801d2212cf (patch) | |
| tree | 1655d0eab45283ac8949dd5bab4a6c83fd3d0114 | |
| parent | b85490980339cab5cbdde4d674624deaabff783c (diff) | |
| download | raylib-39f9045703268f0b844916b07643d3801d2212cf.tar.gz raylib-39f9045703268f0b844916b07643d3801d2212cf.zip | |
Update models_loading_gltf.c
| -rw-r--r-- | examples/models/models_loading_gltf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/models/models_loading_gltf.c b/examples/models/models_loading_gltf.c index fcd46949..92b517a1 100644 --- a/examples/models/models_loading_gltf.c +++ b/examples/models/models_loading_gltf.c @@ -56,21 +56,21 @@ int main(void) SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- - - // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- - ModelAnimation anim = modelAnimations[animIndex]; - + // Select current animation if (IsKeyPressed(KEY_UP)) animIndex = (animIndex + 1)%animsCount; else if (IsKeyPressed(KEY_DOWN)) animIndex = (animIndex + animsCount - 1)%animsCount; - + + // Update model animation + ModelAnimation anim = modelAnimations[animIndex]; animCurrentFrame = (animCurrentFrame + 1)%anim.frameCount; UpdateModelAnimation(model, anim, animCurrentFrame); + // Update camera UpdateCamera(&camera); //---------------------------------------------------------------------------------- @@ -82,8 +82,8 @@ int main(void) BeginMode3D(camera); - DrawModel(model, position, 1.0f, WHITE); - DrawGrid(10, 1.0f); // Draw a grid + DrawModel(model, position, 1.0f, WHITE); // Draw animated model + DrawGrid(10, 1.0f); EndMode3D(); |
