Client Scripting API - RaySceneQuery
From Multiverse
RaySceneQuery is a class in the Client Scripting API that enables you to construct a ray-based scene query that will determine which objects in the scene are intersected by the ray.
Constructor
RaySceneQuery(origin, direction)
Creates a new RaySceneQuery object.
Returns
A new RaySceneQuery object.
Parameters
| Parameter | Datatype | Default Value | Description |
|---|---|---|---|
| origin | Vector3
| None | Origin of the ray for the query. |
| direction | Vector3
| None | Direction of the ray for the query. |
Methods
Execute
Execute()
Executes the ray query, casting the ray through the scene and building a list containing each WorldObject whose bounding box is intersected by the ray and each WorldFragment (a chunk of terrain) that is intersected by the ray.
Returns
A list containing an entry for each WorldObject whose bounding box is intersected by the ray and each WorldFragment (a chunk of terrain) that is intersected by the ray. The order of objects in this list matches the order that they are intersected.
Each entry is a RaySceneQueryResult.
Parameters
None
