SkeletonModification2DCCDIK

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsSkeletonModification2DCCDIK() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsSkeletonModification2D

func (self *Extension[T]) AsSkeletonModification2D() SkeletonModification2D.Instance

func (*Extension[T]) AsSkeletonModification2DCCDIK

func (self *Extension[T]) AsSkeletonModification2DCCDIK() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

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 New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsSkeletonModification2D

func (self Instance) AsSkeletonModification2D() SkeletonModification2D.Instance

func (Instance) AsSkeletonModification2DCCDIK

func (self Instance) AsSkeletonModification2DCCDIK() Instance

func (Instance) CcdikDataChainLength

func (self Instance) CcdikDataChainLength() int

The number of CCDIK joints in the CCDIK modification.

func (Instance) GetCcdikJointBone2dNode

func (self Instance) GetCcdikJointBone2dNode(joint_idx int) string

Returns the Bone2D node assigned to the CCDIK joint at 'joint_idx'.

func (Instance) GetCcdikJointBoneIndex

func (self Instance) GetCcdikJointBoneIndex(joint_idx int) int

Returns the index of the Bone2D node assigned to the CCDIK joint at 'joint_idx'.

func (Instance) GetCcdikJointConstraintAngleInvert

func (self Instance) GetCcdikJointConstraintAngleInvert(joint_idx int) bool

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

func (Instance) GetCcdikJointConstraintAngleMax

func (self Instance) GetCcdikJointConstraintAngleMax(joint_idx int) Angle.Radians

Returns the maximum angle constraint for the joint at 'joint_idx'.

func (Instance) GetCcdikJointConstraintAngleMin

func (self Instance) GetCcdikJointConstraintAngleMin(joint_idx int) Angle.Radians

Returns the minimum angle constraint for the joint at 'joint_idx'.

func (Instance) GetCcdikJointEnableConstraint

func (self Instance) GetCcdikJointEnableConstraint(joint_idx int) bool

Returns whether angle constraints on the CCDIK joint at 'joint_idx' are enabled.

func (Instance) GetCcdikJointRotateFromJoint

func (self Instance) GetCcdikJointRotateFromJoint(joint_idx int) bool

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) ID

func (self Instance) ID() ID

func (Instance) SetCcdikDataChainLength

func (self Instance) SetCcdikDataChainLength(value int)

SetCcdikDataChainLength sets the property returned by [GetCcdikDataChainLength].

func (Instance) SetCcdikJointBone2dNode

func (self Instance) SetCcdikJointBone2dNode(joint_idx int, bone2d_nodepath string)

Sets the Bone2D node assigned to the CCDIK joint at 'joint_idx'.

func (Instance) SetCcdikJointBoneIndex

func (self Instance) SetCcdikJointBoneIndex(joint_idx int, bone_idx int)

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

func (self Instance) SetCcdikJointConstraintAngleInvert(joint_idx int, invert bool)

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

func (self Instance) SetCcdikJointConstraintAngleMax(joint_idx int, angle_max Angle.Radians)

Sets the maximum angle constraint for the joint at 'joint_idx'.

func (Instance) SetCcdikJointConstraintAngleMin

func (self Instance) SetCcdikJointConstraintAngleMin(joint_idx int, angle_min Angle.Radians)

Sets the minimum angle constraint for the joint at 'joint_idx'.

func (Instance) SetCcdikJointEnableConstraint

func (self Instance) SetCcdikJointEnableConstraint(joint_idx int, enable_constraint bool)

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

func (self Instance) SetCcdikJointRotateFromJoint(joint_idx int, rotate_from_joint bool)

Sets whether the joint at 'joint_idx' is set to rotate from the joint, true, or to rotate from the tip, false.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetTargetNodepath

func (self Instance) SetTargetNodepath(value string)

SetTargetNodepath sets the property returned by [GetTargetNode].

func (Instance) SetTipNodepath

func (self Instance) SetTipNodepath(value string)

SetTipNodepath sets the property returned by [GetTipNode].

func (Instance) TargetNodepath

func (self Instance) TargetNodepath() string

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

func (self Instance) TipNodepath() string

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.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL