Instance Propertymigueldeicaza.swiftgodot 0.45.0SwiftGodot
maxResults
The number of intersections can be limited with this parameter, to reduce the processing time.
ShapeCast3D.swift:82final var maxResults: Int32 { get set }
Other members in extension
Type members
Instance members
var collideWithAreas: Bool
If
true
, collisions withArea3D
s will be reported.var collideWithBodies: Bool
If
true
, collisions withPhysicsBody3D
s will be reported.var collisionMask: UInt32
The shape’s collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See Collision layers and masks in the documentation for more information.
var debugShapeCustomColor: Color
The custom color to use to draw the shape in the editor and at run-time if Visible Collision Shapes is enabled in the Debug menu. This color will be highlighted at run-time if the
ShapeCast3D
is colliding with something.var enabled: Bool
If
true
, collisions will be reported.var excludeParent: Bool
If
true
, the parent node will be excluded from collision detection.var margin: Double
The collision margin for the shape. A larger margin helps detecting collisions more consistently, at the cost of precision.
var shape: Shape3D?
The
Shape3D
-derived shape to be used for collision queries.var targetPosition: Vector3
The shape’s destination point, relative to this node’s
position
.func addException(node: CollisionObject3D?
) Adds a collision exception so the shape does not report collisions with the specified
CollisionObject3D
node.func addExceptionRid(RID
) Adds a collision exception so the shape does not report collisions with the specified
RID
.func clearExceptions(
) Removes all collision exceptions for this
ShapeCast3D
.func forceShapecastUpdate(
) Updates the collision information for the shape immediately, without waiting for the next
_physics_process
call. Use this method, for example, when the shape or its parent has changed state.func getClosestCollisionSafeFraction(
) -> Double The fraction from the
ShapeCast3D
’s origin to itstargetPosition
(between 0 and 1) of how far the shape can move without triggering a collision.func getClosestCollisionUnsafeFraction(
) -> Double The fraction from the
ShapeCast3D
’s origin to itstargetPosition
(between 0 and 1) of how far the shape must move to trigger a collision.func getCollider(index: Int32
) -> Object? Returns the collided
Object
of one of the multiple collisions atindex
, ornull
if no object is intersecting the shape (i.e.isColliding
returnsfalse
).func getColliderRid(index: Int32
) -> RID Returns the
RID
of the collided object of one of the multiple collisions atindex
.func getColliderShape(index: Int32
) -> Int32 Returns the shape ID of the colliding shape of one of the multiple collisions at
index
, or0
if no object is intersecting the shape (i.e.isColliding
returnsfalse
).func getCollisionCount(
) -> Int32 The number of collisions detected at the point of impact. Use this to iterate over multiple collisions as provided by
getCollider(index:)
,getColliderShape(index:)
,getCollisionPoint(index:)
, andgetCollisionNormal(index:)
methods.func getCollisionMaskValue(layerNumber: Int32
) -> Bool Returns whether or not the specified layer of the
collisionMask
is enabled, given alayerNumber
between 1 and 32.func getCollisionNormal(index: Int32
) -> Vector3 Returns the normal of one of the multiple collisions at
index
of the intersecting object.func getCollisionPoint(index: Int32
) -> Vector3 Returns the collision point of one of the multiple collisions at
index
where the shape intersects the colliding object.func isColliding(
) -> Bool Returns whether any object is intersecting with the shape’s vector (considering the vector length).
func removeException(node: CollisionObject3D?
) Removes a collision exception so the shape does report collisions with the specified
CollisionObject3D
node.func removeExceptionRid(RID
) Removes a collision exception so the shape does report collisions with the specified
RID
.func resourceChanged(resource: Resource?
) Obsoleted. Use [signal Resource.changed] instead.
func setCollisionMaskValue(layerNumber: Int32, value: Bool
) Based on
value
, enables or disables the specified layer in thecollisionMask
, given alayerNumber
between 1 and 32.