defun-games / claylib

A Common Lisp 2D/3D game toolkit built on top of Raylib 4.5.
zlib License
69 stars 4 forks source link

1st gen extract-model-data & complete(?) model implementation notes #50

Closed mjkalyan closed 1 year ago

mjkalyan commented 1 year ago

TODO: implement the needed "c-copy" functions for model data and check other TODOs on how to transition to their use.

NOTE 1: The annotations do not specify how to deal with model animations. Animations are separate from models in raylib, but it should be possible to unite raylib models and raylib model animations in claylib models. It's a little involved but, vaguely, we'd include a call to claylib/ll:load-model-animations (and more "c-copy" functions) in extract-model-data, add an %animations slot to claylib models & model-assets, def the appropriate accessors, use said accessors to set animation related fields in make-model, write a appropriate update-model-animation pass-through, ???, profit. Or we could settle for separately loaded animations like raylib.

NOTE 2: When freeing a claylib model we need to free only the parts which don't come from a model-asset. This may be tricky as we have an rl-model backing with some fields (for example transforms) we want to free and others (meshes etc.) we don't. Same goes for the animation data.