repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/LODmanager.java
LODmanager.AddLODSceneObject
protected void AddLODSceneObject(GVRSceneObject currentSceneObject) { if (this.transformLODSceneObject != null) { GVRSceneObject levelOfDetailSceneObject = null; if ( currentSceneObject.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = currentSceneObject; } else { GVRSceneObject lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_TRANSLATION_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } if (levelOfDetailSceneObject == null) { lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_ROTATION_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } } if (levelOfDetailSceneObject == null) { lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_SCALE_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } } } if ( levelOfDetailSceneObject != null) { final GVRLODGroup lodGroup = (GVRLODGroup) this.transformLODSceneObject.getComponent(GVRLODGroup.getComponentType()); lodGroup.addRange(this.getMinRange(), levelOfDetailSceneObject); this.increment(); } } }
java
protected void AddLODSceneObject(GVRSceneObject currentSceneObject) { if (this.transformLODSceneObject != null) { GVRSceneObject levelOfDetailSceneObject = null; if ( currentSceneObject.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = currentSceneObject; } else { GVRSceneObject lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_TRANSLATION_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } if (levelOfDetailSceneObject == null) { lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_ROTATION_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } } if (levelOfDetailSceneObject == null) { lodSceneObj = root.getSceneObjectByName((currentSceneObject.getName() + TRANSFORM_SCALE_)); if ( lodSceneObj != null ) { if (lodSceneObj.getParent() == this.transformLODSceneObject) { levelOfDetailSceneObject = lodSceneObj; } } } } if ( levelOfDetailSceneObject != null) { final GVRLODGroup lodGroup = (GVRLODGroup) this.transformLODSceneObject.getComponent(GVRLODGroup.getComponentType()); lodGroup.addRange(this.getMinRange(), levelOfDetailSceneObject); this.increment(); } } }
[ "protected", "void", "AddLODSceneObject", "(", "GVRSceneObject", "currentSceneObject", ")", "{", "if", "(", "this", ".", "transformLODSceneObject", "!=", "null", ")", "{", "GVRSceneObject", "levelOfDetailSceneObject", "=", "null", ";", "if", "(", "currentSceneObject",...
Add the currentSceneObject to an active Level-of-Detail
[ "Add", "the", "currentSceneObject", "to", "an", "active", "Level", "-", "of", "-", "Detail" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/LODmanager.java#L109-L146
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java
MultiPageWidget.applyLayout
@Override public boolean applyLayout(Layout itemLayout) { boolean applied = false; if (itemLayout != null && mItemLayouts.add(itemLayout)) { // apply the layout to all visible pages List<Widget> views = getAllViews(); for (Widget view: views) { view.applyLayout(itemLayout.clone()); } applied = true; } return applied; }
java
@Override public boolean applyLayout(Layout itemLayout) { boolean applied = false; if (itemLayout != null && mItemLayouts.add(itemLayout)) { // apply the layout to all visible pages List<Widget> views = getAllViews(); for (Widget view: views) { view.applyLayout(itemLayout.clone()); } applied = true; } return applied; }
[ "@", "Override", "public", "boolean", "applyLayout", "(", "Layout", "itemLayout", ")", "{", "boolean", "applied", "=", "false", ";", "if", "(", "itemLayout", "!=", "null", "&&", "mItemLayouts", ".", "add", "(", "itemLayout", ")", ")", "{", "// apply the layo...
Apply the layout to the each page in the list @param itemLayout item layout in the page @return true if the new layout is applied successfully, otherwise - false
[ "Apply", "the", "layout", "to", "the", "each", "page", "in", "the", "list" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java#L172-L185
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java
MultiPageWidget.getPageScrollable
public LayoutScroller.ScrollableList getPageScrollable() { return new LayoutScroller.ScrollableList() { @Override public int getScrollingItemsCount() { return MultiPageWidget.super.getScrollingItemsCount(); } @Override public float getViewPortWidth() { return MultiPageWidget.super.getViewPortWidth(); } @Override public float getViewPortHeight() { return MultiPageWidget.super.getViewPortHeight(); } @Override public float getViewPortDepth() { return MultiPageWidget.super.getViewPortDepth(); } @Override public boolean scrollToPosition(int pos, final LayoutScroller.OnScrollListener listener) { return MultiPageWidget.super.scrollToPosition(pos, listener); } @Override public boolean scrollByOffset(float xOffset, float yOffset, float zOffset, final LayoutScroller.OnScrollListener listener) { return MultiPageWidget.super.scrollByOffset(xOffset, yOffset, zOffset, listener); } @Override public void registerDataSetObserver(DataSetObserver observer) { MultiPageWidget.super.registerDataSetObserver(observer); } @Override public void unregisterDataSetObserver(DataSetObserver observer) { MultiPageWidget.super.unregisterDataSetObserver(observer); } @Override public int getCurrentPosition() { return MultiPageWidget.super.getCurrentPosition(); } }; }
java
public LayoutScroller.ScrollableList getPageScrollable() { return new LayoutScroller.ScrollableList() { @Override public int getScrollingItemsCount() { return MultiPageWidget.super.getScrollingItemsCount(); } @Override public float getViewPortWidth() { return MultiPageWidget.super.getViewPortWidth(); } @Override public float getViewPortHeight() { return MultiPageWidget.super.getViewPortHeight(); } @Override public float getViewPortDepth() { return MultiPageWidget.super.getViewPortDepth(); } @Override public boolean scrollToPosition(int pos, final LayoutScroller.OnScrollListener listener) { return MultiPageWidget.super.scrollToPosition(pos, listener); } @Override public boolean scrollByOffset(float xOffset, float yOffset, float zOffset, final LayoutScroller.OnScrollListener listener) { return MultiPageWidget.super.scrollByOffset(xOffset, yOffset, zOffset, listener); } @Override public void registerDataSetObserver(DataSetObserver observer) { MultiPageWidget.super.registerDataSetObserver(observer); } @Override public void unregisterDataSetObserver(DataSetObserver observer) { MultiPageWidget.super.unregisterDataSetObserver(observer); } @Override public int getCurrentPosition() { return MultiPageWidget.super.getCurrentPosition(); } }; }
[ "public", "LayoutScroller", ".", "ScrollableList", "getPageScrollable", "(", ")", "{", "return", "new", "LayoutScroller", ".", "ScrollableList", "(", ")", "{", "@", "Override", "public", "int", "getScrollingItemsCount", "(", ")", "{", "return", "MultiPageWidget", ...
Provides the scrollableList implementation for page scrolling @return {@link LayoutScroller.ScrollableList} implementation, passed to {@link LayoutScroller} for the processing the scrolling
[ "Provides", "the", "scrollableList", "implementation", "for", "page", "scrolling" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/MultiPageWidget.java#L376-L426
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/ViewpointAnimation.java
ViewpointAnimation.startAnimation
public void startAnimation() { Date time = new Date(); this.beginAnimation = time.getTime(); this.endAnimation = beginAnimation + (long) (animationTime * 1000); this.animate = true; }
java
public void startAnimation() { Date time = new Date(); this.beginAnimation = time.getTime(); this.endAnimation = beginAnimation + (long) (animationTime * 1000); this.animate = true; }
[ "public", "void", "startAnimation", "(", ")", "{", "Date", "time", "=", "new", "Date", "(", ")", ";", "this", ".", "beginAnimation", "=", "time", ".", "getTime", "(", ")", ";", "this", ".", "endAnimation", "=", "beginAnimation", "+", "(", "long", ")", ...
once animation is setup, start the animation record the beginning and ending time for the animation
[ "once", "animation", "is", "setup", "start", "the", "animation", "record", "the", "beginning", "and", "ending", "time", "for", "the", "animation" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/ViewpointAnimation.java#L99-L105
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/ViewpointAnimation.java
ViewpointAnimation.updateAnimation
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; } else { float t = (float) currentTime / animationTime; this.currentQuaternion = this.beginQuaternion.slerp(this.endQuaternion, t); for (int i = 0; i < 3; i++) { this.currentPos[i] = this.beginPos[i] + totalTranslation[i] * t; } } }
java
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; } else { float t = (float) currentTime / animationTime; this.currentQuaternion = this.beginQuaternion.slerp(this.endQuaternion, t); for (int i = 0; i < 3; i++) { this.currentPos[i] = this.beginPos[i] + totalTranslation[i] * t; } } }
[ "public", "void", "updateAnimation", "(", ")", "{", "Date", "time", "=", "new", "Date", "(", ")", ";", "long", "currentTime", "=", "time", ".", "getTime", "(", ")", "-", "this", ".", "beginAnimation", ";", "if", "(", "currentTime", ">", "animationTime", ...
called per frame of animation to update the camera position
[ "called", "per", "frame", "of", "animation", "to", "update", "the", "camera", "position" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/ViewpointAnimation.java#L110-L136
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureParameters.java
GVRTextureParameters.getDefalutValuesArray
public int[] getDefalutValuesArray() { int[] defaultValues = new int[5]; defaultValues[0] = GLES20.GL_LINEAR_MIPMAP_NEAREST; // MIN FILTER defaultValues[1] = GLES20.GL_LINEAR; // MAG FILTER defaultValues[2] = 1; // ANISO FILTER defaultValues[3] = GLES20.GL_CLAMP_TO_EDGE; // WRAP S defaultValues[4] = GLES20.GL_CLAMP_TO_EDGE; // WRAP T return defaultValues; }
java
public int[] getDefalutValuesArray() { int[] defaultValues = new int[5]; defaultValues[0] = GLES20.GL_LINEAR_MIPMAP_NEAREST; // MIN FILTER defaultValues[1] = GLES20.GL_LINEAR; // MAG FILTER defaultValues[2] = 1; // ANISO FILTER defaultValues[3] = GLES20.GL_CLAMP_TO_EDGE; // WRAP S defaultValues[4] = GLES20.GL_CLAMP_TO_EDGE; // WRAP T return defaultValues; }
[ "public", "int", "[", "]", "getDefalutValuesArray", "(", ")", "{", "int", "[", "]", "defaultValues", "=", "new", "int", "[", "5", "]", ";", "defaultValues", "[", "0", "]", "=", "GLES20", ".", "GL_LINEAR_MIPMAP_NEAREST", ";", "// MIN FILTER", "defaultValues",...
Returns an integer array that contains the default values for all the texture parameters. @return an integer array that contains the default values for all the texture parameters.
[ "Returns", "an", "integer", "array", "that", "contains", "the", "default", "values", "for", "all", "the", "texture", "parameters", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureParameters.java#L203-L213
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureParameters.java
GVRTextureParameters.getCurrentValuesArray
public int[] getCurrentValuesArray() { int[] currentValues = new int[5]; currentValues[0] = getMinFilterType().getFilterValue(); // MIN FILTER currentValues[1] = getMagFilterType().getFilterValue(); // MAG FILTER currentValues[2] = getAnisotropicValue(); // ANISO FILTER currentValues[3] = getWrapSType().getWrapValue(); // WRAP S currentValues[4] = getWrapTType().getWrapValue(); // WRAP T return currentValues; }
java
public int[] getCurrentValuesArray() { int[] currentValues = new int[5]; currentValues[0] = getMinFilterType().getFilterValue(); // MIN FILTER currentValues[1] = getMagFilterType().getFilterValue(); // MAG FILTER currentValues[2] = getAnisotropicValue(); // ANISO FILTER currentValues[3] = getWrapSType().getWrapValue(); // WRAP S currentValues[4] = getWrapTType().getWrapValue(); // WRAP T return currentValues; }
[ "public", "int", "[", "]", "getCurrentValuesArray", "(", ")", "{", "int", "[", "]", "currentValues", "=", "new", "int", "[", "5", "]", ";", "currentValues", "[", "0", "]", "=", "getMinFilterType", "(", ")", ".", "getFilterValue", "(", ")", ";", "// MIN...
Returns an integer array that contains the current values for all the texture parameters. @return an integer array that contains the current values for all the texture parameters.
[ "Returns", "an", "integer", "array", "that", "contains", "the", "current", "values", "for", "all", "the", "texture", "parameters", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureParameters.java#L222-L232
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.hasProperties
public boolean hasProperties(Set<PropertyKey> keys) { for (PropertyKey key : keys) { if (null == getProperty(key.m_key)) { return false; } } return true; }
java
public boolean hasProperties(Set<PropertyKey> keys) { for (PropertyKey key : keys) { if (null == getProperty(key.m_key)) { return false; } } return true; }
[ "public", "boolean", "hasProperties", "(", "Set", "<", "PropertyKey", ">", "keys", ")", "{", "for", "(", "PropertyKey", "key", ":", "keys", ")", "{", "if", "(", "null", "==", "getProperty", "(", "key", ".", "m_key", ")", ")", "{", "return", "false", ...
Checks whether the given set of properties is available. @param keys the keys to check @return true if all properties are available, false otherwise
[ "Checks", "whether", "the", "given", "set", "of", "properties", "is", "available", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L499-L507
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.getTextureMagFilter
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.getData(); if (rawValue instanceof java.nio.ByteBuffer) { java.nio.IntBuffer ibuf = ((java.nio.ByteBuffer) rawValue).asIntBuffer(); return ibuf.get(); } else { return (Integer) rawValue; } }
java
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.getData(); if (rawValue instanceof java.nio.ByteBuffer) { java.nio.IntBuffer ibuf = ((java.nio.ByteBuffer) rawValue).asIntBuffer(); return ibuf.get(); } else { return (Integer) rawValue; } }
[ "public", "Integer", "getTextureMagFilter", "(", "AiTextureType", "type", ",", "int", "index", ")", "{", "checkTexRange", "(", "type", ",", "index", ")", ";", "Property", "p", "=", "getProperty", "(", "PropertyKey", ".", "TEX_MAG_FILTER", ".", "m_key", ")", ...
Returns the texture magnification filter If missing, defaults to {@link GL_LINEAR } @param type the texture type @param index the index in the texture stack @return the texture magnification filter
[ "Returns", "the", "texture", "magnification", "filter" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1051-L1069
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.getMetallic
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.FloatBuffer fbuf = ((java.nio.ByteBuffer) rawValue).asFloatBuffer(); return fbuf.get(); } else { return (Float) rawValue; } }
java
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.FloatBuffer fbuf = ((java.nio.ByteBuffer) rawValue).asFloatBuffer(); return fbuf.get(); } else { return (Float) rawValue; } }
[ "public", "float", "getMetallic", "(", ")", "{", "Property", "p", "=", "getProperty", "(", "PropertyKey", ".", "METALLIC", ".", "m_key", ")", ";", "if", "(", "null", "==", "p", "||", "null", "==", "p", ".", "getData", "(", ")", ")", "{", "throw", "...
Returns the metallic factor for PBR shading
[ "Returns", "the", "metallic", "factor", "for", "PBR", "shading" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1074-L1092
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.getTextureInfo
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, index), getTextureMapModeW(type, index)); }
java
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, index), getTextureMapModeW(type, index)); }
[ "public", "AiTextureInfo", "getTextureInfo", "(", "AiTextureType", "type", ",", "int", "index", ")", "{", "return", "new", "AiTextureInfo", "(", "type", ",", "index", ",", "getTextureFile", "(", "type", ",", "index", ")", ",", "getTextureUVIndex", "(", "type",...
Returns all information related to a single texture. @param type the texture type @param index the index in the texture stack @return the texture information
[ "Returns", "all", "information", "related", "to", "a", "single", "texture", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1159-L1165
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.checkTexRange
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)); } }
java
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)); } }
[ "private", "void", "checkTexRange", "(", "AiTextureType", "type", ",", "int", "index", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">", "m_numTextures", ".", "get", "(", "type", ")", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", ...
Checks that index is valid an throw an exception if not. @param type the type @param index the index to check
[ "Checks", "that", "index", "is", "valid", "an", "throw", "an", "exception", "if", "not", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1268-L1273
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java
AiMaterial.setTextureNumber
@SuppressWarnings("unused") private void setTextureNumber(int type, int number) { m_numTextures.put(AiTextureType.fromRawValue(type), number); }
java
@SuppressWarnings("unused") private void setTextureNumber(int type, int number) { m_numTextures.put(AiTextureType.fromRawValue(type), number); }
[ "@", "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. @param type the type @param number the number
[ "This", "method", "is", "used", "by", "JNI", "do", "not", "call", "or", "modify", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L1334-L1337
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java
GVRFrustumPicker.setFrustum
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); }
java
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); }
[ "public", "void", "setFrustum", "(", "float", "[", "]", "frustum", ")", "{", "Matrix4f", "projMatrix", "=", "new", "Matrix4f", "(", ")", ";", "projMatrix", ".", "setFrustum", "(", "frustum", "[", "0", "]", ",", "frustum", "[", "3", "]", ",", "frustum",...
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 frustum would see. If the frustum is not attached to a scene object, it defaults to the view frustum of the main camera of the scene. @param frustum array of 6 floats as follows: frustum[0] = left corner of frustum frustum[1] = bottom corner of frustum frustum[2] = front corner of frustum (near plane) frustum[3] = right corner of frustum frustum[4] = top corner of frustum frustum[5 = back corner of frustum (far plane)
[ "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"...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L92-L97
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java
GVRFrustumPicker.setFrustum
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); }
java
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); }
[ "public", "void", "setFrustum", "(", "float", "fovy", ",", "float", "aspect", ",", "float", "znear", ",", "float", "zfar", ")", "{", "Matrix4f", "projMatrix", "=", "new", "Matrix4f", "(", ")", ";", "projMatrix", ".", "perspective", "(", "(", "float", ")"...
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 object with that view frustum would see. If the frustum is not attached to a scene object, it defaults to the view frustum of the main camera of the scene. @param fovy vertical field of view in degrees @param aspect aspect ratio (width / height)
[ "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", "obje...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L112-L117
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java
GVRFrustumPicker.setFrustum
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 FrustumIntersection(projMatrix); } } mProjection = projMatrix; }
java
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 FrustumIntersection(projMatrix); } } mProjection = projMatrix; }
[ "public", "void", "setFrustum", "(", "Matrix4f", "projMatrix", ")", "{", "if", "(", "projMatrix", "!=", "null", ")", "{", "if", "(", "mProjMatrix", "==", "null", ")", "{", "mProjMatrix", "=", "new", "float", "[", "16", "]", ";", "}", "mProjMatrix", "="...
Set the view frustum to pick against from the given projection matrix. If the projection matrix is null, the picker will revert to picking objects that are visible from the viewpoint of the scene's current camera. If a matrix is given, the picker will pick objects that are visible from the viewpoint of it's owner the given projection matrix. @param projMatrix 4x4 projection matrix or null @see GVRScene#setPickVisible(boolean)
[ "Set", "the", "view", "frustum", "to", "pick", "against", "from", "the", "given", "projection", "matrix", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L130-L150
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java
GVRFrustumPicker.pickVisible
public static final GVRPickedObject[] pickVisible(GVRScene scene) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickVisible(scene.getNative()); return result; } finally { sFindObjectsLock.unlock(); } }
java
public static final GVRPickedObject[] pickVisible(GVRScene scene) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickVisible(scene.getNative()); return result; } finally { sFindObjectsLock.unlock(); } }
[ "public", "static", "final", "GVRPickedObject", "[", "]", "pickVisible", "(", "GVRScene", "scene", ")", "{", "sFindObjectsLock", ".", "lock", "(", ")", ";", "try", "{", "final", "GVRPickedObject", "[", "]", "result", "=", "NativePicker", ".", "pickVisible", ...
Returns the list of colliders attached to scene objects that are visible from the viewpoint of the camera. <p> This method is thread safe because it guarantees that only one thread at a time is picking against particular scene graph, and it extracts the hit data during within its synchronized block. You can then examine the return list without worrying about another thread corrupting your hit data. The hit location returned is the world position of the scene object center. @param scene The {@link GVRScene} with all the objects to be tested. @return A list of {@link org.gearvrf.GVRPicker.GVRPickedObject}, sorted by distance from the camera rig. Each {@link org.gearvrf.GVRPicker.GVRPickedObject} contains the scene object which owns the {@link GVRCollider} along with the hit location and distance from the camera. @since 1.6.6
[ "Returns", "the", "list", "of", "colliders", "attached", "to", "scene", "objects", "that", "are", "visible", "from", "the", "viewpoint", "of", "the", "camera", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L240-L248
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java
GVRIndexBuffer.setShortVec
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(getNative(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } }
java
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(getNative(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } }
[ "public", "void", "setShortVec", "(", "char", "[", "]", "data", ")", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Input data for indices cannot be null\"", ")", ";", "}", "if", "(", "getIndexSize", "(", ...
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. @param data char array containing the new values @throws IllegalArgumentException if char array is wrong size
[ "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", ".",...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java#L192-L206
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java
GVRIndexBuffer.setShortVec
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 (!NativeIndexBuffer.setShortVec(getNative(), data)) { throw new UnsupportedOperationException("Input buffer is wrong size"); } } else if (data.hasArray()) { if (!NativeIndexBuffer.setShortArray(getNative(), data.array())) { throw new UnsupportedOperationException("Input buffer is wrong size"); } } else { throw new UnsupportedOperationException( "CharBuffer type not supported. Must be direct or have backing array"); } }
java
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 (!NativeIndexBuffer.setShortVec(getNative(), data)) { throw new UnsupportedOperationException("Input buffer is wrong size"); } } else if (data.hasArray()) { if (!NativeIndexBuffer.setShortArray(getNative(), data.array())) { throw new UnsupportedOperationException("Input buffer is wrong size"); } } else { throw new UnsupportedOperationException( "CharBuffer type not supported. Must be direct or have backing array"); } }
[ "public", "void", "setShortVec", "(", "CharBuffer", "data", ")", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Input data for indices cannot be null\"", ")", ";", "}", "if", "(", "getIndexSize", "(", ")", "...
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. @param data CharBuffer containing the new values @throws IllegalArgumentException if char array is wrong size
[ "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", "n...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java#L216-L245
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java
GVRIndexBuffer.setIntVec
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(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } }
java
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(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } }
[ "public", "void", "setIntVec", "(", "int", "[", "]", "data", ")", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Input data for indices cannot be null\"", ")", ";", "}", "if", "(", "getIndexSize", "(", ")"...
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. @param data char array containing the new values @throws IllegalArgumentException if int array is wrong size
[ "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", ".", ...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java#L255-L269
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java
GVRIndexBuffer.setIntVec
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 (!NativeIndexBuffer.setIntVec(getNative(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } } else if (data.hasArray()) { if (!NativeIndexBuffer.setIntArray(getNative(), data.array())) { throw new IllegalArgumentException("Data array incompatible with index buffer"); } } else { throw new UnsupportedOperationException("IntBuffer type not supported. Must be direct or have backing array"); } }
java
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 (!NativeIndexBuffer.setIntVec(getNative(), data)) { throw new UnsupportedOperationException("Input array is wrong size"); } } else if (data.hasArray()) { if (!NativeIndexBuffer.setIntArray(getNative(), data.array())) { throw new IllegalArgumentException("Data array incompatible with index buffer"); } } else { throw new UnsupportedOperationException("IntBuffer type not supported. Must be direct or have backing array"); } }
[ "public", "void", "setIntVec", "(", "IntBuffer", "data", ")", "{", "if", "(", "data", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Input buffer for indices cannot be null\"", ")", ";", "}", "if", "(", "getIndexSize", "(", ")", "!...
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. @param data char array containing the new values @throws IllegalArgumentException if int buffer is wrong size
[ "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", ".", "Th...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRIndexBuffer.java#L279-L307
train
Samsung/GearVRf
GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java
GVREmitter.emitWithBurstCheck
protected void emitWithBurstCheck(float[] particlePositions, float[] particleVelocities, float[] particleTimeStamps) { if ( burstMode ) { if ( executeOnce ) { emit(particlePositions, particleVelocities, particleTimeStamps); executeOnce = false; } } else { emit(particlePositions, particleVelocities, particleTimeStamps); } }
java
protected void emitWithBurstCheck(float[] particlePositions, float[] particleVelocities, float[] particleTimeStamps) { if ( burstMode ) { if ( executeOnce ) { emit(particlePositions, particleVelocities, particleTimeStamps); executeOnce = false; } } else { emit(particlePositions, particleVelocities, particleTimeStamps); } }
[ "protected", "void", "emitWithBurstCheck", "(", "float", "[", "]", "particlePositions", ",", "float", "[", "]", "particleVelocities", ",", "float", "[", "]", "particleTimeStamps", ")", "{", "if", "(", "burstMode", ")", "{", "if", "(", "executeOnce", ")", "{"...
If the burst mode is on, emit the particles only once. @param particlePositions @param particleVelocities @param particleTimeStamps
[ "If", "the", "burst", "mode", "is", "on", "emit", "the", "particles", "only", "once", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java#L134-L150
train
Samsung/GearVRf
GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java
GVREmitter.emit
private void emit(float[] particlePositions, float[] particleVelocities, float[] particleTimeStamps) { float[] allParticlePositions = new float[particlePositions.length + particleBoundingVolume.length]; System.arraycopy(particlePositions, 0, allParticlePositions, 0, particlePositions.length); System.arraycopy(particleBoundingVolume, 0, allParticlePositions, particlePositions.length, particleBoundingVolume.length); float[] allSpawnTimes = new float[particleTimeStamps.length + BVSpawnTimes.length]; System.arraycopy(particleTimeStamps, 0, allSpawnTimes, 0, particleTimeStamps.length); System.arraycopy(BVSpawnTimes, 0, allSpawnTimes, particleTimeStamps.length, BVSpawnTimes.length); float[] allParticleVelocities = new float[particleVelocities.length + BVVelocities.length]; System.arraycopy(particleVelocities, 0, allParticleVelocities, 0, particleVelocities.length); System.arraycopy(BVVelocities, 0, allParticleVelocities, particleVelocities.length, BVVelocities.length); Particles particleMesh = new Particles(mGVRContext, mMaxAge, mParticleSize, mEnvironmentAcceleration, mParticleSizeRate, mFadeWithAge, mParticleTexture, mColor, mNoiseFactor); GVRSceneObject particleObject = particleMesh.makeParticleMesh(allParticlePositions, allParticleVelocities, allSpawnTimes); this.addChildObject(particleObject); meshInfo.add(Pair.create(particleObject, currTime)); }
java
private void emit(float[] particlePositions, float[] particleVelocities, float[] particleTimeStamps) { float[] allParticlePositions = new float[particlePositions.length + particleBoundingVolume.length]; System.arraycopy(particlePositions, 0, allParticlePositions, 0, particlePositions.length); System.arraycopy(particleBoundingVolume, 0, allParticlePositions, particlePositions.length, particleBoundingVolume.length); float[] allSpawnTimes = new float[particleTimeStamps.length + BVSpawnTimes.length]; System.arraycopy(particleTimeStamps, 0, allSpawnTimes, 0, particleTimeStamps.length); System.arraycopy(BVSpawnTimes, 0, allSpawnTimes, particleTimeStamps.length, BVSpawnTimes.length); float[] allParticleVelocities = new float[particleVelocities.length + BVVelocities.length]; System.arraycopy(particleVelocities, 0, allParticleVelocities, 0, particleVelocities.length); System.arraycopy(BVVelocities, 0, allParticleVelocities, particleVelocities.length, BVVelocities.length); Particles particleMesh = new Particles(mGVRContext, mMaxAge, mParticleSize, mEnvironmentAcceleration, mParticleSizeRate, mFadeWithAge, mParticleTexture, mColor, mNoiseFactor); GVRSceneObject particleObject = particleMesh.makeParticleMesh(allParticlePositions, allParticleVelocities, allSpawnTimes); this.addChildObject(particleObject); meshInfo.add(Pair.create(particleObject, currTime)); }
[ "private", "void", "emit", "(", "float", "[", "]", "particlePositions", ",", "float", "[", "]", "particleVelocities", ",", "float", "[", "]", "particleTimeStamps", ")", "{", "float", "[", "]", "allParticlePositions", "=", "new", "float", "[", "particlePosition...
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. @param particlePositions @param particleVelocities @param particleTimeStamps
[ "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", ...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java#L162-L189
train
Samsung/GearVRf
GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java
GVREmitter.setVelocityRange
public void setVelocityRange( final Vector3f minV, final Vector3f maxV ) { if (null != mGVRContext) { mGVRContext.runOnGlThread(new Runnable() { @Override public void run() { minVelocity = minV; maxVelocity = maxV; } }); } }
java
public void setVelocityRange( final Vector3f minV, final Vector3f maxV ) { if (null != mGVRContext) { mGVRContext.runOnGlThread(new Runnable() { @Override public void run() { minVelocity = minV; maxVelocity = maxV; } }); } }
[ "public", "void", "setVelocityRange", "(", "final", "Vector3f", "minV", ",", "final", "Vector3f", "maxV", ")", "{", "if", "(", "null", "!=", "mGVRContext", ")", "{", "mGVRContext", ".", "runOnGlThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override...
The range of velocities that a particle generated from this emitter can have. @param minV Minimum velocity that a particle can have @param maxV Maximum velocity that a particle can have
[ "The", "range", "of", "velocities", "that", "a", "particle", "generated", "from", "this", "emitter", "can", "have", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVREmitter.java#L294-L306
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Log.java
Log.logLong
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()); } }
java
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()); } }
[ "public", "static", "void", "logLong", "(", "String", "TAG", ",", "String", "longString", ")", "{", "InputStream", "is", "=", "new", "ByteArrayInputStream", "(", "longString", ".", "getBytes", "(", ")", ")", ";", "@", "SuppressWarnings", "(", "\"resource\"", ...
Log long string using verbose tag @param TAG The tag. @param longString The long string.
[ "Log", "long", "string", "using", "verbose", "tag" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Log.java#L116-L123
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java
Utility.readTextFile
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 exist", asset); } catch (IOException e) { e.printStackTrace(); Log.e(TAG, e, "readTextFile()"); } return null; }
java
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 exist", asset); } catch (IOException e) { e.printStackTrace(); Log.e(TAG, e, "readTextFile()"); } return null; }
[ "public", "static", "String", "readTextFile", "(", "Context", "context", ",", "String", "asset", ")", "{", "try", "{", "InputStream", "inputStream", "=", "context", ".", "getAssets", "(", ")", ".", "open", "(", "asset", ")", ";", "return", "org", ".", "g...
Read a text file from assets into a single string @param context A non-null Android Context @param asset The asset file to read @return The contents or null on error.
[ "Read", "a", "text", "file", "from", "assets", "into", "a", "single", "string" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java#L42-L53
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java
Utility.equal
public static boolean equal(Vector3f v1, Vector3f v2) { return equal(v1.x, v2.x) && equal(v1.y, v2.y) && equal(v1.z, v2.z); }
java
public static boolean equal(Vector3f v1, Vector3f v2) { return equal(v1.x, v2.x) && equal(v1.y, v2.y) && equal(v1.z, v2.z); }
[ "public", "static", "boolean", "equal", "(", "Vector3f", "v1", ",", "Vector3f", "v2", ")", "{", "return", "equal", "(", "v1", ".", "x", ",", "v2", ".", "x", ")", "&&", "equal", "(", "v1", ".", "y", ",", "v2", ".", "y", ")", "&&", "equal", "(", ...
Are these two numbers effectively equal? The same logic is applied for each of the 3 vector dimensions: see {@link #equal} @param v1 @param v2
[ "Are", "these", "two", "numbers", "effectively", "equal?" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java#L90-L92
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java
Utility.getId
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, id, defType); }
java
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, id, defType); }
[ "public", "static", "int", "getId", "(", "Context", "context", ",", "String", "id", ")", "{", "final", "String", "defType", ";", "if", "(", "id", ".", "startsWith", "(", "\"R.\"", ")", ")", "{", "int", "dot", "=", "id", ".", "indexOf", "(", "'", "'...
Parses the resource String id and get back the int res id @param context @param id String resource id @return int resource id
[ "Parses", "the", "resource", "String", "id", "and", "get", "back", "the", "int", "res", "id" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java#L100-L111
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java
Utility.getId
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 (resId > 0) { return resId; } else { throw new RuntimeAssertion("Specified resource '%s' could not be found", id); } }
java
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 (resId > 0) { return resId; } else { throw new RuntimeAssertion("Specified resource '%s' could not be found", id); } }
[ "public", "static", "int", "getId", "(", "Context", "context", ",", "String", "id", ",", "String", "defType", ")", "{", "String", "type", "=", "\"R.\"", "+", "defType", "+", "\".\"", ";", "if", "(", "id", ".", "startsWith", "(", "type", ")", ")", "{"...
Get the int resource id with specified type definition @param context @param id String resource id @return int resource id
[ "Get", "the", "int", "resource", "id", "with", "specified", "type", "definition" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/Utility.java#L119-L133
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java
GVRShader.generateSignature
public String generateSignature(HashMap<String, Integer> defined, GVRLight[] lightlist) { return getClass().getSimpleName(); }
java
public String generateSignature(HashMap<String, Integer> defined, GVRLight[] lightlist) { return getClass().getSimpleName(); }
[ "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. @param defined names to be defined for this shader @return string signature for shader @see GVRShaderTemplate
[ "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...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java#L244-L247
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java
GVRShader.bindShader
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 = shaderManager.getShader(signature); if (nativeShader == 0) { nativeShader = addShader(shaderManager, signature, mtl); } if (nativeShader > 0) { rdata.setShader(nativeShader, isMultiview); } return nativeShader; } }
java
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 = shaderManager.getShader(signature); if (nativeShader == 0) { nativeShader = addShader(shaderManager, signature, mtl); } if (nativeShader > 0) { rdata.setShader(nativeShader, isMultiview); } return nativeShader; } }
[ "public", "int", "bindShader", "(", "GVRContext", "context", ",", "IRenderable", "rdata", ",", "GVRScene", "scene", ",", "boolean", "isMultiview", ")", "{", "String", "signature", "=", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ";", "GVRShaderManage...
Select the specific vertex and fragment shader to use. The shader template is used to generate the sources for the vertex and fragment shader based on the vertex, material and light properties. This function may compile the shader if it does not already exist. @param context GVRContext @param rdata renderable entity with mesh and rendering options @param scene list of light sources
[ "Select", "the", "specific", "vertex", "and", "fragment", "shader", "to", "use", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java#L306-L325
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java
GVRShader.bindShader
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 (nativeShader == 0) { nativeShader = addShader(shaderManager, signature, material); } return nativeShader; } }
java
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 (nativeShader == 0) { nativeShader = addShader(shaderManager, signature, material); } return nativeShader; } }
[ "public", "int", "bindShader", "(", "GVRContext", "context", ",", "GVRShaderData", "material", ",", "String", "vertexDesc", ")", "{", "String", "signature", "=", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ";", "GVRShaderManager", "shaderManager", "=",...
Select the specific vertex and fragment shader to use with this material. The shader template is used to generate the sources for the vertex and fragment shader based on the material properties only. It will ignore the mesh attributes and all lights. @param context GVRContext @param material material to use with the shader @return ID of vertex/fragment shader set
[ "Select", "the", "specific", "vertex", "and", "fragment", "shader", "to", "use", "with", "this", "material", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShader.java#L340-L354
train
Samsung/GearVRf
GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/PhysicsDragger.java
PhysicsDragger.startDrag
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 drag wasn't finished!"); return null; } if (mPivotObject == null) { mPivotObject = onCreatePivotObject(mContext); } mDragMe = dragMe; GVRTransform t = dragMe.getTransform(); /* It is not possible to drag a rigid body directly, we need a pivot object. We are using the pivot object's position as pivot of the dragging's physics constraint. */ mPivotObject.getTransform().setPosition(t.getPositionX() + relX, t.getPositionY() + relY, t.getPositionZ() + relZ); mCursorController.startDrag(mPivotObject); } return mPivotObject; }
java
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 drag wasn't finished!"); return null; } if (mPivotObject == null) { mPivotObject = onCreatePivotObject(mContext); } mDragMe = dragMe; GVRTransform t = dragMe.getTransform(); /* It is not possible to drag a rigid body directly, we need a pivot object. We are using the pivot object's position as pivot of the dragging's physics constraint. */ mPivotObject.getTransform().setPosition(t.getPositionX() + relX, t.getPositionY() + relY, t.getPositionZ() + relZ); mCursorController.startDrag(mPivotObject); } return mPivotObject; }
[ "public", "GVRSceneObject", "startDrag", "(", "GVRSceneObject", "dragMe", ",", "float", "relX", ",", "float", "relY", ",", "float", "relZ", ")", "{", "synchronized", "(", "mLock", ")", "{", "if", "(", "mCursorController", "==", "null", ")", "{", "Log", "."...
Start the drag of the pivot object. @param dragMe Scene object with a rigid body. @param relX rel position in x-axis. @param relY rel position in y-axis. @param relZ rel position in z-axis. @return Pivot instance if success, otherwise returns null.
[ "Start", "the", "drag", "of", "the", "pivot", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/PhysicsDragger.java#L67-L97
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java
GVRShaderData.setTexCoord
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 updating texture coordinate information"); } } }
java
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 updating texture coordinate information"); } } }
[ "public", "void", "setTexCoord", "(", "String", "texName", ",", "String", "texCoordAttr", ",", "String", "shaderVarName", ")", "{", "synchronized", "(", "textures", ")", "{", "GVRTexture", "tex", "=", "textures", ".", "get", "(", "texName", ")", ";", "if", ...
Designate the vertex attribute and shader variable for the texture coordinates associated with the named texture. @param texName name of texture @param texCoordAttr name of vertex attribute with texture coordinates. @param shaderVarName name of shader variable to get texture coordinates.
[ "Designate", "the", "vertex", "attribute", "and", "shader", "variable", "for", "the", "texture", "coordinates", "associated", "with", "the", "named", "texture", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java#L465-L480
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java
GVRShaderData.getTexCoordAttr
public String getTexCoordAttr(String texName) { GVRTexture tex = textures.get(texName); if (tex != null) { return tex.getTexCoordAttr(); } return null; }
java
public String getTexCoordAttr(String texName) { GVRTexture tex = textures.get(texName); if (tex != null) { return tex.getTexCoordAttr(); } return null; }
[ "public", "String", "getTexCoordAttr", "(", "String", "texName", ")", "{", "GVRTexture", "tex", "=", "textures", ".", "get", "(", "texName", ")", ";", "if", "(", "tex", "!=", "null", ")", "{", "return", "tex", ".", "getTexCoordAttr", "(", ")", ";", "}"...
Gets the name of the vertex attribute containing the texture coordinates for the named texture. @param texName name of texture @return name of texture coordinate vertex attribute
[ "Gets", "the", "name", "of", "the", "vertex", "attribute", "containing", "the", "texture", "coordinates", "for", "the", "named", "texture", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java#L489-L497
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java
GVRShaderData.getTexCoordShaderVar
public String getTexCoordShaderVar(String texName) { GVRTexture tex = textures.get(texName); if (tex != null) { return tex.getTexCoordShaderVar(); } return null; }
java
public String getTexCoordShaderVar(String texName) { GVRTexture tex = textures.get(texName); if (tex != null) { return tex.getTexCoordShaderVar(); } return null; }
[ "public", "String", "getTexCoordShaderVar", "(", "String", "texName", ")", "{", "GVRTexture", "tex", "=", "textures", ".", "get", "(", "texName", ")", ";", "if", "(", "tex", "!=", "null", ")", "{", "return", "tex", ".", "getTexCoordShaderVar", "(", ")", ...
Gets the name of the shader variable to get the texture coordinates for the named texture. @param texName name of texture @return name of shader variable
[ "Gets", "the", "name", "of", "the", "shader", "variable", "to", "get", "the", "texture", "coordinates", "for", "the", "named", "texture", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderData.java#L506-L514
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java
GVRPreference.getProperty
public String getProperty(String key, String defaultValue) { return mProperties.getProperty(key, defaultValue); }
java
public String getProperty(String key, String defaultValue) { return mProperties.getProperty(key, defaultValue); }
[ "public", "String", "getProperty", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "return", "mProperties", ".", "getProperty", "(", "key", ",", "defaultValue", ")", ";", "}" ]
Gets a property with a default value. @param key The key string. @param defaultValue The default value. @return The property string.
[ "Gets", "a", "property", "with", "a", "default", "value", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java#L63-L65
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PickerWidget.java
PickerWidget.hide
public synchronized void hide() { if (focusedQuad != null) { mDefocusAnimationFactory.create(focusedQuad) .setRequestLayoutOnTargetChange(false) .start().finish(); focusedQuad = null; } Log.d(Log.SUBSYSTEM.WIDGET, TAG, "hide Picker!"); }
java
public synchronized void hide() { if (focusedQuad != null) { mDefocusAnimationFactory.create(focusedQuad) .setRequestLayoutOnTargetChange(false) .start().finish(); focusedQuad = null; } Log.d(Log.SUBSYSTEM.WIDGET, TAG, "hide Picker!"); }
[ "public", "synchronized", "void", "hide", "(", ")", "{", "if", "(", "focusedQuad", "!=", "null", ")", "{", "mDefocusAnimationFactory", ".", "create", "(", "focusedQuad", ")", ".", "setRequestLayoutOnTargetChange", "(", "false", ")", ".", "start", "(", ")", "...
It should be called when the picker is hidden
[ "It", "should", "be", "called", "when", "the", "picker", "is", "hidden" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PickerWidget.java#L68-L78
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java
MFString.set1Value
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); } }
java
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); } }
[ "public", "void", "set1Value", "(", "int", "index", ",", "String", "newValue", ")", "{", "try", "{", "value", ".", "set", "(", "index", ",", "newValue", ")", ";", "}", "catch", "(", "IndexOutOfBoundsException", "e", ")", "{", "Log", ".", "e", "(", "T...
Replace a single value at the appropriate location in the existing value array. @param index - location in the array list @param newValue - the new String
[ "Replace", "a", "single", "value", "at", "the", "appropriate", "location", "in", "the", "existing", "value", "array", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java#L128-L138
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java
MFString.setValue
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"); } }
java
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"); } }
[ "public", "void", "setValue", "(", "int", "numStrings", ",", "String", "[", "]", "newValues", ")", "{", "value", ".", "clear", "(", ")", ";", "if", "(", "numStrings", "==", "newValues", ".", "length", ")", "{", "for", "(", "int", "i", "=", "0", ";"...
Assign a new value to this field. @param numStrings - number of strings @param newValues - the new strings
[ "Assign", "a", "new", "value", "to", "this", "field", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/data_types/MFString.java#L145-L155
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBitmapImage.java
GVRBitmapImage.update
public void update(int width, int height, byte[] grayscaleData) { NativeBitmapImage.updateFromMemory(getNative(), width, height, grayscaleData); }
java
public void update(int width, int height, byte[] grayscaleData) { NativeBitmapImage.updateFromMemory(getNative(), width, height, grayscaleData); }
[ "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. Be aware that updating a texture will affect any and all {@linkplain GVRMaterial materials} and/or post effects that use the texture! @param width width of grayscale image @param height height of grayscale image @param grayscaleData A byte array containing grayscale data @since 1.6.3
[ "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", "forwa...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBitmapImage.java#L228-L231
train
Samsung/GearVRf
GVRf/Extensions/platformsdk_support/src/main/java/org/gearvrf/PlatformEntitlementCheck.java
PlatformEntitlementCheck.start
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 != result) { throw new IllegalStateException("Could not initialize the platform sdk; error code: " + result); } context.registerDrawFrameListener(new GVRDrawFrameListener() { @Override public void onDrawFrame(float frameTime) { final int result = processEntitlementCheckResponse(); if (0 != result) { context.unregisterDrawFrameListener(this); final Runnable runnable; if (-1 == result) { runnable = new Runnable() { @Override public void run() { listener.onFailure(); } }; } else { runnable = new Runnable() { @Override public void run() { listener.onSuccess(); } }; } activity.runOnUiThread(runnable); } } }); }
java
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 != result) { throw new IllegalStateException("Could not initialize the platform sdk; error code: " + result); } context.registerDrawFrameListener(new GVRDrawFrameListener() { @Override public void onDrawFrame(float frameTime) { final int result = processEntitlementCheckResponse(); if (0 != result) { context.unregisterDrawFrameListener(this); final Runnable runnable; if (-1 == result) { runnable = new Runnable() { @Override public void run() { listener.onFailure(); } }; } else { runnable = new Runnable() { @Override public void run() { listener.onSuccess(); } }; } activity.runOnUiThread(runnable); } } }); }
[ "public", "static", "void", "start", "(", "final", "GVRContext", "context", ",", "final", "String", "appId", ",", "final", "ResultListener", "listener", ")", "{", "if", "(", "null", "==", "listener", ")", "{", "throw", "new", "IllegalArgumentException", "(", ...
Starts asynchronous check. Result will be delivered to the listener on the main thread. @param context @param appId application id from the oculus dashboard @param listener listener to invoke when the result is available @throws IllegalStateException in case the platform sdk cannot be initialized @throws IllegalArgumentException if listener is null
[ "Starts", "asynchronous", "check", ".", "Result", "will", "be", "delivered", "to", "the", "listener", "on", "the", "main", "thread", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/platformsdk_support/src/main/java/org/gearvrf/PlatformEntitlementCheck.java#L55-L93
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRFPSTracer.java
GVRFPSTracer.tick
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 { break; } } mTimestamps.add(currentTime); mStatColumn.addValue(((float)mTimestamps.size()) / BUFFER_SECONDS); }
java
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 { break; } } mTimestamps.add(currentTime); mStatColumn.addValue(((float)mTimestamps.size()) / BUFFER_SECONDS); }
[ "public", "synchronized", "void", "tick", "(", ")", "{", "long", "currentTime", "=", "GVRTime", ".", "getMilliTime", "(", ")", ";", "long", "cutoffTime", "=", "currentTime", "-", "BUFFER_SECONDS", "*", "1000", ";", "ListIterator", "<", "Long", ">", "it", "...
Should be called each frame.
[ "Should", "be", "called", "each", "frame", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRFPSTracer.java#L54-L69
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/VrAppSettings.java
VrAppSettings.addControllerType
public void addControllerType(GVRControllerType controllerType) { if (cursorControllerTypes == null) { cursorControllerTypes = new ArrayList<GVRControllerType>(); } else if (cursorControllerTypes.contains(controllerType)) { return; } cursorControllerTypes.add(controllerType); }
java
public void addControllerType(GVRControllerType controllerType) { if (cursorControllerTypes == null) { cursorControllerTypes = new ArrayList<GVRControllerType>(); } else if (cursorControllerTypes.contains(controllerType)) { return; } cursorControllerTypes.add(controllerType); }
[ "public", "void", "addControllerType", "(", "GVRControllerType", "controllerType", ")", "{", "if", "(", "cursorControllerTypes", "==", "null", ")", "{", "cursorControllerTypes", "=", "new", "ArrayList", "<", "GVRControllerType", ">", "(", ")", ";", "}", "else", ...
Enable the use of the given controller type by adding it to the cursor controller types list. @param controllerType GVRControllerType to add to the list
[ "Enable", "the", "use", "of", "the", "given", "controller", "type", "by", "adding", "it", "to", "the", "cursor", "controller", "types", "list", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/VrAppSettings.java#L627-L638
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java
Assert.checkStringNotNullOrEmpty
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"); } }
java
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"); } }
[ "public", "static", "void", "checkStringNotNullOrEmpty", "(", "String", "parameterName", ",", "String", "value", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "value", ")", ")", "{", "throw", "Exceptions", ".", "IllegalArgument", "(", "\"Current input s...
Check that the parameter string is not null or empty @param value String value to be checked. @param parameterName The name of the user-supplied parameter that we are validating so that the user can easily find the error in their code. @throws IllegalArgumentException If the key is null or empty.
[ "Check", "that", "the", "parameter", "string", "is", "not", "null", "or", "empty" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java#L65-L71
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java
Assert.checkArrayLength
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); } }
java
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); } }
[ "public", "static", "void", "checkArrayLength", "(", "String", "parameterName", ",", "int", "actualLength", ",", "int", "expectedLength", ")", "{", "if", "(", "actualLength", "!=", "expectedLength", ")", "{", "throw", "Exceptions", ".", "IllegalArgument", "(", "...
Check that the parameter array has exactly the right number of elements. @param parameterName The name of the user-supplied parameter that we are validating so that the user can easily find the error in their code. @param actualLength The actual array length @param expectedLength The expected array length
[ "Check", "that", "the", "parameter", "array", "has", "exactly", "the", "right", "number", "of", "elements", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java#L84-L91
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java
Assert.checkMinimumArrayLength
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); } }
java
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); } }
[ "public", "static", "void", "checkMinimumArrayLength", "(", "String", "parameterName", ",", "int", "actualLength", ",", "int", "minimumLength", ")", "{", "if", "(", "actualLength", "<", "minimumLength", ")", "{", "throw", "Exceptions", ".", "IllegalArgument", "(",...
Check that the parameter array has at least as many elements as it should. @param parameterName The name of the user-supplied parameter that we are validating so that the user can easily find the error in their code. @param actualLength The actual array length @param minimumLength The minimum array length
[ "Check", "that", "the", "parameter", "array", "has", "at", "least", "as", "many", "elements", "as", "it", "should", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java#L267-L275
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java
Assert.checkFloatNotNaNOrInfinity
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); } }
java
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); } }
[ "public", "static", "void", "checkFloatNotNaNOrInfinity", "(", "String", "parameterName", ",", "float", "data", ")", "{", "if", "(", "Float", ".", "isNaN", "(", "data", ")", "||", "Float", ".", "isInfinite", "(", "data", ")", ")", "{", "throw", "Exceptions...
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. @param parameterName The name of the user-supplied parameter that we are validating so that the user can easily find the error in their code. @param data A single float data. @throws IllegalArgumentException if the data includes NaN.
[ "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", ...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Assert.java#L686-L692
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.transformPose
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(); }
java
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(); }
[ "public", "void", "transformPose", "(", "Matrix4f", "trans", ")", "{", "Bone", "bone", "=", "mBones", "[", "0", "]", ";", "bone", ".", "LocalMatrix", ".", "set", "(", "trans", ")", ";", "bone", ".", "WorldMatrix", ".", "set", "(", "trans", ")", ";", ...
Transform the root bone of the pose by the given matrix. @param trans matrix to transform the pose by.
[ "Transform", "the", "root", "bone", "of", "the", "pose", "by", "the", "given", "matrix", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L690-L699
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.inverse
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; srcBone.WorldMatrix.invertAffine(dstBone.WorldMatrix); srcBone.LocalMatrix.set(dstBone.WorldMatrix); if (sDebug) { Log.d("BONE", "invert: %s %s", mSkeleton.getBoneName(0), dstBone.toString()); } for (int i = 1; i < numbones; ++i) { srcBone = src.mBones[i]; dstBone = mBones[i]; srcBone.WorldMatrix.invertAffine(dstBone.WorldMatrix); dstBone.Changed = WORLD_ROT | WORLD_POS; if (sDebug) { Log.d("BONE", "invert: %s %s", mSkeleton.getBoneName(i), dstBone.toString()); } } sync(); }
java
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; srcBone.WorldMatrix.invertAffine(dstBone.WorldMatrix); srcBone.LocalMatrix.set(dstBone.WorldMatrix); if (sDebug) { Log.d("BONE", "invert: %s %s", mSkeleton.getBoneName(0), dstBone.toString()); } for (int i = 1; i < numbones; ++i) { srcBone = src.mBones[i]; dstBone = mBones[i]; srcBone.WorldMatrix.invertAffine(dstBone.WorldMatrix); dstBone.Changed = WORLD_ROT | WORLD_POS; if (sDebug) { Log.d("BONE", "invert: %s %s", mSkeleton.getBoneName(i), dstBone.toString()); } } sync(); }
[ "public", "void", "inverse", "(", "GVRPose", "src", ")", "{", "if", "(", "getSkeleton", "(", ")", "!=", "src", ".", "getSkeleton", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "\"GVRPose.copy: input pose is incompatible with this pose\"", ")", "...
Makes this pose the inverse of the input pose. @param src pose to invert.
[ "Makes", "this", "pose", "the", "inverse", "of", "the", "input", "pose", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L799-L828
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.calcWorld
protected void calcWorld(Bone bone, int parentId) { getWorldMatrix(parentId, mTempMtxB); // WorldMatrix (parent) TempMtxB mTempMtxB.mul(bone.LocalMatrix); // WorldMatrix = WorldMatrix(parent) * LocalMatrix bone.WorldMatrix.set(mTempMtxB); }
java
protected void calcWorld(Bone bone, int parentId) { getWorldMatrix(parentId, mTempMtxB); // WorldMatrix (parent) TempMtxB mTempMtxB.mul(bone.LocalMatrix); // WorldMatrix = WorldMatrix(parent) * LocalMatrix bone.WorldMatrix.set(mTempMtxB); }
[ "protected", "void", "calcWorld", "(", "Bone", "bone", ",", "int", "parentId", ")", "{", "getWorldMatrix", "(", "parentId", ",", "mTempMtxB", ")", ";", "// WorldMatrix (parent) TempMtxB", "mTempMtxB", ".", "mul", "(", "bone", ".", "LocalMatrix", ")", ";", "// ...
Calculates the world matrix based on the local matrix.
[ "Calculates", "the", "world", "matrix", "based", "on", "the", "local", "matrix", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L946-L951
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java
GVRPose.calcLocal
protected void calcLocal(Bone bone, int parentId) { if (parentId < 0) { bone.LocalMatrix.set(bone.WorldMatrix); return; } /* * WorldMatrix = WorldMatrix(parent) * LocalMatrix * LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix */ getWorldMatrix(parentId, mTempMtxA); // WorldMatrix(par) mTempMtxA.invert(); // INVERSE[ WorldMatrix(parent) ] mTempMtxA.mul(bone.WorldMatrix, bone.LocalMatrix); // LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix }
java
protected void calcLocal(Bone bone, int parentId) { if (parentId < 0) { bone.LocalMatrix.set(bone.WorldMatrix); return; } /* * WorldMatrix = WorldMatrix(parent) * LocalMatrix * LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix */ getWorldMatrix(parentId, mTempMtxA); // WorldMatrix(par) mTempMtxA.invert(); // INVERSE[ WorldMatrix(parent) ] mTempMtxA.mul(bone.WorldMatrix, bone.LocalMatrix); // LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix }
[ "protected", "void", "calcLocal", "(", "Bone", "bone", ",", "int", "parentId", ")", "{", "if", "(", "parentId", "<", "0", ")", "{", "bone", ".", "LocalMatrix", ".", "set", "(", "bone", ".", "WorldMatrix", ")", ";", "return", ";", "}", "/*\n\t * WorldMa...
Calculates the local translation and rotation for a bone. Assumes WorldRot and WorldPos have been calculated for the bone.
[ "Calculates", "the", "local", "translation", "and", "rotation", "for", "a", "bone", ".", "Assumes", "WorldRot", "and", "WorldPos", "have", "been", "calculated", "for", "the", "bone", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRPose.java#L957-L971
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java
GVRLight.setVec3
public void setVec3(String key, float x, float y, float z) { checkKeyIsUniform(key); NativeLight.setVec3(getNative(), key, x, y, z); }
java
public void setVec3(String key, float x, float y, float z) { checkKeyIsUniform(key); NativeLight.setVec3(getNative(), key, x, y, z); }
[ "public", "void", "setVec3", "(", "String", "key", ",", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "checkKeyIsUniform", "(", "key", ")", ";", "NativeLight", ".", "setVec3", "(", "getNative", "(", ")", ",", "key", ",", "x", ",", "...
Set the value for a floating point vector of length 3. @param key name of uniform to set. @param x new X value @param y new Y value @param z new Z value @see #getVec3 @see #getFloatVec(String)
[ "Set", "the", "value", "for", "a", "floating", "point", "vector", "of", "length", "3", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java#L426-L430
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java
GVRLight.setVec4
public void setVec4(String key, float x, float y, float z, float w) { checkKeyIsUniform(key); NativeLight.setVec4(getNative(), key, x, y, z, w); }
java
public void setVec4(String key, float x, float y, float z, float w) { checkKeyIsUniform(key); NativeLight.setVec4(getNative(), key, x, y, z, w); }
[ "public", "void", "setVec4", "(", "String", "key", ",", "float", "x", ",", "float", "y", ",", "float", "z", ",", "float", "w", ")", "{", "checkKeyIsUniform", "(", "key", ")", ";", "NativeLight", ".", "setVec4", "(", "getNative", "(", ")", ",", "key",...
Set the value for a floating point vector of length 4. @param key name of uniform to set. @param x new X value @param y new Y value @param z new Z value @param w new W value @see #getVec4 @see #getFloatVec(String)
[ "Set", "the", "value", "for", "a", "floating", "point", "vector", "of", "length", "4", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java#L453-L457
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java
GVRLight.setMat4
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, w2, x3, y3, z3, w3, x4, y4, z4, w4); }
java
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, w2, x3, y3, z3, w3, x4, y4, z4, w4); }
[ "public", "void", "setMat4", "(", "String", "key", ",", "float", "x1", ",", "float", "y1", ",", "float", "z1", ",", "float", "w1", ",", "float", "x2", ",", "float", "y2", ",", "float", "z2", ",", "float", "w2", ",", "float", "x3", ",", "float", "...
Set the value for a floating point 4x4 matrix. @param key name of uniform to set. @see #getFloatVec(String)
[ "Set", "the", "value", "for", "a", "floating", "point", "4x4", "matrix", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java#L466-L473
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java
GVRLight.onDrawFrame
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().getModelMatrix4f(); mOldDir.x = odir[0]; mOldDir.y = odir[1]; mOldDir.z = odir[2]; mOldPos.x = opos[0]; mOldPos.y = opos[1]; mOldPos.z = opos[2]; mNewDir.x = 0.0f; mNewDir.y = 0.0f; mNewDir.z = -1.0f; worldmtx.getTranslation(mNewPos); worldmtx.mul(mLightRot); worldmtx.transformDirection(mNewDir); if ((mOldDir.x != mNewDir.x) || (mOldDir.y != mNewDir.y) || (mOldDir.z != mNewDir.z)) { setVec4("world_direction", mNewDir.x, mNewDir.y, mNewDir.z, 0); } if ((mOldPos.x != mNewPos.x) || (mOldPos.y != mNewPos.y) || (mOldPos.z != mNewPos.z)) { setPosition(mNewPos.x, mNewPos.y, mNewPos.z); } }
java
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().getModelMatrix4f(); mOldDir.x = odir[0]; mOldDir.y = odir[1]; mOldDir.z = odir[2]; mOldPos.x = opos[0]; mOldPos.y = opos[1]; mOldPos.z = opos[2]; mNewDir.x = 0.0f; mNewDir.y = 0.0f; mNewDir.z = -1.0f; worldmtx.getTranslation(mNewPos); worldmtx.mul(mLightRot); worldmtx.transformDirection(mNewDir); if ((mOldDir.x != mNewDir.x) || (mOldDir.y != mNewDir.y) || (mOldDir.z != mNewDir.z)) { setVec4("world_direction", mNewDir.x, mNewDir.y, mNewDir.z, 0); } if ((mOldPos.x != mNewPos.x) || (mOldPos.y != mNewPos.y) || (mOldPos.z != mNewPos.z)) { setPosition(mNewPos.x, mNewPos.y, mNewPos.z); } }
[ "public", "void", "onDrawFrame", "(", "float", "frameTime", ")", "{", "if", "(", "!", "isEnabled", "(", ")", "||", "(", "owner", "==", "null", ")", "||", "(", "getFloat", "(", "\"enabled\"", ")", "<=", "0.0f", ")", ")", "{", "return", ";", "}", "fl...
Updates the position and direction of this light from the transform of scene object that owns it.
[ "Updates", "the", "position", "and", "direction", "of", "this", "light", "from", "the", "transform", "of", "scene", "object", "that", "owns", "it", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLight.java#L573-L604
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCustomCamera.java
GVRCustomCamera.setProjectionMatrix
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, z3, w3, x4, y4, z4, w4); }
java
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, z3, w3, x4, y4, z4, w4); }
[ "public", "void", "setProjectionMatrix", "(", "float", "x1", ",", "float", "y1", ",", "float", "z1", ",", "float", "w1", ",", "float", "x2", ",", "float", "y2", ",", "float", "z2", ",", "float", "w2", ",", "float", "x3", ",", "float", "y3", ",", "f...
Set the custom projection matrix with individual matrix elements.
[ "Set", "the", "custom", "projection", "matrix", "with", "individual", "matrix", "elements", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCustomCamera.java#L27-L32
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java
AccessibilityFeature.loadCadidateString
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.string.zoom_in); zoomOut = mGvrContext.getActivity().getResources().getString(R.string.zoom_out); invertedColors = mGvrContext.getActivity().getResources().getString(R.string.inverted_colors); talkBack = mGvrContext.getActivity().getResources().getString(R.string.talk_back); disableTalkBack = mGvrContext.getActivity().getResources().getString(R.string.disable_talk_back); }
java
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.string.zoom_in); zoomOut = mGvrContext.getActivity().getResources().getString(R.string.zoom_out); invertedColors = mGvrContext.getActivity().getResources().getString(R.string.inverted_colors); talkBack = mGvrContext.getActivity().getResources().getString(R.string.talk_back); disableTalkBack = mGvrContext.getActivity().getResources().getString(R.string.disable_talk_back); }
[ "private", "void", "loadCadidateString", "(", ")", "{", "volumeUp", "=", "mGvrContext", ".", "getActivity", "(", ")", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "volume_up", ")", ";", "volumeDown", "=", "mGvrContext", "....
Load all string recognize.
[ "Load", "all", "string", "recognize", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java#L55-L63
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java
AccessibilityFeature.findMatch
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 if (volumeDown.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startVolumeDown(); break; } else if (zoomIn.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startZoomIn(); break; } else if (zoomOut.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startZoomOut(); break; } else if (invertedColors.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startInvertedColors(); break; } else if (talkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { enableTalkBack(); } else if (disableTalkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { disableTalkBack(); } } }
java
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 if (volumeDown.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startVolumeDown(); break; } else if (zoomIn.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startZoomIn(); break; } else if (zoomOut.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startZoomOut(); break; } else if (invertedColors.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { startInvertedColors(); break; } else if (talkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { enableTalkBack(); } else if (disableTalkBack.toLowerCase(localeDefault).equals(matchCandidate.toLowerCase(localeDefault))) { disableTalkBack(); } } }
[ "public", "void", "findMatch", "(", "ArrayList", "<", "String", ">", "speechResult", ")", "{", "loadCadidateString", "(", ")", ";", "for", "(", "String", "matchCandidate", ":", "speechResult", ")", "{", "Locale", "localeDefault", "=", "mGvrContext", ".", "getA...
get the result speech recognize and find match in strings file. @param speechResult
[ "get", "the", "result", "speech", "recognize", "and", "find", "match", "in", "strings", "file", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java#L70-L98
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java
AccessibilityFeature.enableTalkBack
private void enableTalkBack() { GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects(); for (GVRSceneObject sceneObject : sceneObjects) { if (sceneObject instanceof GVRAccessiblityObject) if (((GVRAccessiblityObject) sceneObject).getTalkBack() != null) ((GVRAccessiblityObject) sceneObject).getTalkBack().setActive(true); } }
java
private void enableTalkBack() { GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects(); for (GVRSceneObject sceneObject : sceneObjects) { if (sceneObject instanceof GVRAccessiblityObject) if (((GVRAccessiblityObject) sceneObject).getTalkBack() != null) ((GVRAccessiblityObject) sceneObject).getTalkBack().setActive(true); } }
[ "private", "void", "enableTalkBack", "(", ")", "{", "GVRSceneObject", "[", "]", "sceneObjects", "=", "mGvrContext", ".", "getMainScene", "(", ")", ".", "getWholeSceneObjects", "(", ")", ";", "for", "(", "GVRSceneObject", "sceneObject", ":", "sceneObjects", ")", ...
find all accessibility object and set active true for enable talk back.
[ "find", "all", "accessibility", "object", "and", "set", "active", "true", "for", "enable", "talk", "back", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java#L103-L110
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java
AccessibilityFeature.disableTalkBack
private void disableTalkBack() { GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects(); for (GVRSceneObject sceneObject : sceneObjects) { if (sceneObject instanceof GVRAccessiblityObject) if (((GVRAccessiblityObject) sceneObject).getTalkBack() != null) ((GVRAccessiblityObject) sceneObject).getTalkBack().setActive(false); } }
java
private void disableTalkBack() { GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects(); for (GVRSceneObject sceneObject : sceneObjects) { if (sceneObject instanceof GVRAccessiblityObject) if (((GVRAccessiblityObject) sceneObject).getTalkBack() != null) ((GVRAccessiblityObject) sceneObject).getTalkBack().setActive(false); } }
[ "private", "void", "disableTalkBack", "(", ")", "{", "GVRSceneObject", "[", "]", "sceneObjects", "=", "mGvrContext", ".", "getMainScene", "(", ")", ".", "getWholeSceneObjects", "(", ")", ";", "for", "(", "GVRSceneObject", "sceneObject", ":", "sceneObjects", ")",...
find all accessibility object and set active false for enable talk back.
[ "find", "all", "accessibility", "object", "and", "set", "active", "false", "for", "enable", "talk", "back", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java#L115-L123
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java
AccessibilityFeature.startInvertedColors
private void startInvertedColors() { if (managerFeatures.getInvertedColors().isInverted()) { managerFeatures.getInvertedColors().turnOff(mGvrContext.getMainScene()); } else { managerFeatures.getInvertedColors().turnOn(mGvrContext.getMainScene()); } }
java
private void startInvertedColors() { if (managerFeatures.getInvertedColors().isInverted()) { managerFeatures.getInvertedColors().turnOff(mGvrContext.getMainScene()); } else { managerFeatures.getInvertedColors().turnOn(mGvrContext.getMainScene()); } }
[ "private", "void", "startInvertedColors", "(", ")", "{", "if", "(", "managerFeatures", ".", "getInvertedColors", "(", ")", ".", "isInverted", "(", ")", ")", "{", "managerFeatures", ".", "getInvertedColors", "(", ")", ".", "turnOff", "(", "mGvrContext", ".", ...
Active inverter colors
[ "Active", "inverter", "colors" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/AccessibilityFeature.java#L158-L164
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java
JaiDebug.dumpTexCoords
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.out.print("[" + mesh.getTexCoordU(i, coords)); if (numComponents > 1) { System.out.print(", " + mesh.getTexCoordV(i, coords)); } if (numComponents > 2) { System.out.print(", " + mesh.getTexCoordW(i, coords)); } System.out.println("]"); } }
java
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.out.print("[" + mesh.getTexCoordU(i, coords)); if (numComponents > 1) { System.out.print(", " + mesh.getTexCoordV(i, coords)); } if (numComponents > 2) { System.out.print(", " + mesh.getTexCoordW(i, coords)); } System.out.println("]"); } }
[ "public", "static", "void", "dumpTexCoords", "(", "AiMesh", "mesh", ",", "int", "coords", ")", "{", "if", "(", "!", "mesh", ".", "hasTexCoords", "(", "coords", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"mesh has no texture coordinate set \"...
Dumps a texture coordinate set of a mesh to stdout. @param mesh the mesh @param coords the coordinates
[ "Dumps", "a", "texture", "coordinate", "set", "of", "a", "mesh", "to", "stdout", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L139-L159
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java
JaiDebug.dumpMaterialProperty
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 (int i = 0; i < buf.capacity(); i++) { System.out.print(Integer.toHexString(buf.get(i) & 0xFF) + " "); } System.out.println(); } else { System.out.println(data.toString()); } }
java
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 (int i = 0; i < buf.capacity(); i++) { System.out.print(Integer.toHexString(buf.get(i) & 0xFF) + " "); } System.out.println(); } else { System.out.println(data.toString()); } }
[ "public", "static", "void", "dumpMaterialProperty", "(", "AiMaterial", ".", "Property", "property", ")", "{", "System", ".", "out", ".", "print", "(", "property", ".", "getKey", "(", ")", "+", "\" \"", "+", "property", ".", "getSemantic", "(", ")", "+", ...
Dumps a single material property to stdout. @param property the property
[ "Dumps", "a", "single", "material", "property", "to", "stdout", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L167-L183
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java
JaiDebug.dumpMaterial
public static void dumpMaterial(AiMaterial material) { for (AiMaterial.Property prop : material.getProperties()) { dumpMaterialProperty(prop); } }
java
public static void dumpMaterial(AiMaterial material) { for (AiMaterial.Property prop : material.getProperties()) { dumpMaterialProperty(prop); } }
[ "public", "static", "void", "dumpMaterial", "(", "AiMaterial", "material", ")", "{", "for", "(", "AiMaterial", ".", "Property", "prop", ":", "material", ".", "getProperties", "(", ")", ")", "{", "dumpMaterialProperty", "(", "prop", ")", ";", "}", "}" ]
Dumps all properties of a material to stdout. @param material the material
[ "Dumps", "all", "properties", "of", "a", "material", "to", "stdout", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L191-L195
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java
JaiDebug.dumpNodeAnim
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)); } }
java
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)); } }
[ "public", "static", "void", "dumpNodeAnim", "(", "AiNodeAnim", "nodeAnim", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodeAnim", ".", "getNumPosKeys", "(", ")", ";", "i", "++", ")", "{", "System", ".", "out", ".", "println", "(", "...
Dumps an animation channel to stdout. @param nodeAnim the channel
[ "Dumps", "an", "animation", "channel", "to", "stdout", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L203-L208
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/util/Strings.java
Strings.joinStrings
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); } else { result.append(withChar); result.append(s); } } return result.toString(); }
java
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); } else { result.append(withChar); result.append(s); } } return result.toString(); }
[ "public", "static", "String", "joinStrings", "(", "List", "<", "String", ">", "strings", ",", "boolean", "fixCase", ",", "char", "withChar", ")", "{", "if", "(", "strings", "==", "null", "||", "strings", ".", "size", "(", ")", "==", "0", ")", "{", "r...
Generic string joining function. @param strings Strings to be joined @param fixCase does it need to fix word case @param withChar char to join strings with. @return joined-string
[ "Generic", "string", "joining", "function", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/util/Strings.java#L40-L57
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBoundsPicker.java
GVRBoundsPicker.addCollidable
public int addCollidable(GVRSceneObject sceneObj) { synchronized (mCollidables) { int index = mCollidables.indexOf(sceneObj); if (index >= 0) { return index; } mCollidables.add(sceneObj); return mCollidables.size() - 1; } }
java
public int addCollidable(GVRSceneObject sceneObj) { synchronized (mCollidables) { int index = mCollidables.indexOf(sceneObj); if (index >= 0) { return index; } mCollidables.add(sceneObj); return mCollidables.size() - 1; } }
[ "public", "int", "addCollidable", "(", "GVRSceneObject", "sceneObj", ")", "{", "synchronized", "(", "mCollidables", ")", "{", "int", "index", "=", "mCollidables", ".", "indexOf", "(", "sceneObj", ")", ";", "if", "(", "index", ">=", "0", ")", "{", "return",...
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. @param sceneObj new collidable @return index of collidable added, this is the CursorID in the GVRPickedObject
[ "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", ...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBoundsPicker.java#L113-L125
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java
GVRCameraRig.makeInstance
public static GVRCameraRig makeInstance(GVRContext gvrContext) { final GVRCameraRig result = gvrContext.getApplication().getDelegate().makeCameraRig(gvrContext); result.init(gvrContext); return result; }
java
public static GVRCameraRig makeInstance(GVRContext gvrContext) { final GVRCameraRig result = gvrContext.getApplication().getDelegate().makeCameraRig(gvrContext); result.init(gvrContext); return result; }
[ "public", "static", "GVRCameraRig", "makeInstance", "(", "GVRContext", "gvrContext", ")", "{", "final", "GVRCameraRig", "result", "=", "gvrContext", ".", "getApplication", "(", ")", ".", "getDelegate", "(", ")", ".", "makeCameraRig", "(", "gvrContext", ")", ";",...
Constructs a camera rig with cameras attached. An owner scene object is automatically created for the camera rig. Do not try to change the owner object of the camera rig - not supported currently and will lead to native crashes.
[ "Constructs", "a", "camera", "rig", "with", "cameras", "attached", ".", "An", "owner", "scene", "object", "is", "automatically", "created", "for", "the", "camera", "rig", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L76-L80
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java
GVRCameraRig.removeAllChildren
public void removeAllChildren() { for (final GVRSceneObject so : headTransformObject.getChildren()) { final boolean notCamera = (so != leftCameraObject && so != rightCameraObject && so != centerCameraObject); if (notCamera) { headTransformObject.removeChildObject(so); } } }
java
public void removeAllChildren() { for (final GVRSceneObject so : headTransformObject.getChildren()) { final boolean notCamera = (so != leftCameraObject && so != rightCameraObject && so != centerCameraObject); if (notCamera) { headTransformObject.removeChildObject(so); } } }
[ "public", "void", "removeAllChildren", "(", ")", "{", "for", "(", "final", "GVRSceneObject", "so", ":", "headTransformObject", ".", "getChildren", "(", ")", ")", "{", "final", "boolean", "notCamera", "=", "(", "so", "!=", "leftCameraObject", "&&", "so", "!="...
Remove all children that have been added to the owner object of this camera rig; except the camera objects.
[ "Remove", "all", "children", "that", "have", "been", "added", "to", "the", "owner", "object", "of", "this", "camera", "rig", ";", "except", "the", "camera", "objects", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L516-L523
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java
GVRCameraRig.setNearClippingDistance
public void setNearClippingDistance(float near) { if(leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface) { ((GVRCameraClippingDistanceInterface)leftCamera).setNearClippingDistance(near); centerCamera.setNearClippingDistance(near); ((GVRCameraClippingDistanceInterface)rightCamera).setNearClippingDistance(near); } }
java
public void setNearClippingDistance(float near) { if(leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface) { ((GVRCameraClippingDistanceInterface)leftCamera).setNearClippingDistance(near); centerCamera.setNearClippingDistance(near); ((GVRCameraClippingDistanceInterface)rightCamera).setNearClippingDistance(near); } }
[ "public", "void", "setNearClippingDistance", "(", "float", "near", ")", "{", "if", "(", "leftCamera", "instanceof", "GVRCameraClippingDistanceInterface", "&&", "centerCamera", "instanceof", "GVRCameraClippingDistanceInterface", "&&", "rightCamera", "instanceof", "GVRCameraCli...
Sets the distance from the origin to the near clipping plane for the whole camera rig. @param near Distance to the near clipping plane.
[ "Sets", "the", "distance", "from", "the", "origin", "to", "the", "near", "clipping", "plane", "for", "the", "whole", "camera", "rig", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L561-L569
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java
GVRCameraRig.setFarClippingDistance
public void setFarClippingDistance(float far) { if(leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface) { ((GVRCameraClippingDistanceInterface)leftCamera).setFarClippingDistance(far); centerCamera.setFarClippingDistance(far); ((GVRCameraClippingDistanceInterface)rightCamera).setFarClippingDistance(far); } }
java
public void setFarClippingDistance(float far) { if(leftCamera instanceof GVRCameraClippingDistanceInterface && centerCamera instanceof GVRCameraClippingDistanceInterface && rightCamera instanceof GVRCameraClippingDistanceInterface) { ((GVRCameraClippingDistanceInterface)leftCamera).setFarClippingDistance(far); centerCamera.setFarClippingDistance(far); ((GVRCameraClippingDistanceInterface)rightCamera).setFarClippingDistance(far); } }
[ "public", "void", "setFarClippingDistance", "(", "float", "far", ")", "{", "if", "(", "leftCamera", "instanceof", "GVRCameraClippingDistanceInterface", "&&", "centerCamera", "instanceof", "GVRCameraClippingDistanceInterface", "&&", "rightCamera", "instanceof", "GVRCameraClipp...
Sets the distance from the origin to the far clipping plane for the whole camera rig. @param far Distance to the far clipping plane.
[ "Sets", "the", "distance", "from", "the", "origin", "to", "the", "far", "clipping", "plane", "for", "the", "whole", "camera", "rig", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCameraRig.java#L589-L597
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java
TextFile.readTextFile
public static String readTextFile(File file) { try { return readTextFile(new FileReader(file)); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }
java
public static String readTextFile(File file) { try { return readTextFile(new FileReader(file)); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }
[ "public", "static", "String", "readTextFile", "(", "File", "file", ")", "{", "try", "{", "return", "readTextFile", "(", "new", "FileReader", "(", "file", ")", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "e", ".", "printStackTrace",...
Read a text file into a single string @param file The file to read @return The contents, or null on error.
[ "Read", "a", "text", "file", "into", "a", "single", "string" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java#L61-L68
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java
TextFile.readTextFile
public static String readTextFile(Context context, int resourceId) { InputStream inputStream = context.getResources().openRawResource( resourceId); return readTextFile(inputStream); }
java
public static String readTextFile(Context context, int resourceId) { InputStream inputStream = context.getResources().openRawResource( resourceId); return readTextFile(inputStream); }
[ "public", "static", "String", "readTextFile", "(", "Context", "context", ",", "int", "resourceId", ")", "{", "InputStream", "inputStream", "=", "context", ".", "getResources", "(", ")", ".", "openRawResource", "(", "resourceId", ")", ";", "return", "readTextFile...
Read a text file resource into a single string @param context A non-null Android Context @param resourceId An Android resource id @return The contents, or null on error.
[ "Read", "a", "text", "file", "resource", "into", "a", "single", "string" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java#L79-L83
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java
TextFile.readTextFile
public static String readTextFile(InputStream inputStream) { InputStreamReader streamReader = new InputStreamReader(inputStream); return readTextFile(streamReader); }
java
public static String readTextFile(InputStream inputStream) { InputStreamReader streamReader = new InputStreamReader(inputStream); return readTextFile(streamReader); }
[ "public", "static", "String", "readTextFile", "(", "InputStream", "inputStream", ")", "{", "InputStreamReader", "streamReader", "=", "new", "InputStreamReader", "(", "inputStream", ")", ";", "return", "readTextFile", "(", "streamReader", ")", ";", "}" ]
Read a text stream into a single string. @param inputStream Stream containing text. Will be closed on exit. @return The contents, or null on error.
[ "Read", "a", "text", "stream", "into", "a", "single", "string", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/TextFile.java#L92-L95
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java
Threads.spawn
private static Future<?> spawn(final int priority, final Runnable threadProc) { return threadPool.submit(new Runnable() { @Override public void run() { Thread current = Thread.currentThread(); int defaultPriority = current.getPriority(); try { current.setPriority(priority); /* * We yield to give the foreground process a chance to run. * This also means that the new priority takes effect RIGHT * AWAY, not after the next blocking call or quantum * timeout. */ Thread.yield(); try { threadProc.run(); } catch (Exception e) { logException(TAG, e); } } finally { current.setPriority(defaultPriority); } } }); }
java
private static Future<?> spawn(final int priority, final Runnable threadProc) { return threadPool.submit(new Runnable() { @Override public void run() { Thread current = Thread.currentThread(); int defaultPriority = current.getPriority(); try { current.setPriority(priority); /* * We yield to give the foreground process a chance to run. * This also means that the new priority takes effect RIGHT * AWAY, not after the next blocking call or quantum * timeout. */ Thread.yield(); try { threadProc.run(); } catch (Exception e) { logException(TAG, e); } } finally { current.setPriority(defaultPriority); } } }); }
[ "private", "static", "Future", "<", "?", ">", "spawn", "(", "final", "int", "priority", ",", "final", "Runnable", "threadProc", ")", "{", "return", "threadPool", ".", "submit", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "ru...
Execute a Runnable on a thread pool thread @param priority The thread priority. Be careful with this! <blockquote> <b>Note:</b> Use Thread.MIN_PRIORITY..Thread.MAX_PRIORITY (1..10), <b>not</b> the Process/Linux -20..19 range! </blockquote> @param threadProc The code to run. It doesn't matter if this code never returns - by using spawn (and, hence the thread pool) there is at least a chance that you will be reusing a thread, thus saving teardown/startup costs. @return A Future<?> that lets you wait for thread completion, if necessary
[ "Execute", "a", "Runnable", "on", "a", "thread", "pool", "thread" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java#L88-L119
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java
Threads.assertUnlocked
public static void assertUnlocked(Object object, String name) { if (RUNTIME_ASSERTIONS) { if (Thread.holdsLock(object)) { throw new RuntimeAssertion("Recursive lock of %s", name); } } }
java
public static void assertUnlocked(Object object, String name) { if (RUNTIME_ASSERTIONS) { if (Thread.holdsLock(object)) { throw new RuntimeAssertion("Recursive lock of %s", name); } } }
[ "public", "static", "void", "assertUnlocked", "(", "Object", "object", ",", "String", "name", ")", "{", "if", "(", "RUNTIME_ASSERTIONS", ")", "{", "if", "(", "Thread", ".", "holdsLock", "(", "object", ")", ")", "{", "throw", "new", "RuntimeAssertion", "(",...
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 @param object object to test for lock @param name tag associated with the lock
[ "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" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java#L703-L709
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.enableUniformSize
public void enableUniformSize(final boolean enable) { if (mUniformSize != enable) { mUniformSize = enable; if (mContainer != null) { mContainer.onLayoutChanged(this); } } }
java
public void enableUniformSize(final boolean enable) { if (mUniformSize != enable) { mUniformSize = enable; if (mContainer != null) { mContainer.onLayoutChanged(this); } } }
[ "public", "void", "enableUniformSize", "(", "final", "boolean", "enable", ")", "{", "if", "(", "mUniformSize", "!=", "enable", ")", "{", "mUniformSize", "=", "enable", ";", "if", "(", "mContainer", "!=", "null", ")", "{", "mContainer", ".", "onLayoutChanged"...
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. @param enable true to measure children using the size of the largest child, false - otherwise.
[ "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", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L91-L98
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.setDividerPadding
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()); } }
java
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()); } }
[ "public", "void", "setDividerPadding", "(", "float", "padding", ",", "final", "Axis", "axis", ")", "{", "if", "(", "axis", "==", "getOrientationAxis", "(", ")", ")", "{", "super", ".", "setDividerPadding", "(", "padding", ",", "axis", ")", ";", "}", "els...
Sets divider padding for axis. If axis does not match the orientation, it has no effect. @param padding @param axis {@link Axis}
[ "Sets", "divider", "padding", "for", "axis", ".", "If", "axis", "does", "not", "match", "the", "orientation", "it", "has", "no", "effect", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L137-L144
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.isValidLayout
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 == Orientation.HORIZONTAL); break; case FRONT: case BACK: isValid = (!isUnlimitedSize() && orientation == Orientation.STACK); break; case FILL: isValid = !isUnlimitedSize(); break; case CENTER: break; default: isValid = false; break; } if (!isValid) { Log.w(TAG, "Cannot set the gravity %s and orientation %s - " + "due to unlimited bounds or incompatibility", gravity, orientation); } return isValid; }
java
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 == Orientation.HORIZONTAL); break; case FRONT: case BACK: isValid = (!isUnlimitedSize() && orientation == Orientation.STACK); break; case FILL: isValid = !isUnlimitedSize(); break; case CENTER: break; default: isValid = false; break; } if (!isValid) { Log.w(TAG, "Cannot set the gravity %s and orientation %s - " + "due to unlimited bounds or incompatibility", gravity, orientation); } return isValid; }
[ "protected", "boolean", "isValidLayout", "(", "Gravity", "gravity", ",", "Orientation", "orientation", ")", "{", "boolean", "isValid", "=", "true", ";", "switch", "(", "gravity", ")", "{", "case", "TOP", ":", "case", "BOTTOM", ":", "isValid", "=", "(", "!"...
Check if the gravity and orientation are not in conflict one with other. @param gravity @param orientation @return true if orientation and gravity can be applied together, false - otherwise
[ "Check", "if", "the", "gravity", "and", "orientation", "are", "not", "in", "conflict", "one", "with", "other", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L278-L308
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.getLayoutOffset
protected float getLayoutOffset() { //final int offsetSign = getOffsetSign(); final float axisSize = getViewPortSize(getOrientationAxis()); float layoutOffset = - axisSize / 2; Log.d(LAYOUT, TAG, "getLayoutOffset(): dimension: %5.2f, layoutOffset: %5.2f", axisSize, layoutOffset); return layoutOffset; }
java
protected float getLayoutOffset() { //final int offsetSign = getOffsetSign(); final float axisSize = getViewPortSize(getOrientationAxis()); float layoutOffset = - axisSize / 2; Log.d(LAYOUT, TAG, "getLayoutOffset(): dimension: %5.2f, layoutOffset: %5.2f", axisSize, layoutOffset); return layoutOffset; }
[ "protected", "float", "getLayoutOffset", "(", ")", "{", "//final int offsetSign = getOffsetSign();", "final", "float", "axisSize", "=", "getViewPortSize", "(", "getOrientationAxis", "(", ")", ")", ";", "float", "layoutOffset", "=", "-", "axisSize", "/", "2", ";", ...
Calculate the layout offset
[ "Calculate", "the", "layout", "offset" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L313-L321
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.getStartingOffset
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: startingOffset = (axisSize / 2 - totalSize); break; case CENTER: startingOffset = -totalSize / 2; break; default: Log.w(TAG, "Cannot calculate starting offset: " + "gravity %s is not supported!", mGravity); break; } Log.d(LAYOUT, TAG, "getStartingOffset(): totalSize: %5.4f, dimension: %5.4f, startingOffset: %5.4f", totalSize, axisSize, startingOffset); return startingOffset; }
java
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: startingOffset = (axisSize / 2 - totalSize); break; case CENTER: startingOffset = -totalSize / 2; break; default: Log.w(TAG, "Cannot calculate starting offset: " + "gravity %s is not supported!", mGravity); break; } Log.d(LAYOUT, TAG, "getStartingOffset(): totalSize: %5.4f, dimension: %5.4f, startingOffset: %5.4f", totalSize, axisSize, startingOffset); return startingOffset; }
[ "protected", "float", "getStartingOffset", "(", "final", "float", "totalSize", ")", "{", "final", "float", "axisSize", "=", "getViewPortSize", "(", "getOrientationAxis", "(", ")", ")", ";", "float", "startingOffset", "=", "0", ";", "switch", "(", "getGravityInte...
Calculate the starting content offset based on the layout orientation and Gravity @param totalSize total size occupied by the content
[ "Calculate", "the", "starting", "content", "offset", "based", "on", "the", "layout", "orientation", "and", "Gravity" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L327-L357
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.changeDirection
@Override 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; }
java
@Override 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; }
[ "@", "Override", "protected", "boolean", "changeDirection", "(", "int", "currentIndex", ",", "int", "centerIndex", ",", "boolean", "inBounds", ")", "{", "boolean", "changed", "=", "false", ";", "if", "(", "getGravityInternal", "(", ")", "==", "Gravity", ".", ...
<<<<<< measureUntilFull helper methods
[ "<<<<<<", "measureUntilFull", "helper", "methods" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L475-L485
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.getCenterChild
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 CENTER: int i = cache.count() / 2; while (i < cache.count() && i >= 0) { id = cache.getId(i); if (cache.getStartDataOffset(id) <= 0) { if (cache.getEndDataOffset(id) >= 0) { break; } else { i++; } } else { i--; } } break; default: break; } Log.d(LAYOUT, TAG, "getCenterChild = %d ", id); return id; }
java
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 CENTER: int i = cache.count() / 2; while (i < cache.count() && i >= 0) { id = cache.getId(i); if (cache.getStartDataOffset(id) <= 0) { if (cache.getEndDataOffset(id) >= 0) { break; } else { i++; } } else { i--; } } break; default: break; } Log.d(LAYOUT, TAG, "getCenterChild = %d ", id); return id; }
[ "protected", "int", "getCenterChild", "(", "CacheDataSet", "cache", ")", "{", "if", "(", "cache", ".", "count", "(", ")", "==", "0", ")", "return", "-", "1", ";", "int", "id", "=", "cache", ".", "getId", "(", "0", ")", ";", "switch", "(", "getGravi...
>>>>>> measureUntilFull helper methods
[ ">>>>>>", "measureUntilFull", "helper", "methods" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L520-L557
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.computeOffset
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) { startDataOffset = cache.getEndDataOffset(id); if (!Float.isNaN(startDataOffset)) { endDataOffset = cache.setDataAfter(dataIndex, startDataOffset); } } } else if (pos == 0) { int id = cache.getId(pos + 1); if (id != -1) { endDataOffset = cache.getStartDataOffset(id); if (!Float.isNaN(endDataOffset)) { startDataOffset = cache.setDataBefore(dataIndex, endDataOffset); } } else { startDataOffset = getStartingOffset((cache.getTotalSizeWithPadding())); endDataOffset = cache.setDataAfter(dataIndex, startDataOffset); } } Log.d(LAYOUT, TAG, "computeOffset [%d, %d]: startDataOffset = %f endDataOffset = %f", dataIndex, pos, startDataOffset, endDataOffset); boolean inBounds = !Float.isNaN(cache.getDataOffset(dataIndex)) && endDataOffset > layoutOffset && startDataOffset < -layoutOffset; return inBounds; }
java
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) { startDataOffset = cache.getEndDataOffset(id); if (!Float.isNaN(startDataOffset)) { endDataOffset = cache.setDataAfter(dataIndex, startDataOffset); } } } else if (pos == 0) { int id = cache.getId(pos + 1); if (id != -1) { endDataOffset = cache.getStartDataOffset(id); if (!Float.isNaN(endDataOffset)) { startDataOffset = cache.setDataBefore(dataIndex, endDataOffset); } } else { startDataOffset = getStartingOffset((cache.getTotalSizeWithPadding())); endDataOffset = cache.setDataAfter(dataIndex, startDataOffset); } } Log.d(LAYOUT, TAG, "computeOffset [%d, %d]: startDataOffset = %f endDataOffset = %f", dataIndex, pos, startDataOffset, endDataOffset); boolean inBounds = !Float.isNaN(cache.getDataOffset(dataIndex)) && endDataOffset > layoutOffset && startDataOffset < -layoutOffset; return inBounds; }
[ "protected", "boolean", "computeOffset", "(", "final", "int", "dataIndex", ",", "CacheDataSet", "cache", ")", "{", "float", "layoutOffset", "=", "getLayoutOffset", "(", ")", ";", "int", "pos", "=", "cache", ".", "getPos", "(", "dataIndex", ")", ";", "float",...
Compute the offset for the item in the layout cache @return true if the item fits the container, false otherwise
[ "Compute", "the", "offset", "for", "the", "item", "in", "the", "layout", "cache" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L611-L645
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.computeOffset
protected boolean computeOffset(CacheDataSet cache) { // offset computation: update offset for all items in the cache float startDataOffset = getStartingOffset((cache.getTotalSizeWithPadding())); float layoutOffset = getLayoutOffset(); boolean inBounds = startDataOffset < -layoutOffset; for (int pos = 0; pos < cache.count(); ++pos) { int id = cache.getId(pos); if (id != -1) { float endDataOffset = cache.setDataAfter(id, startDataOffset); inBounds = inBounds && endDataOffset > layoutOffset && startDataOffset < -layoutOffset; startDataOffset = endDataOffset; Log.d(LAYOUT, TAG, "computeOffset [%d] = %f" , id, cache.getDataOffset(id)); } } return inBounds; }
java
protected boolean computeOffset(CacheDataSet cache) { // offset computation: update offset for all items in the cache float startDataOffset = getStartingOffset((cache.getTotalSizeWithPadding())); float layoutOffset = getLayoutOffset(); boolean inBounds = startDataOffset < -layoutOffset; for (int pos = 0; pos < cache.count(); ++pos) { int id = cache.getId(pos); if (id != -1) { float endDataOffset = cache.setDataAfter(id, startDataOffset); inBounds = inBounds && endDataOffset > layoutOffset && startDataOffset < -layoutOffset; startDataOffset = endDataOffset; Log.d(LAYOUT, TAG, "computeOffset [%d] = %f" , id, cache.getDataOffset(id)); } } return inBounds; }
[ "protected", "boolean", "computeOffset", "(", "CacheDataSet", "cache", ")", "{", "// offset computation: update offset for all items in the cache", "float", "startDataOffset", "=", "getStartingOffset", "(", "(", "cache", ".", "getTotalSizeWithPadding", "(", ")", ")", ")", ...
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. @return true if the item fits the container, false otherwise
[ "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", ...
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L653-L673
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java
LinearLayout.computeUniformPadding
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 uniformPadding; }
java
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 uniformPadding; }
[ "protected", "float", "computeUniformPadding", "(", "final", "CacheDataSet", "cache", ")", "{", "float", "axisSize", "=", "getViewPortSize", "(", "getOrientationAxis", "(", ")", ")", ";", "float", "totalPadding", "=", "axisSize", "-", "cache", ".", "getTotalSize",...
Compute the proportional padding for all items in the cache @param cache Cache data set @return the uniform padding amount
[ "Compute", "the", "proportional", "padding", "for", "all", "items", "in", "the", "cache" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/LinearLayout.java#L695-L701
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/Text.java
Text.getString
public String[] getString() { String[] valueDestination = new String[ string.size() ]; this.string.getValue(valueDestination); return valueDestination; }
java
public String[] getString() { String[] valueDestination = new String[ string.size() ]; this.string.getValue(valueDestination); return valueDestination; }
[ "public", "String", "[", "]", "getString", "(", ")", "{", "String", "[", "]", "valueDestination", "=", "new", "String", "[", "string", ".", "size", "(", ")", "]", ";", "this", ".", "string", ".", "getValue", "(", "valueDestination", ")", ";", "return",...
Provide array of String results from inputOutput MFString field named string. @return value of string field
[ "Provide", "array", "of", "String", "results", "from", "inputOutput", "MFString", "field", "named", "string", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/Text.java#L109-L113
train
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/Text.java
Text.setString
public void setString(String[] newValue) { if ( newValue != null ) { this.string.setValue(newValue.length, newValue); } }
java
public void setString(String[] newValue) { if ( newValue != null ) { this.string.setValue(newValue.length, newValue); } }
[ "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. @param newValue
[ "Assign", "float", "value", "within", "allowed", "range", "of", "[", "0", "infinity", ")", "to", "initializeOnly", "SFFloat", "field", "named", "spacing", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/Text.java#L146-L150
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java
GVRAnimator.findAnimation
public int findAnimation(GVRAnimation findme) { int index = 0; for (GVRAnimation anim : mAnimations) { if (anim == findme) { return index; } ++index; } return -1; }
java
public int findAnimation(GVRAnimation findme) { int index = 0; for (GVRAnimation anim : mAnimations) { if (anim == findme) { return index; } ++index; } return -1; }
[ "public", "int", "findAnimation", "(", "GVRAnimation", "findme", ")", "{", "int", "index", "=", "0", ";", "for", "(", "GVRAnimation", "anim", ":", "mAnimations", ")", "{", "if", "(", "anim", "==", "findme", ")", "{", "return", "index", ";", "}", "++", ...
Find the index of this animation if it is in this animator. @param findme {@link GVRAnimation} to find. @returns 0 based index of animation or -1 if not found @see GVRAnimator#addAnimation(GVRAnimation)
[ "Find", "the", "index", "of", "this", "animation", "if", "it", "is", "in", "this", "animator", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java#L175-L187
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java
GVRAnimator.setDuration
public void setDuration(float start, float end) { for (GVRAnimation anim : mAnimations) { anim.setDuration(start,end); } }
java
public void setDuration(float start, float end) { for (GVRAnimation anim : mAnimations) { anim.setDuration(start,end); } }
[ "public", "void", "setDuration", "(", "float", "start", ",", "float", "end", ")", "{", "for", "(", "GVRAnimation", "anim", ":", "mAnimations", ")", "{", "anim", ".", "setDuration", "(", "start", ",", "end", ")", ";", "}", "}" ]
Sets the duration for the animations in this animator. @param start the animation will start playing from the specified time @param end the animation will stop playing at the specified time @see GVRAnimation#setDuration(float, float)
[ "Sets", "the", "duration", "for", "the", "animations", "in", "this", "animator", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimator.java#L258-L264
train
Samsung/GearVRf
GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/JSAdapter.java
JSAdapter.init
public static void init(Context cx, Scriptable scope, boolean sealed) throws RhinoException { JSAdapter obj = new JSAdapter(cx.newObject(scope)); obj.setParentScope(scope); obj.setPrototype(getFunctionPrototype(scope)); obj.isPrototype = true; ScriptableObject.defineProperty(scope, "JSAdapter", obj, ScriptableObject.DONTENUM); }
java
public static void init(Context cx, Scriptable scope, boolean sealed) throws RhinoException { JSAdapter obj = new JSAdapter(cx.newObject(scope)); obj.setParentScope(scope); obj.setPrototype(getFunctionPrototype(scope)); obj.isPrototype = true; ScriptableObject.defineProperty(scope, "JSAdapter", obj, ScriptableObject.DONTENUM); }
[ "public", "static", "void", "init", "(", "Context", "cx", ",", "Scriptable", "scope", ",", "boolean", "sealed", ")", "throws", "RhinoException", "{", "JSAdapter", "obj", "=", "new", "JSAdapter", "(", "cx", ".", "newObject", "(", "scope", ")", ")", ";", "...
initializer to setup JSAdapter prototype in the given scope
[ "initializer", "to", "setup", "JSAdapter", "prototype", "in", "the", "given", "scope" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/JSAdapter.java#L78-L86
train
Samsung/GearVRf
GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/JSAdapter.java
JSAdapter.mapToId
private Object mapToId(Object tmp) { if (tmp instanceof Double) { return new Integer(((Double)tmp).intValue()); } else { return Context.toString(tmp); } }
java
private Object mapToId(Object tmp) { if (tmp instanceof Double) { return new Integer(((Double)tmp).intValue()); } else { return Context.toString(tmp); } }
[ "private", "Object", "mapToId", "(", "Object", "tmp", ")", "{", "if", "(", "tmp", "instanceof", "Double", ")", "{", "return", "new", "Integer", "(", "(", "(", "Double", ")", "tmp", ")", ".", "intValue", "(", ")", ")", ";", "}", "else", "{", "return...
map a property id. Property id can only be an Integer or String
[ "map", "a", "property", "id", ".", "Property", "id", "can", "only", "be", "an", "Integer", "or", "String" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/script/src/main/java/org/gearvrf/script/javascript/JSAdapter.java#L299-L305
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/adapter/ListDataSet.java
ListDataSet.setList
public void setList(List<T> list) { if (list != mList) { mList = list; if (mList == null) { notifyInvalidated(); } else { notifyChanged(); } } }
java
public void setList(List<T> list) { if (list != mList) { mList = list; if (mList == null) { notifyInvalidated(); } else { notifyChanged(); } } }
[ "public", "void", "setList", "(", "List", "<", "T", ">", "list", ")", "{", "if", "(", "list", "!=", "mList", ")", "{", "mList", "=", "list", ";", "if", "(", "mList", "==", "null", ")", "{", "notifyInvalidated", "(", ")", ";", "}", "else", "{", ...
Set new list data set @param list new data set
[ "Set", "new", "list", "data", "set" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/adapter/ListDataSet.java#L46-L55
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRCompressedTextureLoader.java
GVRCompressedTextureLoader.register
public void register() { synchronized (loaders) { loaders.add(this); maximumHeaderLength = 0; for (GVRCompressedTextureLoader loader : loaders) { int headerLength = loader.headerLength(); if (headerLength > maximumHeaderLength) { maximumHeaderLength = headerLength; } } } }
java
public void register() { synchronized (loaders) { loaders.add(this); maximumHeaderLength = 0; for (GVRCompressedTextureLoader loader : loaders) { int headerLength = loader.headerLength(); if (headerLength > maximumHeaderLength) { maximumHeaderLength = headerLength; } } } }
[ "public", "void", "register", "(", ")", "{", "synchronized", "(", "loaders", ")", "{", "loaders", ".", "add", "(", "this", ")", ";", "maximumHeaderLength", "=", "0", ";", "for", "(", "GVRCompressedTextureLoader", "loader", ":", "loaders", ")", "{", "int", ...
Register a loader with the 'sniffer'. 'Factory loaders' are pre-registered. To load a format we don't support, create a {@link GVRCompressedTextureLoader} descendant. Then, before trying to load any files in that format, create an instance and call {@link #register()}: <pre> new MyCompressedFormat().register(); </pre>
[ "Register", "a", "loader", "with", "the", "sniffer", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRCompressedTextureLoader.java#L182-L194
train
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/WidgetFactory.java
WidgetFactory.loadModel
public static GVRSceneObject loadModel(final GVRContext gvrContext, final String modelFile) throws IOException { return loadModel(gvrContext, modelFile, new HashMap<String, Integer>()); }
java
public static GVRSceneObject loadModel(final GVRContext gvrContext, final String modelFile) throws IOException { return loadModel(gvrContext, modelFile, new HashMap<String, Integer>()); }
[ "public", "static", "GVRSceneObject", "loadModel", "(", "final", "GVRContext", "gvrContext", ",", "final", "String", "modelFile", ")", "throws", "IOException", "{", "return", "loadModel", "(", "gvrContext", ",", "modelFile", ",", "new", "HashMap", "<", "String", ...
Load model from file @param gvrContext Valid {@link GVRContext} instance @param modelFile Path to the model's file, relative to the {@code assets} directory @return root object The root {@link GVRSceneObject} of the model @throws IOException If reading the model file fails
[ "Load", "model", "from", "file" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/WidgetFactory.java#L254-L257
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java
AiMesh.getFaceNumIndices
public int getFaceNumIndices(int face) { if (null == m_faceOffsets) { if (face >= m_numFaces || face < 0) { throw new IndexOutOfBoundsException("Index: " + face + ", Size: " + m_numFaces); } return 3; } else { /* * no need to perform bound checks here as the array access will * throw IndexOutOfBoundsExceptions if the index is invalid */ if (face == m_numFaces - 1) { return m_faces.capacity() / 4 - m_faceOffsets.getInt(face * 4); } return m_faceOffsets.getInt((face + 1) * 4) - m_faceOffsets.getInt(face * 4); } }
java
public int getFaceNumIndices(int face) { if (null == m_faceOffsets) { if (face >= m_numFaces || face < 0) { throw new IndexOutOfBoundsException("Index: " + face + ", Size: " + m_numFaces); } return 3; } else { /* * no need to perform bound checks here as the array access will * throw IndexOutOfBoundsExceptions if the index is invalid */ if (face == m_numFaces - 1) { return m_faces.capacity() / 4 - m_faceOffsets.getInt(face * 4); } return m_faceOffsets.getInt((face + 1) * 4) - m_faceOffsets.getInt(face * 4); } }
[ "public", "int", "getFaceNumIndices", "(", "int", "face", ")", "{", "if", "(", "null", "==", "m_faceOffsets", ")", "{", "if", "(", "face", ">=", "m_numFaces", "||", "face", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"Index: \""...
Returns the number of vertex indices for a single face. @param face the face @return the number of indices
[ "Returns", "the", "number", "of", "vertex", "indices", "for", "a", "single", "face", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L346-L367
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java
AiMesh.getPositionX
public float getPositionX(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat(vertex * 3 * SIZEOF_FLOAT); }
java
public float getPositionX(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat(vertex * 3 * SIZEOF_FLOAT); }
[ "public", "float", "getPositionX", "(", "int", "vertex", ")", "{", "if", "(", "!", "hasPositions", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"mesh has no positions\"", ")", ";", "}", "checkVertexIndexBounds", "(", "vertex", ")", ";", ...
Returns the x-coordinate of a vertex position. @param vertex the vertex index @return the x coordinate
[ "Returns", "the", "x", "-", "coordinate", "of", "a", "vertex", "position", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L628-L636
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java
AiMesh.getPositionY
public float getPositionY(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); }
java
public float getPositionY(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT); }
[ "public", "float", "getPositionY", "(", "int", "vertex", ")", "{", "if", "(", "!", "hasPositions", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"mesh has no positions\"", ")", ";", "}", "checkVertexIndexBounds", "(", "vertex", ")", ";", ...
Returns the y-coordinate of a vertex position. @param vertex the vertex index @return the y coordinate
[ "Returns", "the", "y", "-", "coordinate", "of", "a", "vertex", "position", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L645-L653
train
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java
AiMesh.getPositionZ
public float getPositionZ(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); }
java
public float getPositionZ(int vertex) { if (!hasPositions()) { throw new IllegalStateException("mesh has no positions"); } checkVertexIndexBounds(vertex); return m_vertices.getFloat((vertex * 3 + 2) * SIZEOF_FLOAT); }
[ "public", "float", "getPositionZ", "(", "int", "vertex", ")", "{", "if", "(", "!", "hasPositions", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"mesh has no positions\"", ")", ";", "}", "checkVertexIndexBounds", "(", "vertex", ")", ";", ...
Returns the z-coordinate of a vertex position. @param vertex the vertex index @return the z coordinate
[ "Returns", "the", "z", "-", "coordinate", "of", "a", "vertex", "position", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMesh.java#L661-L669
train