Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

SkeletonModification2DPhysicalBones

继承: SkeletonModification2D < Resource < RefCounted < Object

PhysicalBone2D 节点的变换应用到 Bone2D 节点的修改器。

描述

该修改采用 PhysicalBone2D 节点的变换并将它们应用于 Bone2D 节点。由于链接的 PhysicalBone2D 节点,这允许 Bone2D 节点对物理做出反应。

实验性的。物理骨骼在未来可能会被改变,以便自行执行 Bone2D 的位置更新。

属性

int

physical_bone_chain_length

0

方法

void

fetch_physical_bones ( )

NodePath

get_physical_bone_node ( int joint_idx ) const

void

set_physical_bone_node ( int joint_idx, NodePath physicalbone2d_node )

void

start_simulation ( StringName[] bones=[] )

void

stop_simulation ( StringName[] bones=[] )


属性说明

int physical_bone_chain_length = 0

  • void set_physical_bone_chain_length ( int value )

  • int get_physical_bone_chain_length ( )

在这个修改器中链接的 PhysicalBone2D 节点的数量。


方法说明

void fetch_physical_bones ( )

清空 PhysicalBone2D 节点列表,并使用该 Skeleton2D 节点的所有 PhysicalBone2D 子节点填充该列表。


NodePath get_physical_bone_node ( int joint_idx ) const

返回位于 joint_idxPhysicalBone2D 节点。


void set_physical_bone_node ( int joint_idx, NodePath physicalbone2d_node )

设置位于 joint_idxPhysicalBone2D 节点。

注意:这个索引只适用于这个修改器,不是 Skeleton2D 使用的骨骼索引。


void start_simulation ( StringName[] bones=[] )

PhysicalBone2D 节点开始模拟,开始与物理世界进行交互。

还可以把骨骼名称数组传给这个函数,会导致只有这些名称的 PhysicalBone2D 节点开始模拟。


void stop_simulation ( StringName[] bones=[] )

PhysicalBone2D 节点停止模拟,不再与物理世界进行交互。

还可以把骨骼名称数组传给这个函数,会导致只有这些名称的 PhysicalBone2D 节点停止模拟。