Skeleton

Inherits: Spatial < Node < Object

Category: Core

Brief Description

Skeleton for characters and animated objects.

Member Functions

void add_bone ( String name )
void bind_child_node_to_bone ( int bone_idx, Node node )
void clear_bones ( )
int find_bone ( String name ) const
int get_bone_count ( ) const
Transform get_bone_custom_pose ( int bone_idx ) const
Transform get_bone_global_pose ( int bone_idx ) const
String get_bone_name ( int bone_idx ) const
int get_bone_parent ( int bone_idx ) const
Transform get_bone_pose ( int bone_idx ) const
Transform get_bone_rest ( int bone_idx ) const
Transform get_bone_transform ( int bone_idx ) const
Array get_bound_child_nodes_to_bone ( int bone_idx ) const
bool is_bone_rest_disabled ( int bone_idx ) const
void set_bone_custom_pose ( int bone_idx, Transform custom_pose )
void set_bone_disable_rest ( int bone_idx, bool disable )
void set_bone_global_pose ( int bone_idx, Transform pose )
void set_bone_parent ( int bone_idx, int parent_idx )
void set_bone_pose ( int bone_idx, Transform pose )
void set_bone_rest ( int bone_idx, Transform rest )
void unbind_child_node_from_bone ( int bone_idx, Node node )
void unparent_bone_and_rest ( int bone_idx )

Numeric Constants

  • NOTIFICATION_UPDATE_SKELETON = 50

Description

Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see Animation). Skeleton will support rag doll dynamics in the future.

Member Function Description

  • void add_bone ( String name )

Add a bone, with name “name”. get_bone_count will become the bone index.

  • void bind_child_node_to_bone ( int bone_idx, Node node )

Deprecated soon.

  • 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.

  • String get_bone_name ( int bone_idx ) const

Return the name of the bone at index “index”

  • int get_bone_parent ( int bone_idx ) const

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 for bone “bone_idx”.

Return the rest transform for a bone “bone_idx”.

  • Array get_bound_child_nodes_to_bone ( int bone_idx ) const

Deprecated soon.

  • bool is_bone_rest_disabled ( int bone_idx ) const
  • void set_bone_custom_pose ( int bone_idx, Transform custom_pose )
  • void set_bone_disable_rest ( int bone_idx, bool disable )
  • void set_bone_global_pose ( int bone_idx, Transform pose )
  • void set_bone_parent ( int bone_idx, int parent_idx )

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 unbind_child_node_from_bone ( int bone_idx, Node node )

Deprecated soon.

  • void unparent_bone_and_rest ( int bone_idx )