raycastPoints
Casts rays from two positions in the world and returns hit information.
Syntax
engine.world.raycaster.raycastPoints(from, to, options);
Parameters
Name | Type | Description |
---|---|---|
from | Vector3 or Vector3Array | The starting position of the ray in world coordinates. |
to | Vector3 or Vector3Array | The ending position of the ray in world coordinates. |
options (optional) | RaycastOptions | Additional options for the raycast. |
Returns
IntersectsResult
- The result of the raycast.
Example
const intersects = engine.world.raycaster.raycastPoints(
[5, 1, 10], // from - where to start the ray
[10, 1, 20], // to - where to end the ray
);
console.log('what did we hit?', intersects);
Available on: Client