Skeleton for characters and animated objects.
- NOTIFICATION_UPDATE_SKELETON = 50
Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see Animation). Skeleton will support rag doll dynamics in the future.
The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.
Note that “global pose” below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone.
- bool bones_in_world_transform
- void add_bone ( String name )
Add a bone, with name “name”. get_bone_count will become the bone index.
- void clear_bones ( )
Clear all the bones in this skeleton.
Return the bone index that matches “name” as its name.
- int get_bone_count ( ) const
Return the amount of bones in the skeleton.
Return the custom pose of the specified bone. Custom pose is applied on top of the rest pose.
Return the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual “global” transform of the bone.
Return the name of the bone at index “index”.
Return the bone index which is the parent of the bone at “bone_idx”. If -1, then bone has no parent. Note that the parent bone returned will always be less than “bone_idx”.
Return the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose.
Return the rest transform for a bone “bone_idx”.
Return the combination of custom pose and pose. The returned transform is in skeleton’s reference frame.
- void physical_bones_add_collision_exception ( RID exception )
- void physical_bones_remove_collision_exception ( RID exception )
- void physical_bones_start_simulation ( Array bones=[ ] )
- void physical_bones_stop_simulation ( )
Set the bone index “parent_idx” as the parent of the bone at “bone_idx”. If -1, then bone has no parent. Note: “parent_idx” must be less than “bone_idx”.
Return the pose transform for bone “bone_idx”.
Set the rest transform for bone “bone_idx”
- void unparent_bone_and_rest ( int bone_idx )