Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class Raycaster

    Casts rays into the scene to pick or select objects.

    Index
    ray: Ray = ...

    The internal mathematical ray used for casting.

    • Tests the ray against a list of objects. Uses a fast broad-phase bounds test (AABB or sphere, whichever the object's bounds are) and, if the object has real triangle geometry, refines that into an exact Möller-Trumbore hit -- otherwise the broad-phase distance is used directly (e.g. for sprite-like objects picked purely by their bounding volume).

      Parameters

      • objects: Object3D[]

        The objects to test against.

      • sort: boolean = true

        If true, the results are sorted by distance (closest first).

      Returns Intersection[]

      An array of intersections.