raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
22.97k stars 2.3k forks source link

[rmodels] `LoadModelAnimationsGLTF()` computes poses interpolating between the anim duration and fixed 60 fps (`GLTF_ANIMDELAY`) #4426

Open raysan5 opened 1 month ago

raysan5 commented 1 month ago

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.

raysan5 commented 3 weeks ago

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.