getObjectForDistance method

Object3D? getObjectForDistance(
  1. double distance
)

Get a reference to the first page:Object3D (mesh) that is greater that distance.

Implementation

Object3D? getObjectForDistance(double distance){
		final levels = this.levels;

		if ( levels.isNotEmpty) {
    int i = 1;
    int l = levels.length;
			for (i = 1; i < l; i ++) {
				if (distance < levels[ i ].distance ) {
					break;
				}
			}
			return levels[i - 1].object;
		}

		return null;
	}