SkeletonModification2DJiggle

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: 26 Imported by: 0

Documentation

Overview

This modification moves a series of bones, typically called a bone chain, towards a target. What makes this modification special is that it calculates the velocity and acceleration for each bone in the bone chain, and runs a very light physics-like calculation using the inputted values. This allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like a spring, or sway around like cloth might.

This modification is useful for adding additional motion to things like hair, the edges of clothing, and more. It has several settings to that allow control over how the joint moves when the target moves.

Note: The Jiggle modifier has jiggle_joints, which are the data objects that hold the data for each joint in the Jiggle chain. This is different from than Bone2D nodes! Jiggle joints hold the data needed for each Bone2D in the bone chain used by the Jiggle modification.

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
	AsSkeletonModification2DJiggle() 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]) AsSkeletonModification2DJiggle

func (self *Extension[T]) AsSkeletonModification2DJiggle() 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) AsSkeletonModification2DJiggle

func (self Instance) AsSkeletonModification2DJiggle() Instance

func (Instance) Damping

func (self Instance) Damping() Float.X

The default amount of damping applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied.

func (Instance) GetCollisionMask

func (self Instance) GetCollisionMask() int

Returns the collision mask used by the Jiggle modifier when collisions are enabled.

func (Instance) GetJiggleJointBone2dNode

func (self Instance) GetJiggleJointBone2dNode(joint_idx int) string

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

func (Instance) GetJiggleJointBoneIndex

func (self Instance) GetJiggleJointBoneIndex(joint_idx int) int

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

func (Instance) GetJiggleJointDamping

func (self Instance) GetJiggleJointDamping(joint_idx int) Float.X

Returns the amount of damping of the Jiggle joint at 'joint_idx'.

func (Instance) GetJiggleJointGravity

func (self Instance) GetJiggleJointGravity(joint_idx int) Vector2.XY

Returns a Vector2.XY representing the amount of gravity the Jiggle joint at 'joint_idx' is influenced by.

func (Instance) GetJiggleJointMass

func (self Instance) GetJiggleJointMass(joint_idx int) Float.X

Returns the amount of mass of the jiggle joint at 'joint_idx'.

func (Instance) GetJiggleJointOverride

func (self Instance) GetJiggleJointOverride(joint_idx int) bool

Returns a boolean that indicates whether the joint at 'joint_idx' is overriding the default Jiggle joint data defined in the modification.

func (Instance) GetJiggleJointStiffness

func (self Instance) GetJiggleJointStiffness(joint_idx int) Float.X

Returns the stiffness of the Jiggle joint at 'joint_idx'.

func (Instance) GetJiggleJointUseGravity

func (self Instance) GetJiggleJointUseGravity(joint_idx int) bool

Returns a boolean that indicates whether the joint at 'joint_idx' is using gravity or not.

func (Instance) GetUseColliders

func (self Instance) GetUseColliders() bool

Returns whether the jiggle modifier is taking physics colliders into account when solving.

func (Instance) Gravity

func (self Instance) Gravity() Vector2.XY

The default amount of gravity applied to the Jiggle joints, if they are not overridden.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) JiggleDataChainLength

func (self Instance) JiggleDataChainLength() int

The amount of Jiggle joints in the Jiggle modification.

func (Instance) Mass

func (self Instance) Mass() Float.X

The default amount of mass assigned to the Jiggle joints, if they are not overridden. Higher values lead to faster movements and more overshooting.

func (Instance) SetCollisionMask

func (self Instance) SetCollisionMask(collision_mask int)

Sets the collision mask that the Jiggle modifier will use when reacting to colliders, if the Jiggle modifier is set to take colliders into account.

func (Instance) SetDamping

func (self Instance) SetDamping(value Float.X)

SetDamping sets the property returned by [GetDamping].

func (Instance) SetGravity

func (self Instance) SetGravity(value Vector2.XY)

SetGravity sets the property returned by [GetGravity].

func (Instance) SetJiggleDataChainLength

func (self Instance) SetJiggleDataChainLength(value int)

SetJiggleDataChainLength sets the property returned by [GetJiggleDataChainLength].

func (Instance) SetJiggleJointBone2dNode

func (self Instance) SetJiggleJointBone2dNode(joint_idx int, bone2d_node string)

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

func (Instance) SetJiggleJointBoneIndex

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

Sets the bone index, 'bone_idx', of the Jiggle joint at 'joint_idx'. When possible, this will also update the bone2d_node of the Jiggle joint based on data provided by the linked skeleton.

func (Instance) SetJiggleJointDamping

func (self Instance) SetJiggleJointDamping(joint_idx int, damping Float.X)

Sets the amount of damping of the Jiggle joint at 'joint_idx'.

func (Instance) SetJiggleJointGravity

func (self Instance) SetJiggleJointGravity(joint_idx int, gravity Vector2.XY)

Sets the gravity vector of the Jiggle joint at 'joint_idx'.

func (Instance) SetJiggleJointMass

func (self Instance) SetJiggleJointMass(joint_idx int, mass Float.X)

Sets the of mass of the Jiggle joint at 'joint_idx'.

func (Instance) SetJiggleJointOverride

func (self Instance) SetJiggleJointOverride(joint_idx int, override bool)

Sets whether the Jiggle joint at 'joint_idx' should override the default Jiggle joint settings. Setting this to true will make the joint use its own settings rather than the default ones attached to the modification.

func (Instance) SetJiggleJointStiffness

func (self Instance) SetJiggleJointStiffness(joint_idx int, stiffness Float.X)

Sets the of stiffness of the Jiggle joint at 'joint_idx'.

func (Instance) SetJiggleJointUseGravity

func (self Instance) SetJiggleJointUseGravity(joint_idx int, use_gravity bool)

Sets whether the Jiggle joint at 'joint_idx' should use gravity.

func (Instance) SetMass

func (self Instance) SetMass(value Float.X)

SetMass sets the property returned by [GetMass].

func (*Instance) SetObject

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

func (Instance) SetStiffness

func (self Instance) SetStiffness(value Float.X)

SetStiffness sets the property returned by [GetStiffness].

func (Instance) SetTargetNodepath

func (self Instance) SetTargetNodepath(value string)

SetTargetNodepath sets the property returned by [GetTargetNode].

func (Instance) SetUseColliders

func (self Instance) SetUseColliders(use_colliders bool)

If true, the Jiggle modifier will take colliders into account, keeping them from entering into these collision objects.

func (Instance) SetUseGravity

func (self Instance) SetUseGravity(value bool)

SetUseGravity sets the property returned by [GetUseGravity].

func (Instance) Stiffness

func (self Instance) Stiffness() Float.X

The default amount of stiffness assigned to the Jiggle joints, if they are not overridden. Higher values act more like springs, quickly moving into the correct position.

func (Instance) TargetNodepath

func (self Instance) TargetNodepath() string

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

func (Instance) UseGravity

func (self Instance) UseGravity() bool

Whether the gravity vector, Gravity, should be applied to the Jiggle joints, assuming they are not overriding the default settings.

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