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.

ChainIK3D

继承: IKModifier3D < SkeletonModifier3D < Node3D < Node < Object

派生: IterateIK3D, SplineIK3D

SkeletonModifier3D 用于对包含任意数量骨骼的骨骼链应用反向动力学。

描述

SkeletonModifier3D 的基类,能够自动根据根骨骼与末端骨骼之间的骨骼生成关节列表。

注意:该类中的所有方法均接受一个 index 参数。如果 IK 包含多个条目(例如 settings/<index>/root_bone_name),该参数用于指定应返回哪条设置列表条目。

方法

int

get_end_bone(index: int) const

BoneDirection

get_end_bone_direction(index: int) const

float

get_end_bone_length(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

int

get_root_bone(index: int) const

String

get_root_bone_name(index: int) const

bool

is_end_bone_extended(index: int) const

void

set_end_bone(index: int, bone: int)

void

set_end_bone_direction(index: int, bone_direction: BoneDirection)

void

set_end_bone_length(index: int, length: float)

void

set_end_bone_name(index: int, bone_name: String)

void

set_extend_end_bone(index: int, enabled: bool)

void

set_root_bone(index: int, bone: int)

void

set_root_bone_name(index: int, bone_name: String)


方法说明

int get_end_bone(index: int) const 🔗

返回骨骼链末尾骨骼的索引。


BoneDirection get_end_bone_direction(index: int) const 🔗

is_end_bone_extended()true 时,返回骨骼链末端骨骼的尾部方向。


float get_end_bone_length(index: int) const 🔗

is_end_bone_extended()true 时,返回骨骼链的末端骨骼尾部长度。


String get_end_bone_name(index: int) const 🔗

返回骨骼链末尾骨骼的名称。


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

返回骨骼链关节列表中位于 joint 的骨骼的索引。


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

返回骨骼链关节列表中位于 joint 的骨骼的名称。


int get_joint_count(index: int) const 🔗

返回骨骼链关节列表中的关节数量。


int get_root_bone(index: int) const 🔗

返回骨骼链根骨骼的索引。


String get_root_bone_name(index: int) const 🔗

返回骨骼链根骨骼的名称。


bool is_end_bone_extended(index: int) const 🔗

如果末端骨骼被扩展形成尾部,则返回 true


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

设置骨骼链中末端骨骼的索引。


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

is_end_bone_extended()true 时,设置骨骼链中末端骨骼的尾部方向。


void set_end_bone_length(index: int, length: float) 🔗

is_end_bone_extended()true 时,设置骨骼链中末端骨骼的尾部长度。


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

设置骨骼链的末端骨骼名称。

注意: 末端骨骼必须是根骨骼或根骨骼的子骨骼。如果相同,则必须通过 set_extend_end_bone() 扩展尾部,以修改该骨骼。


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

如果 enabledtrue,则会延伸末端骨骼形成尾部。

扩展的尾部配置会分配给关节列表中的最后一个元素。换句话说,如果将 enabled 设置为 false,则关节列表中最后一个元素的配置对模拟结果没有影响。


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

设置骨骼链中根骨骼的索引。


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

设置骨骼链中根骨骼的名称。