natiny_model_get_bone

C
NatinyEntity natiny_model_get_bone(NatinyModel model, const char* name);

Returns one bone of this model as an entity, so that things can be parented to it and its transform read.

Parameters

Name Type Description
model NatinyModel Model handle
name const char* Bone name as natiny_mesh_get_bone_name reports it; null-terminated and compared exactly

Returns

Type Description
NatinyEntity Entity handle for the bone, or 0 when there is no such bone

Example

C
NatinyEntity hand = natiny_model_get_bone(hero, "Middle2.R");
natiny_entity_set_parent(sword, hand);

Notes

  • Destroying the model destroys its bones and their children.