Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
PhysicsIntersectRayResult3D
Inherits: RefCounted < Object
Stores the result of a ray intersection query.
Description
This object contains the intersection information produced by PhysicsDirectSpaceState3D.intersect_ray_into().
After calling PhysicsDirectSpaceState3D.intersect_ray_into(), the fields of this object will be populated with the hit information if the ray intersects a shape. If no intersection occurred, the values remain unchanged from the previous state.
Note: For optimal performance results, it is recommended to create this object in advance, store it, and reuse it for every subsequent query.
Properties
|
||
|
||
|
||
|
||
|
||
|
Property Descriptions
Object get_collider()
The colliding object.
int collider_face_index = -1 🔗
int get_collider_face_index()
The face index at the intersection point.
Note: Returns a valid number only if the intersected shape is a ConcavePolygonShape3D. Otherwise, -1 is returned.
int get_collider_id()
The colliding object's ID.
RID get_collider_rid()
The intersecting object's RID.
int get_collider_shape()
The shape index of the colliding shape.
Vector3 normal = Vector3(0, 0, 0) 🔗
Vector3 get_normal()
The object's surface normal at the intersection point, or Vector3(0, 0, 0) if the ray starts inside the shape and PhysicsRayQueryParameters3D.hit_from_inside is true.
Vector3 position = Vector3(0, 0, 0) 🔗
Vector3 get_position()
The intersection point.