idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
25,000 | private void showSettingsMenu ( final Cursor cursor ) { Log . d ( TAG , "showSettingsMenu" ) ; enableSettingsCursor ( cursor ) ; context . runOnGlThread ( new Runnable ( ) { public void run ( ) { new SettingsView ( context , scene , CursorManager . this , settingsCursor . getIoDevice ( ) . getCursorControllerId ( ) , c... | Presents the Cursor Settings to the User . Only works if scene is set . |
25,001 | private void updateCursorsInScene ( GVRScene scene , boolean add ) { synchronized ( mCursors ) { for ( Cursor cursor : mCursors ) { if ( cursor . isActive ( ) ) { if ( add ) { addCursorToScene ( cursor ) ; } else { removeCursorFromScene ( cursor ) ; } } } } } | Add or remove the active cursors from the provided scene . |
25,002 | public List < Widget > getAllViews ( ) { List < Widget > views = new ArrayList < > ( ) ; for ( Widget child : mContent . getChildren ( ) ) { Widget item = ( ( ListItemHostWidget ) child ) . getGuest ( ) ; if ( item != null ) { views . add ( item ) ; } } return views ; } | Get all views from the list content |
25,003 | public boolean clearSelection ( boolean requestLayout ) { Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "clearSelection [%d]" , mSelectedItemsList . size ( ) ) ; boolean updateLayout = false ; List < ListItemHostWidget > views = getAllHosts ( ) ; for ( ListItemHostWidget host : views ) { if ( host . isSelected ( ) ) { hos... | Clear the selection of all items . |
25,004 | public boolean updateSelectedItemsList ( int dataIndex , boolean select ) { boolean done = false ; boolean contains = isSelected ( dataIndex ) ; if ( select ) { if ( ! contains ) { if ( ! mMultiSelectionSupported ) { clearSelection ( false ) ; } Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "updateSelectedItemsList add in... | Update the selection state of the item |
25,005 | private void onScrollImpl ( final Vector3Axis offset , final LayoutScroller . OnScrollListener listener ) { if ( ! isScrolling ( ) ) { mScroller = new ScrollingProcessor ( offset , listener ) ; mScroller . scroll ( ) ; } } | This method is called if the data set has been scrolled . |
25,006 | protected void recycleChildren ( ) { for ( ListItemHostWidget host : getAllHosts ( ) ) { recycle ( host ) ; } mContent . onTransformChanged ( ) ; mContent . requestLayout ( ) ; } | Recycle all views in the list . The host views might be reused for other data to save resources on creating new widgets . |
25,007 | private void onChangedImpl ( final int preferableCenterPosition ) { for ( ListOnChangedListener listener : mOnChangedListeners ) { listener . onChangedStart ( this ) ; } Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "onChangedImpl(%s): items [%d] views [%d] mLayouts.size() = %d " + "preferableCenterPosition = %d" , getNam... | This method is called if the data set has been changed . Subclasses might want to override this method to add some extra logic . |
25,008 | static Shell createTerminalConsoleShell ( String prompt , String appName , ShellCommandHandler mainHandler , InputStream input , OutputStream output ) { try { PrintStream out = new PrintStream ( output ) ; jline . Terminal term = TerminalFactory . get ( ) ; final ConsoleReader console = new ConsoleReader ( input , outp... | Facade method for operating the Unix - like terminal supporting line editing and command history . |
25,009 | static Shell createTelnetConsoleShell ( String prompt , String appName , ShellCommandHandler mainHandler , InputStream input , OutputStream output ) { try { final nvt4j . impl . Terminal nvt4jTerminal = new nvt4j . impl . Terminal ( input , output ) { private boolean cleared ; private boolean moved ; public void clear ... | Facade method for operating the Telnet Shell supporting line editing and command history over a socket . |
25,010 | protected void AddLODSceneObject ( GVRSceneObject currentSceneObject ) { if ( this . transformLODSceneObject != null ) { GVRSceneObject levelOfDetailSceneObject = null ; if ( currentSceneObject . getParent ( ) == this . transformLODSceneObject ) { levelOfDetailSceneObject = currentSceneObject ; } else { GVRSceneObject ... | Add the currentSceneObject to an active Level - of - Detail |
25,011 | public boolean applyLayout ( Layout itemLayout ) { boolean applied = false ; if ( itemLayout != null && mItemLayouts . add ( itemLayout ) ) { List < Widget > views = getAllViews ( ) ; for ( Widget view : views ) { view . applyLayout ( itemLayout . clone ( ) ) ; } applied = true ; } return applied ; } | Apply the layout to the each page in the list |
25,012 | public LayoutScroller . ScrollableList getPageScrollable ( ) { return new LayoutScroller . ScrollableList ( ) { public int getScrollingItemsCount ( ) { return MultiPageWidget . super . getScrollingItemsCount ( ) ; } public float getViewPortWidth ( ) { return MultiPageWidget . super . getViewPortWidth ( ) ; } public flo... | Provides the scrollableList implementation for page scrolling |
25,013 | public void startAnimation ( ) { Date time = new Date ( ) ; this . beginAnimation = time . getTime ( ) ; this . endAnimation = beginAnimation + ( long ) ( animationTime * 1000 ) ; this . animate = true ; } | once animation is setup start the animation record the beginning and ending time for the animation |
25,014 | public void updateAnimation ( ) { Date time = new Date ( ) ; long currentTime = time . getTime ( ) - this . beginAnimation ; if ( currentTime > animationTime ) { this . currentQuaternion . set ( endQuaternion ) ; for ( int i = 0 ; i < 3 ; i ++ ) { this . currentPos [ i ] = this . endPos [ i ] ; } this . animate = false... | called per frame of animation to update the camera position |
25,015 | public int [ ] getDefalutValuesArray ( ) { int [ ] defaultValues = new int [ 5 ] ; defaultValues [ 0 ] = GLES20 . GL_LINEAR_MIPMAP_NEAREST ; defaultValues [ 1 ] = GLES20 . GL_LINEAR ; defaultValues [ 2 ] = 1 ; defaultValues [ 3 ] = GLES20 . GL_CLAMP_TO_EDGE ; defaultValues [ 4 ] = GLES20 . GL_CLAMP_TO_EDGE ; return def... | Returns an integer array that contains the default values for all the texture parameters . |
25,016 | public int [ ] getCurrentValuesArray ( ) { int [ ] currentValues = new int [ 5 ] ; currentValues [ 0 ] = getMinFilterType ( ) . getFilterValue ( ) ; currentValues [ 1 ] = getMagFilterType ( ) . getFilterValue ( ) ; currentValues [ 2 ] = getAnisotropicValue ( ) ; currentValues [ 3 ] = getWrapSType ( ) . getWrapValue ( )... | Returns an integer array that contains the current values for all the texture parameters . |
25,017 | public boolean hasProperties ( Set < PropertyKey > keys ) { for ( PropertyKey key : keys ) { if ( null == getProperty ( key . m_key ) ) { return false ; } } return true ; } | Checks whether the given set of properties is available . |
25,018 | public Integer getTextureMagFilter ( AiTextureType type , int index ) { checkTexRange ( type , index ) ; Property p = getProperty ( PropertyKey . TEX_MAG_FILTER . m_key ) ; if ( null == p || null == p . getData ( ) ) { return ( Integer ) m_defaults . get ( PropertyKey . TEX_MAG_FILTER ) ; } Object rawValue = p . getDat... | Returns the texture magnification filter |
25,019 | public float getMetallic ( ) { Property p = getProperty ( PropertyKey . METALLIC . m_key ) ; if ( null == p || null == p . getData ( ) ) { throw new IllegalArgumentException ( "Metallic property not found" ) ; } Object rawValue = p . getData ( ) ; if ( rawValue instanceof java . nio . ByteBuffer ) { java . nio . FloatB... | Returns the metallic factor for PBR shading |
25,020 | public AiTextureInfo getTextureInfo ( AiTextureType type , int index ) { return new AiTextureInfo ( type , index , getTextureFile ( type , index ) , getTextureUVIndex ( type , index ) , getBlendFactor ( type , index ) , getTextureOp ( type , index ) , getTextureMapModeW ( type , index ) , getTextureMapModeW ( type , in... | Returns all information related to a single texture . |
25,021 | private void checkTexRange ( AiTextureType type , int index ) { if ( index < 0 || index > m_numTextures . get ( type ) ) { throw new IndexOutOfBoundsException ( "Index: " + index + ", Size: " + m_numTextures . get ( type ) ) ; } } | Checks that index is valid an throw an exception if not . |
25,022 | @ SuppressWarnings ( "unused" ) private void setTextureNumber ( int type , int number ) { m_numTextures . put ( AiTextureType . fromRawValue ( type ) , number ) ; } | This method is used by JNI do not call or modify . |
25,023 | public void setFrustum ( float [ ] frustum ) { Matrix4f projMatrix = new Matrix4f ( ) ; projMatrix . setFrustum ( frustum [ 0 ] , frustum [ 3 ] , frustum [ 1 ] , frustum [ 4 ] , frustum [ 2 ] , frustum [ 5 ] ) ; setFrustum ( projMatrix ) ; } | Set the view frustum to pick against from the minimum and maximum corners . The viewpoint of the frustum is the center of the scene object the picker is attached to . The view direction is the forward direction of that scene object . The frustum will pick what a camera attached to the scene object with that view frustu... |
25,024 | public void setFrustum ( float fovy , float aspect , float znear , float zfar ) { Matrix4f projMatrix = new Matrix4f ( ) ; projMatrix . perspective ( ( float ) Math . toRadians ( fovy ) , aspect , znear , zfar ) ; setFrustum ( projMatrix ) ; } | Set the view frustum to pick against from the field of view aspect ratio and near far clip planes . The viewpoint of the frustum is the center of the scene object the picker is attached to . The view direction is the forward direction of that scene object . The frustum will pick what a camera attached to the scene obje... |
25,025 | public void setFrustum ( Matrix4f projMatrix ) { if ( projMatrix != null ) { if ( mProjMatrix == null ) { mProjMatrix = new float [ 16 ] ; } mProjMatrix = projMatrix . get ( mProjMatrix , 0 ) ; mScene . setPickVisible ( false ) ; if ( mCuller != null ) { mCuller . set ( projMatrix ) ; } else { mCuller = new FrustumInte... | Set the view frustum to pick against from the given projection matrix . |
25,026 | public static final GVRPickedObject [ ] pickVisible ( GVRScene scene ) { sFindObjectsLock . lock ( ) ; try { final GVRPickedObject [ ] result = NativePicker . pickVisible ( scene . getNative ( ) ) ; return result ; } finally { sFindObjectsLock . unlock ( ) ; } } | Returns the list of colliders attached to scene objects that are visible from the viewpoint of the camera . |
25,027 | public void setShortVec ( char [ ] data ) { if ( data == null ) { throw new IllegalArgumentException ( "Input data for indices cannot be null" ) ; } if ( getIndexSize ( ) != 2 ) { throw new UnsupportedOperationException ( "Cannot update integer indices with char array" ) ; } if ( ! NativeIndexBuffer . setShortArray ( g... | Updates the indices in the index buffer from a Java char array . All of the entries of the input char array are copied into the storage for the index buffer . The new indices must be the same size as the old indices - the index buffer size cannot be changed . |
25,028 | public void setShortVec ( CharBuffer data ) { if ( data == null ) { throw new IllegalArgumentException ( "Input data for indices cannot be null" ) ; } if ( getIndexSize ( ) != 2 ) { throw new UnsupportedOperationException ( "Cannot update integer indices with char array" ) ; } if ( data . isDirect ( ) ) { if ( ! Native... | Updates the indices in the index buffer from a Java CharBuffer . All of the entries of the input buffer are copied into the storage for the index buffer . The new indices must be the same size as the old indices - the index buffer size cannot be changed . |
25,029 | public void setIntVec ( int [ ] data ) { if ( data == null ) { throw new IllegalArgumentException ( "Input data for indices cannot be null" ) ; } if ( getIndexSize ( ) != 4 ) { throw new UnsupportedOperationException ( "Cannot update short indices with int array" ) ; } if ( ! NativeIndexBuffer . setIntArray ( getNative... | Updates the indices in the index buffer from a Java int array . All of the entries of the input int array are copied into the storage for the index buffer . The new indices must be the same size as the old indices - the index buffer size cannot be changed . |
25,030 | public void setIntVec ( IntBuffer data ) { if ( data == null ) { throw new IllegalArgumentException ( "Input buffer for indices cannot be null" ) ; } if ( getIndexSize ( ) != 4 ) { throw new UnsupportedOperationException ( "Cannot update integer indices with short array" ) ; } if ( data . isDirect ( ) ) { if ( ! Native... | Updates the indices in the index buffer from a Java IntBuffer . All of the entries of the input int buffer are copied into the storage for the index buffer . The new indices must be the same size as the old indices - the index buffer size cannot be changed . |
25,031 | protected void emitWithBurstCheck ( float [ ] particlePositions , float [ ] particleVelocities , float [ ] particleTimeStamps ) { if ( burstMode ) { if ( executeOnce ) { emit ( particlePositions , particleVelocities , particleTimeStamps ) ; executeOnce = false ; } } else { emit ( particlePositions , particleVelocities ... | If the burst mode is on emit the particles only once . |
25,032 | private void emit ( float [ ] particlePositions , float [ ] particleVelocities , float [ ] particleTimeStamps ) { float [ ] allParticlePositions = new float [ particlePositions . length + particleBoundingVolume . length ] ; System . arraycopy ( particlePositions , 0 , allParticlePositions , 0 , particlePositions . leng... | Append the bounding volume particle positions times and velocities to the existing mesh before creating a new scene object with this mesh attached to it . Also append every created scene object and its creation time to corresponding array lists . |
25,033 | public void setVelocityRange ( final Vector3f minV , final Vector3f maxV ) { if ( null != mGVRContext ) { mGVRContext . runOnGlThread ( new Runnable ( ) { public void run ( ) { minVelocity = minV ; maxVelocity = maxV ; } } ) ; } } | The range of velocities that a particle generated from this emitter can have . |
25,034 | public static void logLong ( String TAG , String longString ) { InputStream is = new ByteArrayInputStream ( longString . getBytes ( ) ) ; @ SuppressWarnings ( "resource" ) Scanner scan = new Scanner ( is ) ; while ( scan . hasNextLine ( ) ) { Log . v ( TAG , scan . nextLine ( ) ) ; } } | Log long string using verbose tag |
25,035 | public static String readTextFile ( Context context , String asset ) { try { InputStream inputStream = context . getAssets ( ) . open ( asset ) ; return org . gearvrf . utility . TextFile . readTextFile ( inputStream ) ; } catch ( FileNotFoundException f ) { Log . w ( TAG , "readTextFile(): asset file '%s' doesn't exis... | Read a text file from assets into a single string |
25,036 | public static boolean equal ( Vector3f v1 , Vector3f v2 ) { return equal ( v1 . x , v2 . x ) && equal ( v1 . y , v2 . y ) && equal ( v1 . z , v2 . z ) ; } | Are these two numbers effectively equal? |
25,037 | public static int getId ( Context context , String id ) { final String defType ; if ( id . startsWith ( "R." ) ) { int dot = id . indexOf ( '.' , 2 ) ; defType = id . substring ( 2 , dot ) ; } else { defType = "drawable" ; } Log . d ( TAG , "getId(): id: %s, extracted type: %s" , id , defType ) ; return getId ( context... | Parses the resource String id and get back the int res id |
25,038 | public static int getId ( Context context , String id , String defType ) { String type = "R." + defType + "." ; if ( id . startsWith ( type ) ) { id = id . substring ( type . length ( ) ) ; } Resources r = context . getResources ( ) ; int resId = r . getIdentifier ( id , defType , context . getPackageName ( ) ) ; if ( ... | Get the int resource id with specified type definition |
25,039 | public String generateSignature ( HashMap < String , Integer > defined , GVRLight [ ] lightlist ) { return getClass ( ) . getSimpleName ( ) ; } | Create a unique signature for this shader . The signature for simple shaders is just the class name . For the more complex shaders generated by GVRShaderTemplate the signature includes information about the vertex attributes uniforms textures and lights used by the shader variant . |
25,040 | public int bindShader ( GVRContext context , IRenderable rdata , GVRScene scene , boolean isMultiview ) { String signature = getClass ( ) . getSimpleName ( ) ; GVRShaderManager shaderManager = context . getShaderManager ( ) ; GVRMaterial mtl = rdata . getMaterial ( ) ; synchronized ( shaderManager ) { int nativeShader ... | Select the specific vertex and fragment shader to use . |
25,041 | public int bindShader ( GVRContext context , GVRShaderData material , String vertexDesc ) { String signature = getClass ( ) . getSimpleName ( ) ; GVRShaderManager shaderManager = context . getShaderManager ( ) ; synchronized ( shaderManager ) { int nativeShader = shaderManager . getShader ( signature ) ; if ( nativeSha... | Select the specific vertex and fragment shader to use with this material . |
25,042 | public GVRSceneObject startDrag ( GVRSceneObject dragMe , float relX , float relY , float relZ ) { synchronized ( mLock ) { if ( mCursorController == null ) { Log . w ( TAG , "Physics drag failed: Cursor controller not found!" ) ; return null ; } if ( mDragMe != null ) { Log . w ( TAG , "Physics drag failed: Previous d... | Start the drag of the pivot object . |
25,043 | public void setTexCoord ( String texName , String texCoordAttr , String shaderVarName ) { synchronized ( textures ) { GVRTexture tex = textures . get ( texName ) ; if ( tex != null ) { tex . setTexCoord ( texCoordAttr , shaderVarName ) ; } else { throw new UnsupportedOperationException ( "Texture must be set before upd... | Designate the vertex attribute and shader variable for the texture coordinates associated with the named texture . |
25,044 | public String getTexCoordAttr ( String texName ) { GVRTexture tex = textures . get ( texName ) ; if ( tex != null ) { return tex . getTexCoordAttr ( ) ; } return null ; } | Gets the name of the vertex attribute containing the texture coordinates for the named texture . |
25,045 | public String getTexCoordShaderVar ( String texName ) { GVRTexture tex = textures . get ( texName ) ; if ( tex != null ) { return tex . getTexCoordShaderVar ( ) ; } return null ; } | Gets the name of the shader variable to get the texture coordinates for the named texture . |
25,046 | public String getProperty ( String key , String defaultValue ) { return mProperties . getProperty ( key , defaultValue ) ; } | Gets a property with a default value . |
25,047 | public synchronized void hide ( ) { if ( focusedQuad != null ) { mDefocusAnimationFactory . create ( focusedQuad ) . setRequestLayoutOnTargetChange ( false ) . start ( ) . finish ( ) ; focusedQuad = null ; } Log . d ( Log . SUBSYSTEM . WIDGET , TAG , "hide Picker!" ) ; } | It should be called when the picker is hidden |
25,048 | public void set1Value ( int index , String newValue ) { try { value . set ( index , newValue ) ; } catch ( IndexOutOfBoundsException e ) { Log . e ( TAG , "X3D MFString set1Value(int index, ...) out of bounds." + e ) ; } catch ( Exception e ) { Log . e ( TAG , "X3D MFString set1Value(int index, ...) exception " + e ) ... | Replace a single value at the appropriate location in the existing value array . |
25,049 | public void setValue ( int numStrings , String [ ] newValues ) { value . clear ( ) ; if ( numStrings == newValues . length ) { for ( int i = 0 ; i < newValues . length ; i ++ ) { value . add ( newValues [ i ] ) ; } } else { Log . e ( TAG , "X3D MFString setValue() numStrings not equal total newValues" ) ; } } | Assign a new value to this field . |
25,050 | public void update ( int width , int height , byte [ ] grayscaleData ) { NativeBitmapImage . updateFromMemory ( getNative ( ) , width , height , grayscaleData ) ; } | Copy new grayscale data to the GPU texture . This one is also safe even in a non - GL thread . An updateGPU request on a non - GL thread will be forwarded to the GL thread and be executed before main rendering happens . |
25,051 | public static void start ( final GVRContext context , final String appId , final ResultListener listener ) { if ( null == listener ) { throw new IllegalArgumentException ( "listener cannot be null" ) ; } final Activity activity = context . getActivity ( ) ; final long result = create ( activity , appId ) ; if ( 0 != re... | Starts asynchronous check . Result will be delivered to the listener on the main thread . |
25,052 | public synchronized void tick ( ) { long currentTime = GVRTime . getMilliTime ( ) ; long cutoffTime = currentTime - BUFFER_SECONDS * 1000 ; ListIterator < Long > it = mTimestamps . listIterator ( ) ; while ( it . hasNext ( ) ) { Long timestamp = it . next ( ) ; if ( timestamp < cutoffTime ) { it . remove ( ) ; } else {... | Should be called each frame . |
25,053 | public void addControllerType ( GVRControllerType controllerType ) { if ( cursorControllerTypes == null ) { cursorControllerTypes = new ArrayList < GVRControllerType > ( ) ; } else if ( cursorControllerTypes . contains ( controllerType ) ) { return ; } cursorControllerTypes . add ( controllerType ) ; } | Enable the use of the given controller type by adding it to the cursor controller types list . |
25,054 | public static void checkStringNotNullOrEmpty ( String parameterName , String value ) { if ( TextUtils . isEmpty ( value ) ) { throw Exceptions . IllegalArgument ( "Current input string %s is %s." , parameterName , value == null ? "null" : "empty" ) ; } } | Check that the parameter string is not null or empty |
25,055 | public static void checkArrayLength ( String parameterName , int actualLength , int expectedLength ) { if ( actualLength != expectedLength ) { throw Exceptions . IllegalArgument ( "Array %s should have %d elements, not %d" , parameterName , expectedLength , actualLength ) ; } } | Check that the parameter array has exactly the right number of elements . |
25,056 | public static void checkMinimumArrayLength ( String parameterName , int actualLength , int minimumLength ) { if ( actualLength < minimumLength ) { throw Exceptions . IllegalArgument ( "Array %s should have at least %d elements, but it only has %d" , parameterName , minimumLength , actualLength ) ; } } | Check that the parameter array has at least as many elements as it should . |
25,057 | public static void checkFloatNotNaNOrInfinity ( String parameterName , float data ) { if ( Float . isNaN ( data ) || Float . isInfinite ( data ) ) { throw Exceptions . IllegalArgument ( "%s should never be NaN or Infinite." , parameterName ) ; } } | In common shader cases NaN makes little sense . Correspondingly GVRF is going to use Float . NaN as illegal flag in many cases . Therefore we need a function to check if there is any setX that is using NaN as input . |
25,058 | public void transformPose ( Matrix4f trans ) { Bone bone = mBones [ 0 ] ; bone . LocalMatrix . set ( trans ) ; bone . WorldMatrix . set ( trans ) ; bone . Changed = WORLD_POS | WORLD_ROT ; mNeedSync = true ; sync ( ) ; } | Transform the root bone of the pose by the given matrix . |
25,059 | public void inverse ( GVRPose src ) { if ( getSkeleton ( ) != src . getSkeleton ( ) ) throw new IllegalArgumentException ( "GVRPose.copy: input pose is incompatible with this pose" ) ; src . sync ( ) ; int numbones = getNumBones ( ) ; Bone srcBone = src . mBones [ 0 ] ; Bone dstBone = mBones [ 0 ] ; mNeedSync = true ; ... | Makes this pose the inverse of the input pose . |
25,060 | protected void calcWorld ( Bone bone , int parentId ) { getWorldMatrix ( parentId , mTempMtxB ) ; mTempMtxB . mul ( bone . LocalMatrix ) ; bone . WorldMatrix . set ( mTempMtxB ) ; } | Calculates the world matrix based on the local matrix . |
25,061 | protected void calcLocal ( Bone bone , int parentId ) { if ( parentId < 0 ) { bone . LocalMatrix . set ( bone . WorldMatrix ) ; return ; } getWorldMatrix ( parentId , mTempMtxA ) ; mTempMtxA . invert ( ) ; mTempMtxA . mul ( bone . WorldMatrix , bone . LocalMatrix ) ; } | Calculates the local translation and rotation for a bone . Assumes WorldRot and WorldPos have been calculated for the bone . |
25,062 | public void setVec3 ( String key , float x , float y , float z ) { checkKeyIsUniform ( key ) ; NativeLight . setVec3 ( getNative ( ) , key , x , y , z ) ; } | Set the value for a floating point vector of length 3 . |
25,063 | public void setVec4 ( String key , float x , float y , float z , float w ) { checkKeyIsUniform ( key ) ; NativeLight . setVec4 ( getNative ( ) , key , x , y , z , w ) ; } | Set the value for a floating point vector of length 4 . |
25,064 | public void setMat4 ( String key , float x1 , float y1 , float z1 , float w1 , float x2 , float y2 , float z2 , float w2 , float x3 , float y3 , float z3 , float w3 , float x4 , float y4 , float z4 , float w4 ) { checkKeyIsUniform ( key ) ; NativeLight . setMat4 ( getNative ( ) , key , x1 , y1 , z1 , w1 , x2 , y2 , z2 ... | Set the value for a floating point 4x4 matrix . |
25,065 | public void onDrawFrame ( float frameTime ) { if ( ! isEnabled ( ) || ( owner == null ) || ( getFloat ( "enabled" ) <= 0.0f ) ) { return ; } float [ ] odir = getVec3 ( "world_direction" ) ; float [ ] opos = getVec3 ( "world_position" ) ; GVRSceneObject parent = owner ; Matrix4f worldmtx = parent . getTransform ( ) . ge... | Updates the position and direction of this light from the transform of scene object that owns it . |
25,066 | public void setProjectionMatrix ( float x1 , float y1 , float z1 , float w1 , float x2 , float y2 , float z2 , float w2 , float x3 , float y3 , float z3 , float w3 , float x4 , float y4 , float z4 , float w4 ) { NativeCustomCamera . setProjectionMatrix ( getNative ( ) , x1 , y1 , z1 , w1 , x2 , y2 , z2 , w2 , x3 , y3 ,... | Set the custom projection matrix with individual matrix elements . |
25,067 | private void loadCadidateString ( ) { volumeUp = mGvrContext . getActivity ( ) . getResources ( ) . getString ( R . string . volume_up ) ; volumeDown = mGvrContext . getActivity ( ) . getResources ( ) . getString ( R . string . volume_down ) ; zoomIn = mGvrContext . getActivity ( ) . getResources ( ) . getString ( R . ... | Load all string recognize . |
25,068 | public void findMatch ( ArrayList < String > speechResult ) { loadCadidateString ( ) ; for ( String matchCandidate : speechResult ) { Locale localeDefault = mGvrContext . getActivity ( ) . getResources ( ) . getConfiguration ( ) . locale ; if ( volumeUp . equals ( matchCandidate ) ) { startVolumeUp ( ) ; break ; } else... | get the result speech recognize and find match in strings file . |
25,069 | private void enableTalkBack ( ) { GVRSceneObject [ ] sceneObjects = mGvrContext . getMainScene ( ) . getWholeSceneObjects ( ) ; for ( GVRSceneObject sceneObject : sceneObjects ) { if ( sceneObject instanceof GVRAccessiblityObject ) if ( ( ( GVRAccessiblityObject ) sceneObject ) . getTalkBack ( ) != null ) ( ( GVRAccess... | find all accessibility object and set active true for enable talk back . |
25,070 | private void disableTalkBack ( ) { GVRSceneObject [ ] sceneObjects = mGvrContext . getMainScene ( ) . getWholeSceneObjects ( ) ; for ( GVRSceneObject sceneObject : sceneObjects ) { if ( sceneObject instanceof GVRAccessiblityObject ) if ( ( ( GVRAccessiblityObject ) sceneObject ) . getTalkBack ( ) != null ) ( ( GVRAcces... | find all accessibility object and set active false for enable talk back . |
25,071 | private void startInvertedColors ( ) { if ( managerFeatures . getInvertedColors ( ) . isInverted ( ) ) { managerFeatures . getInvertedColors ( ) . turnOff ( mGvrContext . getMainScene ( ) ) ; } else { managerFeatures . getInvertedColors ( ) . turnOn ( mGvrContext . getMainScene ( ) ) ; } } | Active inverter colors |
25,072 | public static void dumpTexCoords ( AiMesh mesh , int coords ) { if ( ! mesh . hasTexCoords ( coords ) ) { System . out . println ( "mesh has no texture coordinate set " + coords ) ; return ; } for ( int i = 0 ; i < mesh . getNumVertices ( ) ; i ++ ) { int numComponents = mesh . getNumUVComponents ( coords ) ; System . ... | Dumps a texture coordinate set of a mesh to stdout . |
25,073 | public static void dumpMaterialProperty ( AiMaterial . Property property ) { System . out . print ( property . getKey ( ) + " " + property . getSemantic ( ) + " " + property . getIndex ( ) + ": " ) ; Object data = property . getData ( ) ; if ( data instanceof ByteBuffer ) { ByteBuffer buf = ( ByteBuffer ) data ; for ( ... | Dumps a single material property to stdout . |
25,074 | public static void dumpMaterial ( AiMaterial material ) { for ( AiMaterial . Property prop : material . getProperties ( ) ) { dumpMaterialProperty ( prop ) ; } } | Dumps all properties of a material to stdout . |
25,075 | public static void dumpNodeAnim ( AiNodeAnim nodeAnim ) { for ( int i = 0 ; i < nodeAnim . getNumPosKeys ( ) ; i ++ ) { System . out . println ( i + ": " + nodeAnim . getPosKeyTime ( i ) + " ticks, " + nodeAnim . getPosKeyVector ( i , Jassimp . BUILTIN ) ) ; } } | Dumps an animation channel to stdout . |
25,076 | public static String joinStrings ( List < String > strings , boolean fixCase , char withChar ) { if ( strings == null || strings . size ( ) == 0 ) { return "" ; } StringBuilder result = null ; for ( String s : strings ) { if ( fixCase ) { s = fixCase ( s ) ; } if ( result == null ) { result = new StringBuilder ( s ) ; ... | Generic string joining function . |
25,077 | public int addCollidable ( GVRSceneObject sceneObj ) { synchronized ( mCollidables ) { int index = mCollidables . indexOf ( sceneObj ) ; if ( index >= 0 ) { return index ; } mCollidables . add ( sceneObj ) ; return mCollidables . size ( ) - 1 ; } } | Adds another scene object to pick against . Each frame all the colliders in the scene will be compared against the bounding volumes of all the collidables associated with this picker . |
25,078 | public static GVRCameraRig makeInstance ( GVRContext gvrContext ) { final GVRCameraRig result = gvrContext . getApplication ( ) . getDelegate ( ) . makeCameraRig ( gvrContext ) ; result . init ( gvrContext ) ; return result ; } | Constructs a camera rig with cameras attached . An owner scene object is automatically created for the camera rig . |
25,079 | public void removeAllChildren ( ) { for ( final GVRSceneObject so : headTransformObject . getChildren ( ) ) { final boolean notCamera = ( so != leftCameraObject && so != rightCameraObject && so != centerCameraObject ) ; if ( notCamera ) { headTransformObject . removeChildObject ( so ) ; } } } | Remove all children that have been added to the owner object of this camera rig ; except the camera objects . |
25,080 | public void setNearClippingDistance ( float near ) { if ( leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface ) { ( ( GVRCameraClippingDistanceInterface ) leftCamera ) . setNearClippingDistanc... | Sets the distance from the origin to the near clipping plane for the whole camera rig . |
25,081 | public void setFarClippingDistance ( float far ) { if ( leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface ) { ( ( GVRCameraClippingDistanceInterface ) leftCamera ) . setFarClippingDistance (... | Sets the distance from the origin to the far clipping plane for the whole camera rig . |
25,082 | public static String readTextFile ( File file ) { try { return readTextFile ( new FileReader ( file ) ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; return null ; } } | Read a text file into a single string |
25,083 | public static String readTextFile ( Context context , int resourceId ) { InputStream inputStream = context . getResources ( ) . openRawResource ( resourceId ) ; return readTextFile ( inputStream ) ; } | Read a text file resource into a single string |
25,084 | public static String readTextFile ( InputStream inputStream ) { InputStreamReader streamReader = new InputStreamReader ( inputStream ) ; return readTextFile ( streamReader ) ; } | Read a text stream into a single string . |
25,085 | private static Future < ? > spawn ( final int priority , final Runnable threadProc ) { return threadPool . submit ( new Runnable ( ) { public void run ( ) { Thread current = Thread . currentThread ( ) ; int defaultPriority = current . getPriority ( ) ; try { current . setPriority ( priority ) ; Thread . yield ( ) ; try... | Execute a Runnable on a thread pool thread |
25,086 | public static void assertUnlocked ( Object object , String name ) { if ( RUNTIME_ASSERTIONS ) { if ( Thread . holdsLock ( object ) ) { throw new RuntimeAssertion ( "Recursive lock of %s" , name ) ; } } } | This is an assertion method that can be used by a thread to confirm that the thread isn t already holding lock for an object before acquiring a lock |
25,087 | public void enableUniformSize ( final boolean enable ) { if ( mUniformSize != enable ) { mUniformSize = enable ; if ( mContainer != null ) { mContainer . onLayoutChanged ( this ) ; } } } | When set to true all items in layout will be considered having the size of the largest child . If false all items are measured normally . Disabled by default . |
25,088 | public void setDividerPadding ( float padding , final Axis axis ) { if ( axis == getOrientationAxis ( ) ) { super . setDividerPadding ( padding , axis ) ; } else { Log . w ( TAG , "Cannot apply divider padding for wrong axis [%s], orientation = %s" , axis , getOrientation ( ) ) ; } } | Sets divider padding for axis . If axis does not match the orientation it has no effect . |
25,089 | protected boolean isValidLayout ( Gravity gravity , Orientation orientation ) { boolean isValid = true ; switch ( gravity ) { case TOP : case BOTTOM : isValid = ( ! isUnlimitedSize ( ) && orientation == Orientation . VERTICAL ) ; break ; case LEFT : case RIGHT : isValid = ( ! isUnlimitedSize ( ) && orientation == Orien... | Check if the gravity and orientation are not in conflict one with other . |
25,090 | protected float getLayoutOffset ( ) { final float axisSize = getViewPortSize ( getOrientationAxis ( ) ) ; float layoutOffset = - axisSize / 2 ; Log . d ( LAYOUT , TAG , "getLayoutOffset(): dimension: %5.2f, layoutOffset: %5.2f" , axisSize , layoutOffset ) ; return layoutOffset ; } | Calculate the layout offset |
25,091 | protected float getStartingOffset ( final float totalSize ) { final float axisSize = getViewPortSize ( getOrientationAxis ( ) ) ; float startingOffset = 0 ; switch ( getGravityInternal ( ) ) { case LEFT : case FILL : case TOP : case FRONT : startingOffset = - axisSize / 2 ; break ; case RIGHT : case BOTTOM : case BACK ... | Calculate the starting content offset based on the layout orientation and Gravity |
25,092 | protected boolean changeDirection ( int currentIndex , int centerIndex , boolean inBounds ) { boolean changed = false ; if ( getGravityInternal ( ) == Gravity . CENTER && currentIndex <= centerIndex && currentIndex == 0 || ! inBounds ) { changed = true ; } return changed ; } | <<<<<< measureUntilFull helper methods |
25,093 | protected int getCenterChild ( CacheDataSet cache ) { if ( cache . count ( ) == 0 ) return - 1 ; int id = cache . getId ( 0 ) ; switch ( getGravityInternal ( ) ) { case TOP : case LEFT : case FRONT : case FILL : break ; case BOTTOM : case RIGHT : case BACK : id = cache . getId ( cache . count ( ) - 1 ) ; break ; case C... | >>>>>> measureUntilFull helper methods |
25,094 | protected boolean computeOffset ( final int dataIndex , CacheDataSet cache ) { float layoutOffset = getLayoutOffset ( ) ; int pos = cache . getPos ( dataIndex ) ; float startDataOffset = Float . NaN ; float endDataOffset = Float . NaN ; if ( pos > 0 ) { int id = cache . getId ( pos - 1 ) ; if ( id != - 1 ) { startDataO... | Compute the offset for the item in the layout cache |
25,095 | protected boolean computeOffset ( CacheDataSet cache ) { float startDataOffset = getStartingOffset ( ( cache . getTotalSizeWithPadding ( ) ) ) ; float layoutOffset = getLayoutOffset ( ) ; boolean inBounds = startDataOffset < - layoutOffset ; for ( int pos = 0 ; pos < cache . count ( ) ; ++ pos ) { int id = cache . getI... | Compute the offset for the item in the layout based on the offsets of neighbors in the layout . The other offsets are not patched . If neighbors offsets have not been computed the offset of the item will not be set . |
25,096 | protected float computeUniformPadding ( final CacheDataSet cache ) { float axisSize = getViewPortSize ( getOrientationAxis ( ) ) ; float totalPadding = axisSize - cache . getTotalSize ( ) ; float uniformPadding = totalPadding > 0 && cache . count ( ) > 1 ? totalPadding / ( cache . count ( ) - 1 ) : 0 ; return uniformPa... | Compute the proportional padding for all items in the cache |
25,097 | public String [ ] getString ( ) { String [ ] valueDestination = new String [ string . size ( ) ] ; this . string . getValue ( valueDestination ) ; return valueDestination ; } | Provide array of String results from inputOutput MFString field named string . |
25,098 | public void setString ( String [ ] newValue ) { if ( newValue != null ) { this . string . setValue ( newValue . length , newValue ) ; } } | Assign float value within allowed range of [ 0 infinity ) to initializeOnly SFFloat field named spacing . |
25,099 | public int findAnimation ( GVRAnimation findme ) { int index = 0 ; for ( GVRAnimation anim : mAnimations ) { if ( anim == findme ) { return index ; } ++ index ; } return - 1 ; } | Find the index of this animation if it is in this animator . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.