Class LODRaycast

Use random raycasting to randomly pick n objects to be tested on screen space.

Overall the fastest solution but does not include out of screen objects.

Implements

Constructors

Properties

mouse: Vector2 = ...

Normalized mouse coordinates.

powerDistance: boolean = false

Consider the distance powered to level of the node.

raycaster: Raycaster = ...

Raycaster object used to cast rays into the world and check for hits.

scaleDistance: boolean = true

Consider the scale of the node when calculating the distance.

If distance is not considered threshold values should be absolute distances.

subdivisionRays: number = 1

Number of rays used to test nodes and subdivide the map.

N rays are cast each frame dependeing on this value to check distance to the visible map nodes. A single ray should be enough for must scenarios.

thresholdDown: number = 0.15

Threshold to simplify the map tiles.

Higher value will simplify earlier.

thresholdUp: number = 0.6

Threshold to subdivide the map tiles.

Lower value will subdivide earlier (less zoom required to subdivide).

Methods

  • Update LOD of the MapView and Camera position on the world.

    Parameters

    • view: MapView

      Map view for wich the LOD will be updated.

    • camera: Camera

      Camera used to view the scene.

    • renderer: WebGLRenderer

      Renderer object.

    • scene: Object3D<Object3DEventMap>

      Scene that compose the mapview.

    Returns void