SkeletonModification3DJiggle

Inherits: SkeletonModification3D < Resource < RefCounted < Object

A modification that jiggles bones as they move towards a target.

Description

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 a bone! Jiggle joints hold the data needed for each bone in the bone chain used by the Jiggle modification.

Properties

float

damping

0.75

Vector3

gravity

Vector3(0, -6, 0)

int

jiggle_data_chain_length

0

float

mass

0.75

float

stiffness

3.0

NodePath

target_nodepath

NodePath("")

bool

use_gravity

false

Methods

int

get_collision_mask ( ) const

int

get_jiggle_joint_bone_index ( int joint_idx ) const

String

get_jiggle_joint_bone_name ( int joint_idx ) const

float

get_jiggle_joint_damping ( int joint_idx ) const

Vector3

get_jiggle_joint_gravity ( int joint_idx ) const

float

get_jiggle_joint_mass ( int joint_idx ) const

bool

get_jiggle_joint_override ( int joint_idx ) const

float

get_jiggle_joint_roll ( int joint_idx ) const

float

get_jiggle_joint_stiffness ( int joint_idx ) const

bool

get_jiggle_joint_use_gravity ( int joint_idx ) const

bool

get_use_colliders ( ) const

void

set_collision_mask ( int mask )

void

set_jiggle_joint_bone_index ( int joint_idx, int bone_idx )

void

set_jiggle_joint_bone_name ( int joint_idx, String name )

void

set_jiggle_joint_damping ( int joint_idx, float damping )

void

set_jiggle_joint_gravity ( int joint_idx, Vector3 gravity )

void

set_jiggle_joint_mass ( int joint_idx, float mass )

void

set_jiggle_joint_override ( int joint_idx, bool override )

void

set_jiggle_joint_roll ( int joint_idx, float roll )

void

set_jiggle_joint_stiffness ( int joint_idx, float stiffness )

void

set_jiggle_joint_use_gravity ( int joint_idx, bool use_gravity )

void

set_use_colliders ( bool use_colliders )

Property Descriptions

Default

0.75

Setter

set_damping(value)

Getter

get_damping()

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


Default

Vector3(0, -6, 0)

Setter

set_gravity(value)

Getter

get_gravity()

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


  • int jiggle_data_chain_length

Default

0

Setter

set_jiggle_data_chain_length(value)

Getter

get_jiggle_data_chain_length()

The amount of Jiggle joints in the Jiggle modification.


Default

0.75

Setter

set_mass(value)

Getter

get_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.


Default

3.0

Setter

set_stiffness(value)

Getter

get_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.


Default

NodePath("")

Setter

set_target_node(value)

Getter

get_target_node()

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.


Default

false

Setter

set_use_gravity(value)

Getter

get_use_gravity()

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

Method Descriptions

  • int get_collision_mask ( ) const

Returns the collision mask that the Jiggle modifier will take into account when performing physics calculations.


  • int get_jiggle_joint_bone_index ( int joint_idx ) const

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


  • String get_jiggle_joint_bone_name ( int joint_idx ) const

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


  • float get_jiggle_joint_damping ( int joint_idx ) const

Returns the amount of dampening of the Jiggle joint at joint_idx.


  • Vector3 get_jiggle_joint_gravity ( int joint_idx ) const

Returns a Vector3 representign the amount of gravity the Jiggle joint at joint_idx is influenced by.


  • float get_jiggle_joint_mass ( int joint_idx ) const

Returns the amount of mass of the Jiggle joint at joint_idx.


  • bool get_jiggle_joint_override ( int joint_idx ) const

Returns a boolean that indiciates whether the joint at joint_idx is overriding the default jiggle joint data defined in the modification.


  • float get_jiggle_joint_roll ( int joint_idx ) const

Returns the amount of roll/twist applied to the bone that the Jiggle joint is applied to.


  • float get_jiggle_joint_stiffness ( int joint_idx ) const

Returns the stiffness of the Jiggle joint at joint_idx.


  • bool get_jiggle_joint_use_gravity ( int joint_idx ) const

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


  • bool get_use_colliders ( ) const

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


  • void set_collision_mask ( int mask )

Sets the collision mask that the Jiggle modifier takes into account when performing physics calculations.


  • void set_jiggle_joint_bone_index ( int joint_idx, int bone_idx )

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


  • void set_jiggle_joint_bone_name ( int joint_idx, String name )

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


  • void set_jiggle_joint_damping ( int joint_idx, float damping )

Sets the amount of dampening of the Jiggle joint at joint_idx.


  • void set_jiggle_joint_gravity ( int joint_idx, Vector3 gravity )

Sets the gravity vector of the Jiggle joint at joint_idx.


  • void set_jiggle_joint_mass ( int joint_idx, float mass )

Sets the of mass of the Jiggle joint at joint_idx.


  • void set_jiggle_joint_override ( int joint_idx, bool override )

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.


  • void set_jiggle_joint_roll ( int joint_idx, float roll )

Sets the amount of roll/twist on the bone the Jiggle joint is attached to.


  • void set_jiggle_joint_stiffness ( int joint_idx, float stiffness )

Sets the of stiffness of the Jiggle joint at joint_idx.


  • void set_jiggle_joint_use_gravity ( int joint_idx, bool use_gravity )

Sets whether the Jiggle joint at joint_idx should use gravity.


  • void set_use_colliders ( bool use_colliders )

When true, the Jiggle modifier will use raycasting to prevent the Jiggle joints from rotating themselves into collision objects when solving.