CSGShape3D
The CSG base class.
CSGShape3D.swift:14class CSGShape3D
This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
Superclasses
class GeometryInstance3D
Base node for geometry-based visual instances.
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.
Types
Type members
Instance members
var calculateTangents: Bool
Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child.
var collisionLayer: UInt32
The physics layers this area is in.
var collisionMask: UInt32
The physics layers this CSG shape scans for collisions. Only effective if
useCollision
istrue
. See Collision layers and masks in the documentation for more information.var collisionPriority: Double
The priority used to solve colliding when occurring penetration. Only effective if
useCollision
istrue
. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level.var operation: CSGShape3D.Operation
The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
var snap: Double
Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust.
var useCollision: Bool
Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also
collisionMask
andcollisionPriority
.func getCollisionLayerValue(layerNumber: Int32
) -> Bool Returns whether or not the specified layer of the
collisionLayer
is enabled, given alayerNumber
between 1 and 32.func getCollisionMaskValue(layerNumber: Int32
) -> Bool Returns whether or not the specified layer of the
collisionMask
is enabled, given alayerNumber
between 1 and 32.func getMeshes(
) -> GArray Returns an
GArray
with two elements, the first is theTransform3D
of this node and the second is the rootMesh
of this node. Only works when this node is the root shape.func isRootShape(
) -> Bool Returns
true
if this is a root shape and is thus the object that is rendered.func setCollisionLayerValue(layerNumber: Int32, value: Bool
) Based on
value
, enables or disables the specified layer in thecollisionLayer
, given alayerNumber
between 1 and 32.func setCollisionMaskValue(layerNumber: Int32, value: Bool
) Based on
value
, enables or disables the specified layer in thecollisionMask
, given alayerNumber
between 1 and 32.
Subclasses
class CSGCombiner3D
A CSG node that allows you to combine other CSG modifiers.
class CSGPrimitive3D
Base class for CSG primitives.