Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

BoneTwistDisperser3D

Eredita: SkeletonModifier3D < Node3D < Node < Object

A node that propagates and disperses the child bone's twist to the parent bones.

Descrizione

Questo BoneTwistDisperser3D consente un'interpolazione fluida della torsione tra più ossa, distribuendo la torsione dell'osso finale agli ossi genitori. Così viene modificata solo la torsione, senza alterare la posizione globale di ciascuna articolazione.

È utile per torcere le ossa fluidamente in combinazione con CopyTransformModifier3D e IK.

Nota: Se la torsione estratta è superiore a 180 gradi, avviene un ribaltamento. Questo comportamento è simile a quello di ConvertTransformModifier3D.

Nota: La maggior parte dei metodi di questa classe accetta un parametro index. Questo parametro specifica quale voce nell'elenco delle impostazioni restituire, se l'IK ha più voci (ad esempio, settings/<index>/root_bone_name).

Proprietà

bool

mutable_bone_axes

true

int

setting_count

0

Metodi

void

clear_settings()

Curve

get_damping_curve(index: int) const

DisperseMode

get_disperse_mode(index: int) const

int

get_end_bone(index: int) const

BoneDirection

get_end_bone_direction(index: int) const

String

get_end_bone_name(index: int) const

int

get_joint_bone(index: int, joint: int) const

String

get_joint_bone_name(index: int, joint: int) const

int

get_joint_count(index: int) const

float

get_joint_twist_amount(index: int, joint: int) const

int

get_reference_bone(index: int) const

String

get_reference_bone_name(index: int) const

int

get_root_bone(index: int) const

String

get_root_bone_name(index: int) const

Quaternion

get_twist_from(index: int) const

float

get_weight_position(index: int) const

bool

is_end_bone_extended(index: int) const

bool

is_twist_from_rest(index: int) const

void

set_damping_curve(index: int, curve: Curve)

void

set_disperse_mode(index: int, disperse_mode: DisperseMode)

void

set_end_bone(index: int, bone: int)

void

set_end_bone_direction(index: int, bone_direction: BoneDirection)

void

set_end_bone_name(index: int, bone_name: String)

void

set_extend_end_bone(index: int, enabled: bool)

void

set_joint_twist_amount(index: int, joint: int, twist_amount: float)

void

set_root_bone(index: int, bone: int)

void

set_root_bone_name(index: int, bone_name: String)

void

set_twist_from(index: int, from: Quaternion)

void

set_twist_from_rest(index: int, enabled: bool)

void

set_weight_position(index: int, weight_position: float)


Enumerazioni

enum DisperseMode: 🔗

DisperseMode DISPERSE_MODE_EVEN = 0

Assign amounts so that they monotonically increase from 0.0 to 1.0, ensuring all weights are equal. For example, with five joints, the amounts would be 0.2, 0.4, 0.6, 0.8, and 1.0 starting from the root bone.

DisperseMode DISPERSE_MODE_WEIGHTED = 1

Assign amounts so that they monotonically increase from 0.0 to 1.0, based on the length of the bones between joint segments. See also set_weight_position().

DisperseMode DISPERSE_MODE_CUSTOM = 2

You can assign arbitrary amounts to the joint list. See also set_joint_twist_amount().

When is_end_bone_extended() is false, a child of the reference bone exists solely to determine the twist axis, so its custom amount has absolutely no effect at all.


Descrizioni delle proprietà

bool mutable_bone_axes = true 🔗

  • void set_mutable_bone_axes(value: bool)

  • bool are_bone_axes_mutable()

If true, the solver retrieves the bone axis from the bone pose every frame.

If false, the solver retrieves the bone axis from the bone rest and caches it.


int setting_count = 0 🔗

  • void set_setting_count(value: int)

  • int get_setting_count()

Il numero di impostazioni.


Descrizioni dei metodi

void clear_settings() 🔗

Cancella tutte le impostazioni.


Curve get_damping_curve(index: int) const 🔗

Returns the damping curve when get_disperse_mode() is DISPERSE_MODE_CUSTOM.


DisperseMode get_disperse_mode(index: int) const 🔗

Returns whether to use automatic amount assignment or to allow manual assignment.


int get_end_bone(index: int) const 🔗

Restituisce l'indice dell'osso finale della catena d'ossa.


BoneDirection get_end_bone_direction(index: int) const 🔗

Returns the tail direction of the end bone of the bone chain when is_end_bone_extended() is true.


String get_end_bone_name(index: int) const 🔗

