SkeletonModification3DCCDIK

Inherits: SkeletonModification3D < Resource < RefCounted < Object

A modification that uses CCDIK to manipulate a series of bones to reach a target.

Description

This SkeletonModification3D uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to maniuplate a chain of bones in a Skeleton so it reaches a defined target.

CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each bone is rotated to face the target from the tip (by default), which over a chain of bones allow it to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK can look more robotic than other IK solvers.

Note: The CCDIK modifier has ccdik_joints, which are the data objects that hold the data for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed for each bone in the bone chain used by CCDIK.

CCDIK also fully supports angle constraints, allowing for more control over how a solution is met.

Methods

int

get_ccdik_joint_bone_index ( int joint_idx ) const

String

get_ccdik_joint_bone_name ( int joint_idx ) const

int

get_ccdik_joint_ccdik_axis ( int joint_idx ) const

float

get_ccdik_joint_constraint_angle_max ( int joint_idx ) const

float

get_ccdik_joint_constraint_angle_min ( int joint_idx ) const

bool

get_ccdik_joint_constraint_invert ( int joint_idx ) const

bool

get_ccdik_joint_enable_joint_constraint ( int joint_idx ) const

void

set_ccdik_joint_bone_index ( int joint_idx, int bone_index )

void

set_ccdik_joint_bone_name ( int joint_idx, String bone_name )

void

set_ccdik_joint_ccdik_axis ( int joint_idx, int axis )

void

set_ccdik_joint_constraint_angle_max ( int joint_idx, float max_angle )

void

set_ccdik_joint_constraint_angle_min ( int joint_idx, float min_angle )

void

set_ccdik_joint_constraint_invert ( int joint_idx, bool invert )

void

set_ccdik_joint_enable_joint_constraint ( int joint_idx, bool enable )

Property Descriptions

  • int ccdik_data_chain_length

Default

0

Setter

set_ccdik_data_chain_length(value)

Getter

get_ccdik_data_chain_length()

The amount of CCDIK joints in the CCDIK modification.


  • bool high_quality_solve

Default

true

Setter

set_use_high_quality_solve(value)

Getter

get_use_high_quality_solve()

When true, the CCDIK algorithm will perform a higher quality solve that returns more natural results. A high quality solve requires more computation power to solve though, and therefore can be disabled to save performance.


Default

NodePath("")

Setter

set_target_node(value)

Getter

get_target_node()

The NodePath to the node that is the target for the CCDIK modification. This node is what the CCDIK chain will attempt to rotate the bone chain to.


Default

NodePath("")

Setter

set_tip_node(value)

Getter

get_tip_node()

The end position of the CCDIK chain. Typically, this should be a child of a BoneAttachment3D node attached to the final bone in the CCDIK chain, where the child node is offset so it is at the end of the final bone.

Method Descriptions

  • int get_ccdik_joint_bone_index ( int joint_idx ) const

Returns the bone index of the bone assigned to the CCDIK joint at joint_idx.


  • String get_ccdik_joint_bone_name ( int joint_idx ) const

Returns the name of the bone that is assigned to the CCDIK joint at joint_idx.


  • int get_ccdik_joint_ccdik_axis ( int joint_idx ) const

Returns the integer representing the joint axis of the CCDIK joint at joint_idx.


  • float get_ccdik_joint_constraint_angle_max ( int joint_idx ) const

Returns the maximum angle constraint for the joint at joint_idx. Note: This angle is in degrees!


  • float get_ccdik_joint_constraint_angle_min ( int joint_idx ) const

Returns the minimum angle constraint for the joint at joint_idx. Note: This angle is in degrees!


  • bool get_ccdik_joint_constraint_invert ( int joint_idx ) const

Returns whether the CCDIK joint at joint_idx uses an inverted joint constraint. See set_ccdik_joint_constraint_invert for details.


  • bool get_ccdik_joint_enable_joint_constraint ( int joint_idx ) const

Enables angle constraints to the CCDIK joint at joint_idx.


  • void set_ccdik_joint_bone_index ( int joint_idx, int bone_index )

Sets the bone index, bone_index, of the CCDIK joint at joint_idx. When possible, this will also update the bone_name of the CCDIK joint based on data provided by the linked skeleton.


  • void set_ccdik_joint_bone_name ( int joint_idx, String bone_name )

Sets the bone name, bone_name, of the CCDIK joint at joint_idx. When possible, this will also update the bone_index of the CCDIK joint based on data provided by the linked skeleton.


  • void set_ccdik_joint_ccdik_axis ( int joint_idx, int axis )

Sets the joint axis of the CCDIK joint at joint_idx to the passed-in joint axis, axis.


  • void set_ccdik_joint_constraint_angle_max ( int joint_idx, float max_angle )

Sets the maximum angle constraint for the joint at joint_idx. Note: This angle must be in radians!


  • void set_ccdik_joint_constraint_angle_min ( int joint_idx, float min_angle )

Sets the minimum angle constraint for the joint at joint_idx. Note: This angle must be in radians!


  • void set_ccdik_joint_constraint_invert ( int joint_idx, bool invert )

Sets whether the CCDIK joint at joint_idx uses an inverted joint constraint.

An inverted joint constraint only constraints the CCDIK joint to the angles outside of the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values.


  • void set_ccdik_joint_enable_joint_constraint ( int joint_idx, bool enable )

Sets whether joint constraints are enabled for the CCDIK joint at joint_idx.