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.

SkeletonModification2DTwoBoneIK

Experimental: This class may be changed or removed in future versions.

Hereda: SkeletonModification2D < Resource < RefCounted < Object

Una modificación que rota dos huesos usando la ley de los cosenos para alcanzar el objetivo.

Descripción

This SkeletonModification2D uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosines and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three vertices of the triangle. Because the algorithm works by making a triangle, it can only operate on two bones.

TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two bones that bend to reach a target. This solver is more lightweight than SkeletonModification2DFABRIK, but gives similar, natural looking results.

Propiedades

bool

flip_bend_direction

false

float

target_maximum_distance

0.0

float

target_minimum_distance

0.0

NodePath

target_nodepath

NodePath("")

Métodos

NodePath

get_joint_one_bone2d_node() const

int

get_joint_one_bone_idx() const

NodePath

get_joint_two_bone2d_node() const

int

get_joint_two_bone_idx() const

void

set_joint_one_bone2d_node(bone2d_node: NodePath)

void

set_joint_one_bone_idx(bone_idx: int)

void

set_joint_two_bone2d_node(bone2d_node: NodePath)

void

set_joint_two_bone_idx(bone_idx: int)


Descripciones de Propiedades

bool flip_bend_direction = false 🔗

  • void set_flip_bend_direction(value: bool)

  • bool get_flip_bend_direction()

Si es true, los huesos en la modificación se doblarán hacia afuera en lugar de hacia adentro al contraerse. Si es false, los huesos se doblarán hacia adentro al contraerse.


float target_maximum_distance = 0.0 🔗

  • void set_target_maximum_distance(value: float)

  • float get_target_maximum_distance()

La distancia máxima a la que puede estar el objetivo. Si el objetivo está más lejos de esta distancia, la modificación se resolverá como si estuviera a esta distancia máxima. Cuando se establece en 0, la modificación se resolverá sin restricciones de distancia.


float target_minimum_distance = 0.0 🔗

  • void set_target_minimum_distance(value: float)

  • float get_target_minimum_distance()

La distancia mínima a la que puede estar el objetivo. Si el objetivo está más cerca de esta distancia, la modificación se resolverá como si estuviera a esta distancia mínima. Cuando se establece en 0, la modificación se resolverá sin restricciones de distancia.


NodePath target_nodepath = NodePath("") 🔗

La NodePath al nodo que es el objetivo para la modificación TwoBoneIK. Este nodo es lo que la modificación usará cuando doble los nodos Bone2D.


Descripciones de Métodos

NodePath get_joint_one_bone2d_node() const 🔗

Devuelve el nodo Bone2D que se está utilizando como el primer hueso en la modificación TwoBoneIK.


int get_joint_one_bone_idx() const 🔗

Devuelve el índice del nodo Bone2D que se está utilizando como el primer hueso en la modificación TwoBoneIK.


NodePath get_joint_two_bone2d_node() const 🔗

Devuelve el nodo Bone2D que se está utilizando como el segundo hueso en la modificación TwoBoneIK.


int get_joint_two_bone_idx() const 🔗

Devuelve el índice del nodo Bone2D que se está utilizando como el segundo hueso en la modificación TwoBoneIK.


void set_joint_one_bone2d_node(bone2d_node: NodePath) 🔗

Establece el nodo Bone2D que se está utilizando como el primer hueso en la modificación TwoBoneIK.


void set_joint_one_bone_idx(bone_idx: int) 🔗

Establece el índice del nodo Bone2D que se está utilizando como el primer hueso en la modificación TwoBoneIK.


void set_joint_two_bone2d_node(bone2d_node: NodePath) 🔗

Establece el nodo Bone2D que se está utilizando como el segundo hueso en la modificación TwoBoneIK.


void set_joint_two_bone_idx(bone_idx: int) 🔗

Establece el índice del nodo Bone2D que se está utilizando como el segundo hueso en la modificación TwoBoneIK.