Illutions Engine API - v0.26.0
    Preparing search index...

    Class Raycast

    The Raycast class manages pointer-based raycasting in a THREE.Scene. It tracks specified objects, detects cursor intersections with them, and triggers intersection and non-intersection events via the application state. The class dynamically enables or disables pointer listeners depending on the number of tracked objects. It also handles pointer events (click, down, up, move, enter, leave) for the intersected 3D objects.

    Index
    • Disables pointer-based raycasting and removes all pointer event listeners and the frame update callback.

      Returns void

    • Enables pointer-based raycasting and adds all necessary pointer event listeners and the frame update callback.

      Returns void

    • Removes the explicit occlusion-object restriction so that all scene objects are checked again.

      Returns void

    • Restricts occlusion raycasts to the specified scene objects. Without an explicit restriction, all scene objects are checked.

      Parameters

      • params: { objs3D: Obj3D[] }

        Parameter object.

        • objs3D: Obj3D[]

          The Obj3D instances that may block visibility.

      Returns void

    • Begins tracking a list of scene objects for pointer intersection detection. If the raycaster is not yet listening for pointer movements, this method automatically attaches pointer event listeners (pointermove, click, pointercancel, pointerdown, pointerleave, pointerup).

      Parameters

      • params: { objs3D: Obj3D[] }

        Parameter object.

        • objs3D: Obj3D[]

          The Obj3D instances to track.

      Returns void

    • Stops tracking the specified scene objects for ray intersection detection. It automatically removes the pointer event listeners if no tracked objects remain.

      Parameters

      • params: { objs3D: Obj3D[] }

        Parameter object.

        • objs3D: Obj3D[]

          The Obj3D instances to untrack.

      Returns void

    • Registers and executes a low-level extension function with access to the public Raycast API.

      Parameters

      • extension: (raycast: Raycast) => void

        Function that receives the current Raycast instance and can use its public members and methods.

      Returns void

      This method is intended for advanced custom integrations where developers need direct access to the engine instance. The extension is executed once immediately when use() is called.