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.
Checking the stable version of the documentation...
SoftBody3D¶
继承: MeshInstance3D < GeometryInstance3D < VisualInstance3D < Node3D < Node < Object
可形变的 3D 物理网格。
描述¶
可形变的 3D 物理网格。用于创建弹性或可形变的对象,例如布料、橡胶或其他柔性材质。
注意:SoftBody3D 中有许多已知的问题。因此,不建议用于可能影响游戏玩法的东西上(例如蹦床)。
教程¶
属性¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法¶
void |
add_collision_exception_with ( Node body ) |
get_collision_layer_value ( int layer_number ) const |
|
get_collision_mask_value ( int layer_number ) const |
|
get_physics_rid ( ) const |
|
get_point_transform ( int point_index ) |
|
is_point_pinned ( int point_index ) const |
|
void |
remove_collision_exception_with ( Node body ) |
void |
set_collision_layer_value ( int layer_number, bool value ) |
void |
set_collision_mask_value ( int layer_number, bool value ) |
void |
set_point_pinned ( int point_index, bool pinned, NodePath attachment_path=NodePath("") ) |
枚举¶
enum DisableMode:
DisableMode DISABLE_MODE_REMOVE = 0
当 Node.process_mode 被设置为 Node.PROCESS_MODE_DISABLED 时,从物理仿真中移除,停止与此 SoftBody3D 的所有物理交互。
当该 Node 再次被处理时,会自动重新加入到物理仿真中。
DisableMode DISABLE_MODE_KEEP_ACTIVE = 1
当 Node.process_mode 被设置为 Node.PROCESS_MODE_DISABLED 时,不影响物理仿真。
属性说明¶
int collision_layer = 1
该 SoftBody3D 所在的物理层。碰撞对象可以存在于 32 个不同层中的一个或多个层中。另见 collision_mask。
注意:只有当对象 B 位于对象 A 扫描的任意层中时,对象 A 才能检测到与对象 B 的接触。有关更多信息,请参阅文档中的《碰撞层与掩码》。
int collision_mask = 1
该 SoftBody3D 扫描的物理层。碰撞对象可以扫描 32 个不同层中的一个或多个层。另见 collision_layer。
注意:只有当对象 B 位于对象 A 扫描的任何层中时,对象 A 才能检测到与对象 B 的接触。有关更多信息,请参阅文档中的《碰撞层与掩码》。
float damping_coefficient = 0.01
目前没有这个属性的描述。请帮我们贡献一个!
DisableMode disable_mode = 0
void set_disable_mode ( DisableMode value )
DisableMode get_disable_mode ( )
当 Node.process_mode 被设置为 Node.PROCESS_MODE_DISABLED 时,定义物理行为。有关不同模式的更多详细信息,请参阅 DisableMode。
float drag_coefficient = 0.0
目前没有这个属性的描述。请帮我们贡献一个!
float linear_stiffness = 0.5
值越大得到的物体约坚硬,较低的值会提高物体的弯曲能力。取值范围为 0.0
到 1.0
之间(含端点)。
NodePath parent_collision_ignore = NodePath("")
指向 CollisionObject3D 的 NodePath,这个 SoftBody3D 应该避免穿过它。
float pressure_coefficient = 0.0
目前没有这个属性的描述。请帮我们贡献一个!
bool ray_pickable = true
如果为 true
,则该 SoftBody3D 会响应 RayCast3D。
int simulation_precision = 5
增加这个值会改善模拟结果,但会影响性能。请小心使用。
float total_mass = 1.0
该 SoftBody3D 的质量。
方法说明¶
void add_collision_exception_with ( Node body )
将一个物体添加到这个物体不能碰撞的物体列表中。
PhysicsBody3D[] get_collision_exceptions ( )
返回该物体的碰撞例外节点数组。
bool get_collision_layer_value ( int layer_number ) const
返回 collision_layer 中是否启用了指定的层,给定的 layer_number
应在 1 和 32 之间。
bool get_collision_mask_value ( int layer_number ) const
返回 collision_mask 中是否启用了指定的层,给定的 layer_number
应在 1 和 32 之间。
RID get_physics_rid ( ) const
目前没有这个方法的描述。请帮我们贡献一个!
Vector3 get_point_transform ( int point_index )
返回表面数组中顶点的局部平移。
bool is_point_pinned ( int point_index ) const
如果顶点设置为固定,则返回 true
。
void remove_collision_exception_with ( Node body )
将一个物体从该物体不能碰撞的物体列表中移除。
void set_collision_layer_value ( int layer_number, bool value )
根据 value
,启用或禁用 collision_layer 中指定的层,给定的 layer_number
应在 1 和 32 之间。
void set_collision_mask_value ( int layer_number, bool value )
根据 value
,启用或禁用 collision_mask 中指定的层,给定的 layer_number
应在 1 和 32 之间。
void set_point_pinned ( int point_index, bool pinned, NodePath attachment_path=NodePath("") )
设置表面顶点的固定状态。当设置为 true
时,可选的 attachment_path
可以定义一个 Node3D,该固定顶点将被附加到该节点。