public synchronized void addRange ( final float range , final GVRSceneObject sceneObject ) { if ( null == sceneObject ) { throw new IllegalArgumentException ( "sceneObject must be specified!" ) ; } if ( range < 0 ) { throw new IllegalArgumentException ( "range cannot be negative" ) ; } final int size = mRanges . size ( ) ; final float rangePow2 = range * range ; final Object [ ] newElement = new Object [ ] { rangePow2 , sceneObject } ; for ( int i = 0 ; i < size ; ++ i ) { final Object [ ] el = mRanges . get ( i ) ; final Float r = ( Float ) el [ 0 ] ; if ( r > rangePow2 ) { mRanges . add ( i , newElement ) ; break ; } } if ( mRanges . size ( ) == size ) { mRanges . add ( newElement ) ; } final GVRSceneObject owner = getOwnerObject ( ) ; if ( null != owner ) { owner . addChildObject ( sceneObject ) ; } }
Add a range to this LOD group . Specify the scene object that should be displayed in this range . Add the LOG group as a component to the parent scene object . The scene objects associated with each range will automatically be added as children to the parent .