raylib
raylib copied to clipboard
[rmodels] `LoadModelAnimationsGLTF()` computes poses interpolating between the anim duration and fixed 60 fps (`GLTF_ANIMDELAY`)
It does not consider scenarios where animation is created at 24 fps or game does not run at 60 fps.
Model can already contain a fixed number of poses (keyframes) with a defined frame delay between each one (and also a expected interpolation between keyframes). That information is not considered at the moment.
Related to this feature, a future improvement could be using float values for frame request to get interpolated poses between key-frame poses:
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame);
frame could be a value between 0.0f and 1.0f to get interpolation.
Hi @raysan5, I've implemented a simple function to blend between two animations and an example using GPU skinning. https://github.com/Kirandeep-Singh-Khehra/raylib/commit/8808a3958a705120bea516cf8d50155e5b9d8725
It helped me for smooth transitioning/interpolation between two animations(For ex: smoothly moves from walking to running) and blending(For ex: blending between move forward animation and move rightwards animation by a given factor to have all intermediate movement animation). I was planning to raise a PR for it. But you might be trying to add void UpdateModelAnimation(Model model, ModelAnimation anim, float frame); with frame as float instead of int.
Could you please share if usingfloat for frame is finalized or not. I would like to contribute on animation part.
Edit: Raised a PR here https://github.com/raysan5/raylib/pull/4578
Hi @raysan5, I've implemented a simple function to blend between two animations and an example using GPU skinning. Kirandeep-Singh-Khehra@8808a39
It helped me for smooth transitioning/interpolation between two animations(For ex: smoothly moves from walking to running) and blending(For ex: blending between move forward animation and move rightwards animation by a given factor to have all intermediate movement animation). I was planning to raise a PR for it. But you might be trying to add
void UpdateModelAnimation(Model model, ModelAnimation anim, float frame);withframeasfloatinstead ofint.Could you please share if using
floatfor frame is finalized or not. I would like to contribute on animation part.Edit: Raised a PR here #4578
so is this done because in the PR it states that it needs still approval?
Hi @CodingMadness, There are discussions going on for animation system. So, all new additions to animation are halted by maintainers.
This is the discussion page https://github.com/raysan5/raylib/discussions/4606