ConcavePolygonShape3D
A 3D trimesh shape used for physics collision.
ConcavePolygonShape3D.swift:20class ConcavePolygonShape3D
A 3D trimesh shape, intended for use in physics. Usually used to provide a shape for a CollisionShape3D
.
Being just a collection of interconnected triangles, ConcavePolygonShape3D
is the most freely configurable single 3D shape. It can be used to form polyhedra of any nature, or even shapes that don’t enclose a volume. However, ConcavePolygonShape3D
is hollow even if the interconnected triangles do enclose a volume, which often makes it unsuitable for physics or detection.
Performance: Due to its complexity, ConcavePolygonShape3D
is the slowest 3D collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, ConvexPolygonShape3D
should be used. For dynamic physics bodies that need concave collision, several ConvexPolygonShape3D
s can be used to represent its collision by using convex decomposition; see ConvexPolygonShape3D
’s documentation for instructions.
Superclasses
class Shape3D
Abstract base class for 3D shapes used for physics collision.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var backfaceCollision: Bool
If set to
true
, collisions occur on both sides of the concave shape faces. Otherwise they occur only along the face normals.var data: PackedVector3Array