natiny_model_set_bone_weight
void natiny_model_set_bone_weight(NatinyModel model, NatinyEntity bone, float weight);
Sets how much of a bone the game has taken over from the animation, so that a head can follow the camera or a hand can be pinned to a ledge.
Parameters
| Name | Type | Description |
|---|---|---|
model |
NatinyModel |
Model handle |
bone |
NatinyEntity |
Bone entity from natiny_model_get_bone |
weight |
float |
0.0f leaves the bone to the animation, 1.0f to what was written into it; clamped to that range |
Example
NatinyEntity head = natiny_model_get_bone(hero, "Head");
natiny_model_set_bone_weight(hero, head, 1.0f);
natiny_entity_set_rotation(head, NATINY_SPACE_LOCAL, pitch, yaw, 0.0f);