Restituisce il nome dell'osso finale della coda d'ossa.


int get_joint_bone(index: int, joint: int) const 🔗

Restituisce l'indice dell'osso in joint nella lista delle articolazioni della catena d'ossa.


String get_joint_bone_name(index: int, joint: int) const 🔗

Restituisce il nome dell'osso in joint nella lista delle articolazioni della catena d'ossa.


int get_joint_count(index: int) const 🔗

Restituisce il numero di articolazioni nella lista delle articolazioni della catena d'ossa.


float get_joint_twist_amount(index: int, joint: int) const 🔗

Restituisce la quantità di torsione in joint nella lista delle articolazioni della catena d'ossa quando get_disperse_mode() è DISPERSE_MODE_CUSTOM.


int get_reference_bone(index: int) const 🔗

Returns the reference bone to extract twist of the setting at index.

This bone is either the end of the chain or its parent, depending on is_end_bone_extended().


String get_reference_bone_name(index: int) const 🔗

Returns the reference bone name to extract twist of the setting at index.

This bone is either the end of the chain or its parent, depending on is_end_bone_extended().


int get_root_bone(index: int) const 🔗

Restituisce l'indice dell'osso radice della catena d'ossa.


String get_root_bone_name(index: int) const 🔗

Restituisce il nome dell'osso radice della catena d'ossa.


Quaternion get_twist_from(index: int) const 🔗

Returns the rotation to an arbitrary state before twisting for the current bone pose to extract the twist when is_twist_from_rest() is false.


float get_weight_position(index: int) const 🔗

Returns the position at which to divide the segment between joints for weight assignment when get_disperse_mode() is DISPERSE_MODE_WEIGHTED.


bool is_end_bone_extended(index: int) const 🔗

Returns true if the end bone is extended to have a tail.


bool is_twist_from_rest(index: int) const 🔗

Returns true if extracting the twist amount from the difference between the bone rest and the current bone pose.


void set_damping_curve(index: int, curve: Curve) 🔗

Sets the damping curve when get_disperse_mode() is DISPERSE_MODE_CUSTOM.


void set_disperse_mode(index: int, disperse_mode: DisperseMode) 🔗

Sets whether to use automatic amount assignment or to allow manual assignment.


void set_end_bone(index: int, bone: int) 🔗

Imposta l'indice dell'osso finale della catena d'ossa.


void set_end_bone_direction(index: int, bone_direction: BoneDirection) 🔗

Imposta la direzione della coda dell'osso finale della catena d'ossa quando is_end_bone_extended() è true.


void set_end_bone_name(index: int, bone_name: String) 🔗

Sets the end bone name of the bone chain.

Note: The end bone must be a child of the root bone.


void set_extend_end_bone(index: int, enabled: bool) 🔗

Se enabled è true, l'osso finale è allungato per avere una coda.

Se enabled è false, get_reference_bone() diventa un genitore dell'osso finale e utilizza il vettore dell'osso finale come asse di torsione.


void set_joint_twist_amount(index: int, joint: int, twist_amount: float) 🔗

Imposta la quantità di torsione in joint nella lista delle articolazioni della catena d'ossa quando get_disperse_mode() è DISPERSE_MODE_CUSTOM.


void set_root_bone(index: int, bone: int) 🔗

Imposta l'indice dell'osso radice della catena d'ossa.


void set_root_bone_name(index: int, bone_name: String) 🔗

Imposta il nome dell'osso radice della catena d'ossa.


void set_twist_from(index: int, from: Quaternion) 🔗

Sets the rotation to an arbitrary state before twisting for the current bone pose to extract the twist when is_twist_from_rest() is false.

In other words, by calling set_twist_from() by SkeletonModifier3D.modification_processed of a specific SkeletonModifier3D, you can extract only the twists generated by modifiers processed after that but before this BoneTwistDisperser3D.


void set_twist_from_rest(index: int, enabled: bool) 🔗

If enabled is true, it extracts the twist amount from the difference between the bone rest and the current bone pose.

If enabled is false, it extracts the twist amount from the difference between get_twist_from() and the current bone pose. See also set_twist_from().


void set_weight_position(index: int, weight_position: float) 🔗

Sets the position at which to divide the segment between joints for weight assignment when get_disperse_mode() is DISPERSE_MODE_WEIGHTED.

For example, when weight_position is 0.5, if two bone segments with a length of 1.0 exist between three joints, weights are assigned to each joint from root to end at ratios of 0.5, 1.0, and 0.5. Then amounts become 0.25, 0.75, and 1.0 respectively.