Documentation
¶
Overview ¶
This SkeletonModification2D uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to manipulate a chain of bones in a Skeleton2D 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.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsResource() Resource.Instance
- func (self *Extension[T]) AsSkeletonModification2D() SkeletonModification2D.Instance
- func (self *Extension[T]) AsSkeletonModification2DCCDIK() Instance
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsSkeletonModification2D() SkeletonModification2D.Instance
- func (self Instance) AsSkeletonModification2DCCDIK() Instance
- func (self Instance) CcdikDataChainLength() int
- func (self Instance) GetCcdikJointBone2dNode(joint_idx int) string
- func (self Instance) GetCcdikJointBoneIndex(joint_idx int) int
- func (self Instance) GetCcdikJointConstraintAngleInvert(joint_idx int) bool
- func (self Instance) GetCcdikJointConstraintAngleMax(joint_idx int) Angle.Radians
- func (self Instance) GetCcdikJointConstraintAngleMin(joint_idx int) Angle.Radians
- func (self Instance) GetCcdikJointEnableConstraint(joint_idx int) bool
- func (self Instance) GetCcdikJointRotateFromJoint(joint_idx int) bool
- func (self Instance) ID() ID
- func (self Instance) SetCcdikDataChainLength(value int)
- func (self Instance) SetCcdikJointBone2dNode(joint_idx int, bone2d_nodepath string)
- func (self Instance) SetCcdikJointBoneIndex(joint_idx int, bone_idx int)
- func (self Instance) SetCcdikJointConstraintAngleInvert(joint_idx int, invert bool)
- func (self Instance) SetCcdikJointConstraintAngleMax(joint_idx int, angle_max Angle.Radians)
- func (self Instance) SetCcdikJointConstraintAngleMin(joint_idx int, angle_min Angle.Radians)
- func (self Instance) SetCcdikJointEnableConstraint(joint_idx int, enable_constraint bool)
- func (self Instance) SetCcdikJointRotateFromJoint(joint_idx int, rotate_from_joint bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetTargetNodepath(value string)
- func (self Instance) SetTipNodepath(value string)
- func (self Instance) TargetNodepath() string
- func (self Instance) TipNodepath() string
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
func (*Extension[T]) AsSkeletonModification2D ¶
func (self *Extension[T]) AsSkeletonModification2D() SkeletonModification2D.Instance
func (*Extension[T]) AsSkeletonModification2DCCDIK ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.SkeletonModification2DCCDIK
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsSkeletonModification2D ¶
func (self Instance) AsSkeletonModification2D() SkeletonModification2D.Instance
func (Instance) AsSkeletonModification2DCCDIK ¶
func (Instance) CcdikDataChainLength ¶
The number of CCDIK joints in the CCDIK modification.
func (Instance) GetCcdikJointBone2dNode ¶
Returns the Bone2D node assigned to the CCDIK joint at 'joint_idx'.
func (Instance) GetCcdikJointBoneIndex ¶
Returns the index of the Bone2D node assigned to the CCDIK joint at 'joint_idx'.
func (Instance) GetCcdikJointConstraintAngleInvert ¶
Returns whether the CCDIK joint at 'joint_idx' uses an inverted joint constraint. See SetCcdikJointConstraintAngleInvert for details.
func (Instance) GetCcdikJointConstraintAngleMax ¶
Returns the maximum angle constraint for the joint at 'joint_idx'.
func (Instance) GetCcdikJointConstraintAngleMin ¶
Returns the minimum angle constraint for the joint at 'joint_idx'.
func (Instance) GetCcdikJointEnableConstraint ¶
Returns whether angle constraints on the CCDIK joint at 'joint_idx' are enabled.
func (Instance) GetCcdikJointRotateFromJoint ¶
Returns whether the joint at 'joint_idx' is set to rotate from the joint, true, or to rotate from the tip, false. The default is to rotate from the tip.
func (Instance) SetCcdikDataChainLength ¶
SetCcdikDataChainLength sets the property returned by [GetCcdikDataChainLength].
func (Instance) SetCcdikJointBone2dNode ¶
Sets the Bone2D node assigned to the CCDIK joint at 'joint_idx'.
func (Instance) SetCcdikJointBoneIndex ¶
Sets the bone index, 'bone_idx', of the CCDIK joint at 'joint_idx'. When possible, this will also update the bone2d_node of the CCDIK joint based on data provided by the linked skeleton.
func (Instance) SetCcdikJointConstraintAngleInvert ¶
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.
func (Instance) SetCcdikJointConstraintAngleMax ¶
Sets the maximum angle constraint for the joint at 'joint_idx'.
func (Instance) SetCcdikJointConstraintAngleMin ¶
Sets the minimum angle constraint for the joint at 'joint_idx'.
func (Instance) SetCcdikJointEnableConstraint ¶
Determines whether angle constraints on the CCDIK joint at 'joint_idx' are enabled. When true, constraints will be enabled and taken into account when solving.
func (Instance) SetCcdikJointRotateFromJoint ¶
Sets whether the joint at 'joint_idx' is set to rotate from the joint, true, or to rotate from the tip, false.
func (Instance) SetTargetNodepath ¶
SetTargetNodepath sets the property returned by [GetTargetNode].
func (Instance) SetTipNodepath ¶
SetTipNodepath sets the property returned by [GetTipNode].
func (Instance) TargetNodepath ¶
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.
func (Instance) TipNodepath ¶
The end position of the CCDIK chain. Typically, this should be a child of a Bone2D node attached to the final Bone2D in the CCDIK chain.