Shape3D
Abstract base class for 3D shapes used for physics collision.
Shape3D.swift:14class Shape3D
Abstract base class for all 3D shapes, intended for use in physics.
Performance: Primitive shapes, especially SphereShape3D
, are fast to check collisions against. ConvexPolygonShape3D
and HeightMapShape3D
are slower, and ConcavePolygonShape3D
is the slowest.
Superclasses
class Resource
Base class for serializable objects.
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 customSolverBias: Double
The shape’s custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved.
var margin: Double
The collision margin for the shape. This is not used in Godot Physics.
func getDebugMesh(
) -> ArrayMesh? Returns the
ArrayMesh
used to draw the debug collision for thisShape3D
.
Subclasses
class BoxShape3D
A 3D box shape used for physics collision.
class CapsuleShape3D
A 3D capsule shape used for physics collision.
class ConcavePolygonShape3D
A 3D trimesh shape used for physics collision.
class ConvexPolygonShape3D
A 3D convex polyhedron shape used for physics collision.
class CylinderShape3D
A 3D cylinder shape used for physics collision.
class HeightMapShape3D
A 3D height map shape used for physics collision.
class SeparationRayShape3D
A 3D ray shape used for physics collision that tries to separate itself from any collider.
class SphereShape3D
A 3D sphere shape used for physics collision.
class WorldBoundaryShape3D
A 3D world boundary (half-space) shape used for physics collision.