Class ConvexPolygonShape3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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, CreateMultipleConvexCollisions(MeshConvexDecompositionSettings) 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.
public class ConvexPolygonShape3D : Shape3D, IDisposable
- Inheritance
-
ConvexPolygonShape3D
- Implements
- Inherited Members
Constructors
ConvexPolygonShape3D()
public ConvexPolygonShape3D()
Properties
Points
The list of 3D points forming the convex polygon shape.
public Vector3[] Points { get; set; }
Property Value
- Vector3[]
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.