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...
Shape3D¶
继承: Resource < RefCounted < Object
派生: BoxShape3D, CapsuleShape3D, ConcavePolygonShape3D, ConvexPolygonShape3D, CylinderShape3D, HeightMapShape3D, SeparationRayShape3D, SphereShape3D, WorldBoundaryShape3D
用于物理碰撞的 3D 形状的抽象基类。
描述¶
所有 3D 形状的抽象基类,针对物理使用设计。
性能:对图元形状进行碰撞检测很快,尤其是 SphereShape3D。ConvexPolygonShape3D 和 HeightMapShape3D 较慢,ConcavePolygonShape3D 最慢。
教程¶
属性¶
|
||
|
方法¶
get_debug_mesh ( ) |
属性说明¶
float custom_solver_bias = 0.0
该形状的的自定义求解器偏差。定义了强制接触分离涉及到这个形状时,物体会做出多大的反应。
设为 0.0
时,使用的默认值为 ProjectSettings.physics/3d/solver/default_contact_bias。
float margin = 0.04
该形状的碰撞边距。Godot Physics 中未使用。
碰撞边距允许通过在形状周围添加额外的外壳来使碰撞检测更有效。当物体重叠的部分超过其边距时,碰撞算法的成本会更高,所以边距的数值越高对性能越好,但代价是边缘的精度会降低,因为会让边缘的锐度降低。
方法说明¶
ArrayMesh get_debug_mesh ( )
返回用于绘制此 Shape3D 的调试碰撞的 ArrayMesh。