ConvexPolygonShape3D
继承: Shape3D
< Resource
< RefCounted
< Object
A 3D convex polyhedron shape used for physics collision.
描述
A 3D convex polyhedron shape, intended for use in physics. Usually used to provide a shape for a CollisionShape3D
.
ConvexPolygonShape3D is solid, which means it detects collisions from objects that are fully inside it, unlike ConcavePolygonShape3D
which is hollow. This makes it more suitable for both detection and physics.
Convex decomposition: A concave polyhedron can be split up into several convex polyhedra. This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be achieved by using several ConvexPolygonShape3D nodes. To generate a convex decomposition from a mesh, select the MeshInstance3D
node, go to the Mesh menu that appears above the viewport, and choose Create Multiple Convex Collision Siblings. Alternatively, MeshInstance3D.create_multiple_convex_collisions
can be called in a script to perform this decomposition at run-time.
Performance: ConvexPolygonShape3D is faster to check collisions against compared to ConcavePolygonShape3D
, but it is slower than primitive collision shapes such as SphereShape3D
and BoxShape3D
. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
属性
属性说明
PackedVector3Array
points = PackedVector3Array()
void
set_points ( value:PackedVector3Array
)PackedVector3Array
get_points ( )
The list of 3D points forming the convex polygon shape.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedVector3Array
for more details.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。