IntersectRayResult
Result from intersecting a ray
PhysicsDirectSpaceState3D+IntersectRayResult.swift:25struct IntersectRayResult<T> where T : Object
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (8) members.
Type members
Instance members
func castMotion(parameters: PhysicsShapeQueryParameters3D?
) -> PackedFloat32Array Checks how far a
Shape3D
can move without colliding. All the parameters for the query, including the shape, are supplied through aPhysicsShapeQueryParameters3D
object.func collideShape(parameters: PhysicsShapeQueryParameters3D?, maxResults: Int32
) -> VariantCollection<Vector3> Checks the intersections of a shape, given through a
PhysicsShapeQueryParameters3D
object, against the space. The resulting array contains a list of points where the shape intersects another. Like withintersectShape(parameters:maxResults:)
, the number of returned results can be limited to save processing time.func getRestInfo(parameters: PhysicsShapeQueryParameters3D?
) -> GDictionary Checks the intersections of a shape, given through a
PhysicsShapeQueryParameters3D
object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields:func intersectPoint(parameters: PhysicsPointQueryParameters3D?, maxResults: Int32
) -> VariantCollection<GDictionary> Checks whether a point is inside any solid shape. Position and other parameters are defined through
PhysicsPointQueryParameters3D
. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:func intersectRay<T>(T.Type, parameters: PhysicsRayQueryParameters3D
) -> IntersectRayResult<T>? Intersects a ray in a given space. Ray position and other parameters are defined through
PhysicsRayQueryParameters3D
The return value is anIntersectRayResult<T>?
whereT
is any GodotObject
, however if the ray did not intersect anything, or the intersecting collider was not of typeT
then a nil object is returned instead. UsuallyT
is a physics object such asStaticBody
for example but it could also be aGridMap
if themesh_library
has collisions.func intersectRay(parameters: PhysicsRayQueryParameters3D?
) -> GDictionary Intersects a ray in a given space. Ray position and other parameters are defined through
PhysicsRayQueryParameters3D
. The returned object is a dictionary with the following fields:func intersectShape(parameters: PhysicsShapeQueryParameters3D?, maxResults: Int32
) -> VariantCollection<GDictionary> Checks the intersections of a shape, given through a
PhysicsShapeQueryParameters3D
object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields:
Citizens in SwiftGodot
Instance members
let collider: T
The colliding object
let colliderId: Int
The colliding object’s ID.
let faceIndex: Int
The face index at the intersection point.
let metadata: Variant?
The metadata value from the dictionary.
let normal: Vector3
The object’s surface normal at the intersection point, or
Vector3(x: 0, y: 0, z: 0)
if the ray starts inside the shape andPhysicsRayQueryParameters3D.hitFromInside
is true.let position: Vector3
The intersection point
let rid: RID
The The intersecting object’s
RID
.let shape: Int
The shape index of the colliding shape.