Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
DisableMode
CollisionObject3D.swift:23enum DisableMode
Cases
case remove
When
processMode
is set todisabled
, remove from the physics simulation to stop all physics interactions with thisCollisionObject3D
.case makeStatic
When
processMode
is set todisabled
, make the body static. Doesn’t affectArea3D
.PhysicsBody3D
can’t be affected by forces or other bodies while static.case keepActive
When
processMode
is set todisabled
, do not affect the physics simulation.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (34) members.
Types
class Signal1
Signal support.
Type members
Instance members
var collisionLayer: UInt32
The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also
collisionMask
.var collisionMask: UInt32
The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also
collisionLayer
.var collisionPriority: Double
The priority used to solve colliding when occurring penetration. 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 disableMode: CollisionObject3D.DisableMode
Defines the behavior in physics when
processMode
is set todisabled
. SeeDisableMode
for more details about the different modes.var inputCaptureOnDrag: Bool
If
true
, theCollisionObject3D
will continue to receive input events as the mouse is dragged across its shapes.var inputEvent: Signal1
Emitted when the object receives an unhandled
InputEvent
.position
is the location in world space of the mouse pointer on the surface of the shape with indexshapeIdx
andnormal
is the normal vector of the surface at that point.var inputRayPickable: Bool
If
true
, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least onecollisionLayer
bit to be set.var mouseEntered: SimpleSignal
Emitted when the mouse pointer enters any of this object’s shapes. Requires
inputRayPickable
to betrue
and at least onecollisionLayer
bit to be set.var mouseExited: SimpleSignal
Emitted when the mouse pointer exits all this object’s shapes. Requires
inputRayPickable
to betrue
and at least onecollisionLayer
bit to be set.func createShapeOwner(Object?
) -> UInt32 Creates a new shape owner for the given object. Returns
owner_id
of the new owner for future reference.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 getRid(
) -> RID Returns the object’s
RID
.func getShapeOwners(
) -> PackedInt32Array Returns an
GArray
ofowner_id
identifiers. You can use these ids in other methods that takeowner_id
as an argument.func isShapeOwnerDisabled(ownerId: UInt32
) -> Bool If
true
, the shape owner and its shapes are disabled.func removeShapeOwner(ownerId: UInt32
) Removes the given shape owner.
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.func shapeFindOwner(shapeIndex: Int32
) -> UInt32 Returns the
owner_id
of the given shape.func shapeOwnerAddShape(ownerId: UInt32, shape: Shape3D?
) Adds a
Shape3D
to the shape owner.func shapeOwnerClearShapes(ownerId: UInt32
) Removes all shapes from the shape owner.
func shapeOwnerGetOwner(ownerId: UInt32
) -> Object? Returns the parent object of the given shape owner.
func shapeOwnerGetShape(ownerId: UInt32, shapeId: Int32
) -> Shape3D? Returns the
Shape3D
with the given ID from the given shape owner.func shapeOwnerGetShapeCount(ownerId: UInt32
) -> Int32 Returns the number of shapes the given shape owner contains.
func shapeOwnerGetShapeIndex(ownerId: UInt32, shapeId: Int32
) -> Int32 Returns the child index of the
Shape3D
with the given ID from the given shape owner.func shapeOwnerGetTransform(ownerId: UInt32
) -> Transform3D Returns the shape owner’s
Transform3D
.func shapeOwnerRemoveShape(ownerId: UInt32, shapeId: Int32
) Removes a shape from the given shape owner.
func shapeOwnerSetDisabled(ownerId: UInt32, disabled: Bool
) If
true
, disables the given shape owner.func shapeOwnerSetTransform(ownerId: UInt32, transform: Transform3D
) Sets the
Transform3D
of the given shape owner.
Show implementation details (3)
Hide implementation details
func _inputEvent(camera: Camera3D?, event: InputEvent?, position: Vector3, normal: Vector3, shapeIdx: Int32
) Receives unhandled
InputEvent
s.position
is the location in world space of the mouse pointer on the surface of the shape with indexshapeIdx
andnormal
is the normal vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up these events.func _mouseEnter(
) Called when the mouse pointer enters any of this object’s shapes. Requires
inputRayPickable
to betrue
and at least onecollisionLayer
bit to be set. Note that moving between different shapes within a singleCollisionObject3D
won’t cause this function to be called.func _mouseExit(
) Called when the mouse pointer exits all this object’s shapes. Requires
inputRayPickable
to betrue
and at least onecollisionLayer
bit to be set. Note that moving between different shapes within a singleCollisionObject3D
won’t cause this function to be called.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
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 RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.