• Cast a ray into the scene and resolve with the first hit.

    Parameters

    Returns Promise<RaycastHit | null>

    The first hit, or null if the ray hit nothing.

    Throws

    If no host handler is wired, the host returns an error, or it times out.

    Example

    import { raycast } from "@urth/metatell-sdk/input";

    const hit = await raycast({ x: 0, y: 1.6, z: 0 }, { x: 0, y: 0, z: -1 });