ConvexPolygonShape3D
Inherits:Shape3D<Resource<RefCounted<Object
A 3D convex polyhedron shape used for physics collision.
Description
A 3D convex polyhedron shape, intended for use in physics. Usually used to provide a shape for aCollisionShape3D.
ConvexPolygonShape3D issolid, which means it detects collisions from objects that are fully inside it, unlikeConcavePolygonShape3D 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 severalConvexPolygonShape3D nodes. To generate a convex decomposition from a mesh, select theMeshInstance3D node, go to theMesh menu that appears above the viewport, and chooseCreate 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 toConcavePolygonShape3D, but it is slower than primitive collision shapes such asSphereShape3D andBoxShape3D. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes.
Tutorials
Properties
|
Property Descriptions
PackedVector3Arraypoints =PackedVector3Array()
🔗
The list of 3D points forming the convex polygon shape.
Note: The returned array iscopied and any changes to it will not update the original property value. SeePackedVector3Array for more details.