Table of Contents

Class SkeletonModification2DJiggle

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class SkeletonModification2DJiggle : SkeletonModification2D, IDisposable
Inheritance
SkeletonModification2DJiggle
Implements
Inherited Members

Constructors

SkeletonModification2DJiggle()

public SkeletonModification2DJiggle()

Properties

Damping

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.

public float Damping { get; set; }

Property Value

float

Gravity

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

public Vector2 Gravity { get; set; }

Property Value

Vector2

JiggleDataChainLength

The amount of Jiggle joints in the Jiggle modification.

public int JiggleDataChainLength { get; set; }

Property Value

int

Mass

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

public float Mass { get; set; }

Property Value

float

Stiffness

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.

public float Stiffness { get; set; }

Property Value

float

TargetNodePath

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.

public NodePath TargetNodePath { get; set; }

Property Value

NodePath

UseGravity

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

public bool UseGravity { get; set; }

Property Value

bool

Methods

GetCollisionMask()

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

public int GetCollisionMask()

Returns

int

GetJiggleJointBone2DNode(int)

Returns the Bone2D node assigned to the Jiggle joint at jointIdx.

public NodePath GetJiggleJointBone2DNode(int jointIdx)

Parameters

jointIdx int

Returns

NodePath

GetJiggleJointBoneIndex(int)

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

public int GetJiggleJointBoneIndex(int jointIdx)

Parameters

jointIdx int

Returns

int

GetJiggleJointDamping(int)

Returns the amount of damping of the Jiggle joint at jointIdx.

public float GetJiggleJointDamping(int jointIdx)

Parameters

jointIdx int

Returns

float

GetJiggleJointGravity(int)

Returns a Vector2 representing the amount of gravity the Jiggle joint at jointIdx is influenced by.

public Vector2 GetJiggleJointGravity(int jointIdx)

Parameters

jointIdx int

Returns

Vector2

GetJiggleJointMass(int)

Returns the amount of mass of the jiggle joint at jointIdx.

public float GetJiggleJointMass(int jointIdx)

Parameters

jointIdx int

Returns

float

GetJiggleJointOverride(int)

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

public bool GetJiggleJointOverride(int jointIdx)

Parameters

jointIdx int

Returns

bool

GetJiggleJointStiffness(int)

Returns the stiffness of the Jiggle joint at jointIdx.

public float GetJiggleJointStiffness(int jointIdx)

Parameters

jointIdx int

Returns

float

GetJiggleJointUseGravity(int)

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

public bool GetJiggleJointUseGravity(int jointIdx)

Parameters

jointIdx int

Returns

bool

GetUseColliders()

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

public bool GetUseColliders()

Returns

bool

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

SetCollisionMask(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.

public void SetCollisionMask(int collisionMask)

Parameters

collisionMask int

SetJiggleJointBone2DNode(int, NodePath)

Sets the Bone2D node assigned to the Jiggle joint at jointIdx.

public void SetJiggleJointBone2DNode(int jointIdx, NodePath bone2DNode)

Parameters

jointIdx int
bone2DNode NodePath

SetJiggleJointBoneIndex(int, int)

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

public void SetJiggleJointBoneIndex(int jointIdx, int boneIdx)

Parameters

jointIdx int
boneIdx int

SetJiggleJointDamping(int, float)

Sets the amount of damping of the Jiggle joint at jointIdx.

public void SetJiggleJointDamping(int jointIdx, float damping)

Parameters

jointIdx int
damping float

SetJiggleJointGravity(int, Vector2)

Sets the gravity vector of the Jiggle joint at jointIdx.

public void SetJiggleJointGravity(int jointIdx, Vector2 gravity)

Parameters

jointIdx int
gravity Vector2

SetJiggleJointMass(int, float)

Sets the of mass of the Jiggle joint at jointIdx.

public void SetJiggleJointMass(int jointIdx, float mass)

Parameters

jointIdx int
mass float

SetJiggleJointOverride(int, bool)

Sets whether the Jiggle joint at jointIdx 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.

public void SetJiggleJointOverride(int jointIdx, bool @override)

Parameters

jointIdx int
override bool

SetJiggleJointStiffness(int, float)

Sets the of stiffness of the Jiggle joint at jointIdx.

public void SetJiggleJointStiffness(int jointIdx, float stiffness)

Parameters

jointIdx int
stiffness float

SetJiggleJointUseGravity(int, bool)

Sets whether the Jiggle joint at jointIdx should use gravity.

public void SetJiggleJointUseGravity(int jointIdx, bool useGravity)

Parameters

jointIdx int
useGravity bool

SetUseColliders(bool)

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

public void SetUseColliders(bool useColliders)

Parameters

useColliders bool