Skip to content
0.2.0-dev Download ZIP
20 lines ·1.9 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="ConvexPolygonShape3D" inherits="Shape3D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A 3D convex polyhedron shape used for physics collision.
5 </brief_description>
6 <description>
7 A 3D convex polyhedron shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D].
8 [ConvexPolygonShape3D] is [i]solid[/i], 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.
9 [b]Convex decomposition:[/b] 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 [b]Mesh[/b] menu that appears above the viewport, and choose [b]Create Multiple Convex Collision Siblings[/b]. Alternatively, [method MeshInstance3D.create_multiple_convex_collisions] can be called in a script to perform this decomposition at run-time.
10 [b]Performance:[/b] [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.
11 </description>
12 <tutorials>
13 <link title="3D Physics Tests Demo">https://godotengine.org/asset-library/asset/2747</link>
14 </tutorials>
15 <members>
16 <member name="points" type="PackedVector3Array" setter="set_points" getter="get_points" default="PackedVector3Array()">
17 The list of 3D points forming the convex polygon shape.
18 </member>
19 </members>
20</class>