natiny_animator_create
C
NatinyAnimator natiny_animator_create(NatinyModel model);
Creates a layer of animation on a model whose mesh has a skeleton.
Parameters
| Name |
Type |
Description |
model |
NatinyModel |
Model handle from natiny_model_create; its mesh must have a skeleton |
Returns
| Type |
Description |
NatinyAnimator |
Animator handle, or 0 when the model is invalid, has no skeleton, or the animator cannot be allocated |
Example
C
NatinyAnimator legs = natiny_animator_create(hero);
if (legs != 0) {
NatinyAnimation run = natiny_mesh_find_animation(hero_mesh, "Running");
natiny_animator_play(legs, run, 0.0f);
natiny_animator_set_loop(legs, true);
}
Notes
- An animator is not an entity, cannot be parented, and is destroyed with its
model.