addLevel method

LOD addLevel([
  1. Object3D? object,
  2. double distance = 0
])

object - The page:Object3D to display at this level.

distance - The distance at which to display this level of detail. Default 0.0.

Adds a mesh that will display at a certain distance and greater. Typically the further away the distance, the lower the detail on the mesh.

Implementation

LOD addLevel([Object3D? object, double distance = 0]){
		this.distance = distance.abs();

		final levels = this.levels;

		int l;

		for ( l = 0; l < levels.length; l ++ ) {
			if ( distance < levels[l].distance ) {
				break;
			}
		}

		levels.insert(l, LOD(distance: distance, object: object));

		add(object);
		return this;
	}