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...
ConvexPolygonShape3D
继承: Shape3D < Resource < RefCounted < Object
用于物理碰撞的 3D 凸多面体形状。
描述
3D 凸多面体形状,旨在用于物理。常用来为 CollisionShape3D 提供形状。
ConvexPolygonShape3D 是实心的,与空心的 ConcavePolygonShape3D 不同,如果对象完全位于其内部,也能够检测到碰撞。因此更适于检测和物理。
凸分解:凹多面体可以拆分为多个凸多面体。这样就能够让动态物理体拥有复杂的凹碰撞(以消耗性能为代价),做法是使用多个 ConvexPolygonShape3D 节点。要根据网格生成凸分解,请选中 MeshInstance3D 节点,前往出现在视口上方的 Mesh 菜单,然后选择创建多个凸碰撞同级。或者也可以在脚本中调用 MeshInstance3D.create_multiple_convex_collisions(),在运行时执行分解。
性能:ConvexPolygonShape3D 检查碰撞的速度比 ConcavePolygonShape3D 要快,但比 SphereShape3D、BoxShape3D 等基本碰撞形状要慢。通常应该仅限于中等大小的对象,在无法使用基本形状精确表示碰撞时使用。
教程
属性
|
属性说明
PackedVector3Array points = PackedVector3Array()
🔗
void set_points(value: PackedVector3Array)
PackedVector3Array get_points()
形成凸多边形的 3D 点列表。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector3Array for more details.