ConvexPolygonShape3D

Inherits: Shape3D < Resource < RefCounted < Object

Convex polygon shape resource for 3D physics.

Description

3D convex polygon shape resource to be added as a direct child of a PhysicsBody3D or Area3D using a CollisionShape3D node. Unlike ConcavePolygonShape3D, ConvexPolygonShape3D cannot store concave polygon shapes. ConvexPolygonShape2Ds can be manually drawn in the editor using the CollisionPolygon3D node.

Convex decomposition: Concave objects' collisions can be represented accurately using several ConvexPolygonShape3Ds. This allows dynamic physics bodies to have complex concave collisions (at a performance cost). This is available in the editor by selecting the MeshInstance3D, going to the Mesh menu and choosing 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 or BoxShape3D. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by a primitive shape.

Tutorials

Properties

PackedVector3Array

points

PackedVector3Array()

Property Descriptions

Default

PackedVector3Array()

Setter

set_points(value)

Getter

get_points()

The list of 3D points forming the convex polygon shape.