id
int32
0
165k
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
161,600
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java
GVRBone.getName
public String getName() { GVRSceneObject owner = getOwnerObject(); String name = ""; if (owner != null) { name = owner.getName(); if (name == null) return ""; } return name; }
java
public String getName() { GVRSceneObject owner = getOwnerObject(); String name = ""; if (owner != null) { name = owner.getName(); if (name == null) return ""; } return name; }
[ "public", "String", "getName", "(", ")", "{", "GVRSceneObject", "owner", "=", "getOwnerObject", "(", ")", ";", "String", "name", "=", "\"\"", ";", "if", "(", "owner", "!=", "null", ")", "{", "name", "=", "owner", ".", "getName", "(", ")", ";", "if", "(", "name", "==", "null", ")", "return", "\"\"", ";", "}", "return", "name", ";", "}" ]
Returns the name of the bone. @return the name
[ "Returns", "the", "name", "of", "the", "bone", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java#L61-L73
161,601
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java
GVRBone.setFinalTransformMatrix
public void setFinalTransformMatrix(Matrix4f finalTransform) { float[] mat = new float[16]; finalTransform.get(mat); NativeBone.setFinalTransformMatrix(getNative(), mat); }
java
public void setFinalTransformMatrix(Matrix4f finalTransform) { float[] mat = new float[16]; finalTransform.get(mat); NativeBone.setFinalTransformMatrix(getNative(), mat); }
[ "public", "void", "setFinalTransformMatrix", "(", "Matrix4f", "finalTransform", ")", "{", "float", "[", "]", "mat", "=", "new", "float", "[", "16", "]", ";", "finalTransform", ".", "get", "(", "mat", ")", ";", "NativeBone", ".", "setFinalTransformMatrix", "(", "getNative", "(", ")", ",", "mat", ")", ";", "}" ]
Sets the final transform of the bone during animation. @param finalTransform The transform matrix representing the bone's pose after computing the skeleton.
[ "Sets", "the", "final", "transform", "of", "the", "bone", "during", "animation", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java#L97-L102
161,602
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java
GVRBone.getFinalTransformMatrix
public Matrix4f getFinalTransformMatrix() { final FloatBuffer fb = ByteBuffer.allocateDirect(4*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); NativeBone.getFinalTransformMatrix(getNative(), fb); return new Matrix4f(fb); }
java
public Matrix4f getFinalTransformMatrix() { final FloatBuffer fb = ByteBuffer.allocateDirect(4*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); NativeBone.getFinalTransformMatrix(getNative(), fb); return new Matrix4f(fb); }
[ "public", "Matrix4f", "getFinalTransformMatrix", "(", ")", "{", "final", "FloatBuffer", "fb", "=", "ByteBuffer", ".", "allocateDirect", "(", "4", "*", "4", "*", "4", ")", ".", "order", "(", "ByteOrder", ".", "nativeOrder", "(", ")", ")", ".", "asFloatBuffer", "(", ")", ";", "NativeBone", ".", "getFinalTransformMatrix", "(", "getNative", "(", ")", ",", "fb", ")", ";", "return", "new", "Matrix4f", "(", "fb", ")", ";", "}" ]
Gets the final transform of the bone. @return the 4x4 matrix representing the final transform of the bone during animation, which comprises bind pose and skeletal transform at the current time of the animation.
[ "Gets", "the", "final", "transform", "of", "the", "bone", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java#L111-L116
161,603
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java
GVRBone.prettyPrint
@Override public void prettyPrint(StringBuffer sb, int indent) { sb.append(Log.getSpaces(indent)); sb.append(GVRBone.class.getSimpleName()); sb.append(" [name=" + getName() + ", boneId=" + getBoneId() + ", offsetMatrix=" + getOffsetMatrix() + ", finalTransformMatrix=" + getFinalTransformMatrix() // crashes debugger + "]"); sb.append(System.lineSeparator()); }
java
@Override public void prettyPrint(StringBuffer sb, int indent) { sb.append(Log.getSpaces(indent)); sb.append(GVRBone.class.getSimpleName()); sb.append(" [name=" + getName() + ", boneId=" + getBoneId() + ", offsetMatrix=" + getOffsetMatrix() + ", finalTransformMatrix=" + getFinalTransformMatrix() // crashes debugger + "]"); sb.append(System.lineSeparator()); }
[ "@", "Override", "public", "void", "prettyPrint", "(", "StringBuffer", "sb", ",", "int", "indent", ")", "{", "sb", ".", "append", "(", "Log", ".", "getSpaces", "(", "indent", ")", ")", ";", "sb", ".", "append", "(", "GVRBone", ".", "class", ".", "getSimpleName", "(", ")", ")", ";", "sb", ".", "append", "(", "\" [name=\"", "+", "getName", "(", ")", "+", "\", boneId=\"", "+", "getBoneId", "(", ")", "+", "\", offsetMatrix=\"", "+", "getOffsetMatrix", "(", ")", "+", "\", finalTransformMatrix=\"", "+", "getFinalTransformMatrix", "(", ")", "// crashes debugger", "+", "\"]\"", ")", ";", "sb", ".", "append", "(", "System", ".", "lineSeparator", "(", ")", ")", ";", "}" ]
Pretty-print the object.
[ "Pretty", "-", "print", "the", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBone.java#L149-L159
161,604
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureCapturer.java
GVRTextureCapturer.update
public void update(int width, int height, int sampleCount) { if (capturing) { throw new IllegalStateException("Cannot update backing texture while capturing"); } this.width = width; this.height = height; if (sampleCount == 0) captureTexture = new GVRRenderTexture(getGVRContext(), width, height); else captureTexture = new GVRRenderTexture(getGVRContext(), width, height, sampleCount); setRenderTexture(captureTexture); readBackBuffer = new int[width * height]; }
java
public void update(int width, int height, int sampleCount) { if (capturing) { throw new IllegalStateException("Cannot update backing texture while capturing"); } this.width = width; this.height = height; if (sampleCount == 0) captureTexture = new GVRRenderTexture(getGVRContext(), width, height); else captureTexture = new GVRRenderTexture(getGVRContext(), width, height, sampleCount); setRenderTexture(captureTexture); readBackBuffer = new int[width * height]; }
[ "public", "void", "update", "(", "int", "width", ",", "int", "height", ",", "int", "sampleCount", ")", "{", "if", "(", "capturing", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot update backing texture while capturing\"", ")", ";", "}", "this", ".", "width", "=", "width", ";", "this", ".", "height", "=", "height", ";", "if", "(", "sampleCount", "==", "0", ")", "captureTexture", "=", "new", "GVRRenderTexture", "(", "getGVRContext", "(", ")", ",", "width", ",", "height", ")", ";", "else", "captureTexture", "=", "new", "GVRRenderTexture", "(", "getGVRContext", "(", ")", ",", "width", ",", "height", ",", "sampleCount", ")", ";", "setRenderTexture", "(", "captureTexture", ")", ";", "readBackBuffer", "=", "new", "int", "[", "width", "*", "height", "]", ";", "}" ]
Updates the backing render texture. This method should not be called when capturing is in progress. @param width The width of the backing texture in pixels. @param height The height of the backing texture in pixels. @param sampleCount The MSAA sample count.
[ "Updates", "the", "backing", "render", "texture", ".", "This", "method", "should", "not", "be", "called", "when", "capturing", "is", "in", "progress", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureCapturer.java#L95-L110
161,605
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureCapturer.java
GVRTextureCapturer.setCapture
public void setCapture(boolean capture, float fps) { capturing = capture; NativeTextureCapturer.setCapture(getNative(), capture, fps); }
java
public void setCapture(boolean capture, float fps) { capturing = capture; NativeTextureCapturer.setCapture(getNative(), capture, fps); }
[ "public", "void", "setCapture", "(", "boolean", "capture", ",", "float", "fps", ")", "{", "capturing", "=", "capture", ";", "NativeTextureCapturer", ".", "setCapture", "(", "getNative", "(", ")", ",", "capture", ",", "fps", ")", ";", "}" ]
Starts or stops capturing. @param capture If true, capturing is started. If false, it is stopped. @param fps Capturing FPS (frames per second).
[ "Starts", "or", "stops", "capturing", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTextureCapturer.java#L122-L125
161,606
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderTarget.java
GVRRenderTarget.setTexture
public void setTexture(GVRRenderTexture texture) { mTexture = texture; NativeRenderTarget.setTexture(getNative(), texture.getNative()); }
java
public void setTexture(GVRRenderTexture texture) { mTexture = texture; NativeRenderTarget.setTexture(getNative(), texture.getNative()); }
[ "public", "void", "setTexture", "(", "GVRRenderTexture", "texture", ")", "{", "mTexture", "=", "texture", ";", "NativeRenderTarget", ".", "setTexture", "(", "getNative", "(", ")", ",", "texture", ".", "getNative", "(", ")", ")", ";", "}" ]
Sets the texture this render target will render to. If no texture is provided, the render target will not render anything. @param texture GVRRenderTexture to render to.
[ "Sets", "the", "texture", "this", "render", "target", "will", "render", "to", ".", "If", "no", "texture", "is", "provided", "the", "render", "target", "will", "not", "render", "anything", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderTarget.java#L123-L127
161,607
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.addOnCheckChangedListener
public <T extends Widget & Checkable> boolean addOnCheckChangedListener (OnCheckChangedListener listener) { final boolean added; synchronized (mListeners) { added = mListeners.add(listener); } if (added) { List<T> c = getCheckableChildren(); for (int i = 0; i < c.size(); ++i) { listener.onCheckChanged(this, c.get(i), i); } } return added; }
java
public <T extends Widget & Checkable> boolean addOnCheckChangedListener (OnCheckChangedListener listener) { final boolean added; synchronized (mListeners) { added = mListeners.add(listener); } if (added) { List<T> c = getCheckableChildren(); for (int i = 0; i < c.size(); ++i) { listener.onCheckChanged(this, c.get(i), i); } } return added; }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "boolean", "addOnCheckChangedListener", "(", "OnCheckChangedListener", "listener", ")", "{", "final", "boolean", "added", ";", "synchronized", "(", "mListeners", ")", "{", "added", "=", "mListeners", ".", "add", "(", "listener", ")", ";", "}", "if", "(", "added", ")", "{", "List", "<", "T", ">", "c", "=", "getCheckableChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "c", ".", "size", "(", ")", ";", "++", "i", ")", "{", "listener", ".", "onCheckChanged", "(", "this", ",", "c", ".", "get", "(", "i", ")", ",", "i", ")", ";", "}", "}", "return", "added", ";", "}" ]
Add a listener to be invoked when the checked button changes in this group. @param listener @param <T> @return
[ "Add", "a", "listener", "to", "be", "invoked", "when", "the", "checked", "button", "changes", "in", "this", "group", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L135-L148
161,608
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.check
public <T extends Widget & Checkable> boolean check(int checkableIndex) { List<T> children = getCheckableChildren(); T checkableWidget = children.get(checkableIndex); return checkInternal(checkableWidget, true); }
java
public <T extends Widget & Checkable> boolean check(int checkableIndex) { List<T> children = getCheckableChildren(); T checkableWidget = children.get(checkableIndex); return checkInternal(checkableWidget, true); }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "boolean", "check", "(", "int", "checkableIndex", ")", "{", "List", "<", "T", ">", "children", "=", "getCheckableChildren", "(", ")", ";", "T", "checkableWidget", "=", "children", ".", "get", "(", "checkableIndex", ")", ";", "return", "checkInternal", "(", "checkableWidget", ",", "true", ")", ";", "}" ]
Checks the widget by index @param checkableIndex The index is in the range from 0 to size -1, where size is the number of Checkable widgets in the group. It does not take into account any non-Checkable widgets added to the group widget. @return {@code True} if {@code checkableWidget} is a child of this {@code CheckableGroup} and was not already checked; {@code false} otherwise.
[ "Checks", "the", "widget", "by", "index" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L186-L190
161,609
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.uncheck
public <T extends Widget & Checkable> boolean uncheck(int checkableIndex) { List<T> children = getCheckableChildren(); T checkableWidget = children.get(checkableIndex); return checkInternal(checkableWidget, false); }
java
public <T extends Widget & Checkable> boolean uncheck(int checkableIndex) { List<T> children = getCheckableChildren(); T checkableWidget = children.get(checkableIndex); return checkInternal(checkableWidget, false); }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "boolean", "uncheck", "(", "int", "checkableIndex", ")", "{", "List", "<", "T", ">", "children", "=", "getCheckableChildren", "(", ")", ";", "T", "checkableWidget", "=", "children", ".", "get", "(", "checkableIndex", ")", ";", "return", "checkInternal", "(", "checkableWidget", ",", "false", ")", ";", "}" ]
Unchecks the widget by index @param checkableIndex The index is in the range from 0 to size -1, where size is the number of Checkable widgets in the group. It does not take into account any non-Checkable widgets added to the group widget. @return {@code True} if {@code checkableWidget} is a child of this {@code CheckableGroup} and was not already unchecked; {@code false} otherwise.
[ "Unchecks", "the", "widget", "by", "index" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L216-L220
161,610
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.clearChecks
public <T extends Widget & Checkable> void clearChecks() { List<T> children = getCheckableChildren(); for (T c : children) { c.setChecked(false); } }
java
public <T extends Widget & Checkable> void clearChecks() { List<T> children = getCheckableChildren(); for (T c : children) { c.setChecked(false); } }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "void", "clearChecks", "(", ")", "{", "List", "<", "T", ">", "children", "=", "getCheckableChildren", "(", ")", ";", "for", "(", "T", "c", ":", "children", ")", "{", "c", ".", "setChecked", "(", "false", ")", ";", "}", "}" ]
Clears all checked widgets in the group
[ "Clears", "all", "checked", "widgets", "in", "the", "group" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L225-L230
161,611
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.getCheckedWidgets
public <T extends Widget & Checkable> List<T> getCheckedWidgets() { List<T> checked = new ArrayList<>(); for (Widget c : getChildren()) { if (c instanceof Checkable && ((Checkable) c).isChecked()) { checked.add((T) c); } } return checked; }
java
public <T extends Widget & Checkable> List<T> getCheckedWidgets() { List<T> checked = new ArrayList<>(); for (Widget c : getChildren()) { if (c instanceof Checkable && ((Checkable) c).isChecked()) { checked.add((T) c); } } return checked; }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "List", "<", "T", ">", "getCheckedWidgets", "(", ")", "{", "List", "<", "T", ">", "checked", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Widget", "c", ":", "getChildren", "(", ")", ")", "{", "if", "(", "c", "instanceof", "Checkable", "&&", "(", "(", "Checkable", ")", "c", ")", ".", "isChecked", "(", ")", ")", "{", "checked", ".", "add", "(", "(", "T", ")", "c", ")", ";", "}", "}", "return", "checked", ";", "}" ]
Gets all checked widgets in the group @return list of checked widgets
[ "Gets", "all", "checked", "widgets", "in", "the", "group" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L236-L246
161,612
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.getCheckedWidgetIndexes
public <T extends Widget & Checkable> List<Integer> getCheckedWidgetIndexes() { List<Integer> checked = new ArrayList<>(); List<Widget> children = getChildren(); final int size = children.size(); for (int i = 0, j = -1; i < size; ++i) { Widget c = children.get(i); if (c instanceof Checkable) { ++j; if (((Checkable) c).isChecked()) { checked.add(j); } } } return checked; }
java
public <T extends Widget & Checkable> List<Integer> getCheckedWidgetIndexes() { List<Integer> checked = new ArrayList<>(); List<Widget> children = getChildren(); final int size = children.size(); for (int i = 0, j = -1; i < size; ++i) { Widget c = children.get(i); if (c instanceof Checkable) { ++j; if (((Checkable) c).isChecked()) { checked.add(j); } } } return checked; }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "List", "<", "Integer", ">", "getCheckedWidgetIndexes", "(", ")", "{", "List", "<", "Integer", ">", "checked", "=", "new", "ArrayList", "<>", "(", ")", ";", "List", "<", "Widget", ">", "children", "=", "getChildren", "(", ")", ";", "final", "int", "size", "=", "children", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "j", "=", "-", "1", ";", "i", "<", "size", ";", "++", "i", ")", "{", "Widget", "c", "=", "children", ".", "get", "(", "i", ")", ";", "if", "(", "c", "instanceof", "Checkable", ")", "{", "++", "j", ";", "if", "(", "(", "(", "Checkable", ")", "c", ")", ".", "isChecked", "(", ")", ")", "{", "checked", ".", "add", "(", "j", ")", ";", "}", "}", "}", "return", "checked", ";", "}" ]
Gets all checked widget indexes in the group. The indexes are counted from 0 to size -1, where size is the number of Checkable widgets in the group. It does not take into account any non-Checkable widgets added to the group widget. @return list of checked widget indexes
[ "Gets", "all", "checked", "widget", "indexes", "in", "the", "group", ".", "The", "indexes", "are", "counted", "from", "0", "to", "size", "-", "1", "where", "size", "is", "the", "number", "of", "Checkable", "widgets", "in", "the", "group", ".", "It", "does", "not", "take", "into", "account", "any", "non", "-", "Checkable", "widgets", "added", "to", "the", "group", "widget", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L255-L271
161,613
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java
CheckableGroup.getCheckableChildren
public <T extends Widget & Checkable> List<T> getCheckableChildren() { List<Widget> children = getChildren(); ArrayList<T> result = new ArrayList<>(); for (Widget c : children) { if (c instanceof Checkable) { result.add((T) c); } } return result; }
java
public <T extends Widget & Checkable> List<T> getCheckableChildren() { List<Widget> children = getChildren(); ArrayList<T> result = new ArrayList<>(); for (Widget c : children) { if (c instanceof Checkable) { result.add((T) c); } } return result; }
[ "public", "<", "T", "extends", "Widget", "&", "Checkable", ">", "List", "<", "T", ">", "getCheckableChildren", "(", ")", "{", "List", "<", "Widget", ">", "children", "=", "getChildren", "(", ")", ";", "ArrayList", "<", "T", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Widget", "c", ":", "children", ")", "{", "if", "(", "c", "instanceof", "Checkable", ")", "{", "result", ".", "add", "(", "(", "T", ")", "c", ")", ";", "}", "}", "return", "result", ";", "}" ]
Gets all Checkable widgets in the group @return list of Checkable widgets
[ "Gets", "all", "Checkable", "widgets", "in", "the", "group" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L277-L286
161,614
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRCameraSceneObject.java
GVRCameraSceneObject.setUpCameraForVrMode
public boolean setUpCameraForVrMode(final int fpsMode) { cameraSetUpStatus = false; this.fpsMode = fpsMode; if (!isCameraOpen) { Log.e(TAG, "Camera is not open"); return false; } if (fpsMode < 0 || fpsMode > 2) { Log.e(TAG, "Invalid fpsMode: %d. It can only take values 0, 1, or 2.", fpsMode); } else { Parameters params = camera.getParameters(); // check if the device supports vr mode preview if ("true".equalsIgnoreCase(params.get("vrmode-supported"))) { Log.v(TAG, "VR Mode supported!"); // set vr mode params.set("vrmode", 1); // true if the apps intend to record videos using // MediaRecorder params.setRecordingHint(true); // set preview size // params.setPreviewSize(640, 480); // set fast-fps-mode: 0 for 30fps, 1 for 60 fps, // 2 for 120 fps params.set("fast-fps-mode", fpsMode); switch (fpsMode) { case 0: // 30 fps params.setPreviewFpsRange(30000, 30000); break; case 1: // 60 fps params.setPreviewFpsRange(60000, 60000); break; case 2: // 120 fps params.setPreviewFpsRange(120000, 120000); break; default: } // for auto focus params.set("focus-mode", "continuous-video"); params.setVideoStabilization(false); if ("true".equalsIgnoreCase(params.get("ois-supported"))) { params.set("ois", "center"); } camera.setParameters(params); cameraSetUpStatus = true; } } return cameraSetUpStatus; }
java
public boolean setUpCameraForVrMode(final int fpsMode) { cameraSetUpStatus = false; this.fpsMode = fpsMode; if (!isCameraOpen) { Log.e(TAG, "Camera is not open"); return false; } if (fpsMode < 0 || fpsMode > 2) { Log.e(TAG, "Invalid fpsMode: %d. It can only take values 0, 1, or 2.", fpsMode); } else { Parameters params = camera.getParameters(); // check if the device supports vr mode preview if ("true".equalsIgnoreCase(params.get("vrmode-supported"))) { Log.v(TAG, "VR Mode supported!"); // set vr mode params.set("vrmode", 1); // true if the apps intend to record videos using // MediaRecorder params.setRecordingHint(true); // set preview size // params.setPreviewSize(640, 480); // set fast-fps-mode: 0 for 30fps, 1 for 60 fps, // 2 for 120 fps params.set("fast-fps-mode", fpsMode); switch (fpsMode) { case 0: // 30 fps params.setPreviewFpsRange(30000, 30000); break; case 1: // 60 fps params.setPreviewFpsRange(60000, 60000); break; case 2: // 120 fps params.setPreviewFpsRange(120000, 120000); break; default: } // for auto focus params.set("focus-mode", "continuous-video"); params.setVideoStabilization(false); if ("true".equalsIgnoreCase(params.get("ois-supported"))) { params.set("ois", "center"); } camera.setParameters(params); cameraSetUpStatus = true; } } return cameraSetUpStatus; }
[ "public", "boolean", "setUpCameraForVrMode", "(", "final", "int", "fpsMode", ")", "{", "cameraSetUpStatus", "=", "false", ";", "this", ".", "fpsMode", "=", "fpsMode", ";", "if", "(", "!", "isCameraOpen", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"Camera is not open\"", ")", ";", "return", "false", ";", "}", "if", "(", "fpsMode", "<", "0", "||", "fpsMode", ">", "2", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"Invalid fpsMode: %d. It can only take values 0, 1, or 2.\"", ",", "fpsMode", ")", ";", "}", "else", "{", "Parameters", "params", "=", "camera", ".", "getParameters", "(", ")", ";", "// check if the device supports vr mode preview", "if", "(", "\"true\"", ".", "equalsIgnoreCase", "(", "params", ".", "get", "(", "\"vrmode-supported\"", ")", ")", ")", "{", "Log", ".", "v", "(", "TAG", ",", "\"VR Mode supported!\"", ")", ";", "// set vr mode", "params", ".", "set", "(", "\"vrmode\"", ",", "1", ")", ";", "// true if the apps intend to record videos using", "// MediaRecorder", "params", ".", "setRecordingHint", "(", "true", ")", ";", "// set preview size", "// params.setPreviewSize(640, 480);", "// set fast-fps-mode: 0 for 30fps, 1 for 60 fps,", "// 2 for 120 fps", "params", ".", "set", "(", "\"fast-fps-mode\"", ",", "fpsMode", ")", ";", "switch", "(", "fpsMode", ")", "{", "case", "0", ":", "// 30 fps", "params", ".", "setPreviewFpsRange", "(", "30000", ",", "30000", ")", ";", "break", ";", "case", "1", ":", "// 60 fps", "params", ".", "setPreviewFpsRange", "(", "60000", ",", "60000", ")", ";", "break", ";", "case", "2", ":", "// 120 fps", "params", ".", "setPreviewFpsRange", "(", "120000", ",", "120000", ")", ";", "break", ";", "default", ":", "}", "// for auto focus", "params", ".", "set", "(", "\"focus-mode\"", ",", "\"continuous-video\"", ")", ";", "params", ".", "setVideoStabilization", "(", "false", ")", ";", "if", "(", "\"true\"", ".", "equalsIgnoreCase", "(", "params", ".", "get", "(", "\"ois-supported\"", ")", ")", ")", "{", "params", ".", "set", "(", "\"ois\"", ",", "\"center\"", ")", ";", "}", "camera", ".", "setParameters", "(", "params", ")", ";", "cameraSetUpStatus", "=", "true", ";", "}", "}", "return", "cameraSetUpStatus", ";", "}" ]
Configure high fps settings in the camera for VR mode @param fpsMode integer indicating the desired fps: 0 means 30 fps, 1 means 60 fps, and 2 means 120 fps. Any other value is invalid. @return A boolean indicating the status of the method call. It may be false due to multiple reasons including: 1) supplying invalid fpsMode as the input parameter, 2) VR mode not supported.
[ "Configure", "high", "fps", "settings", "in", "the", "camera", "for", "VR", "mode" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRCameraSceneObject.java#L287-L348
161,615
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java
GVRShadowMap.makeOrthoShadowCamera
static GVROrthogonalCamera makeOrthoShadowCamera(GVRPerspectiveCamera centerCam) { GVROrthogonalCamera shadowCam = new GVROrthogonalCamera(centerCam.getGVRContext()); float near = centerCam.getNearClippingDistance(); float far = centerCam.getFarClippingDistance(); float fovy = (float) Math.toRadians(centerCam.getFovY()); float h = (float) (Math.atan(fovy / 2.0f) * far) / 2.0f; shadowCam.setLeftClippingDistance(-h); shadowCam.setRightClippingDistance(h); shadowCam.setTopClippingDistance(h); shadowCam.setBottomClippingDistance(-h); shadowCam.setNearClippingDistance(near); shadowCam.setFarClippingDistance(far); return shadowCam; }
java
static GVROrthogonalCamera makeOrthoShadowCamera(GVRPerspectiveCamera centerCam) { GVROrthogonalCamera shadowCam = new GVROrthogonalCamera(centerCam.getGVRContext()); float near = centerCam.getNearClippingDistance(); float far = centerCam.getFarClippingDistance(); float fovy = (float) Math.toRadians(centerCam.getFovY()); float h = (float) (Math.atan(fovy / 2.0f) * far) / 2.0f; shadowCam.setLeftClippingDistance(-h); shadowCam.setRightClippingDistance(h); shadowCam.setTopClippingDistance(h); shadowCam.setBottomClippingDistance(-h); shadowCam.setNearClippingDistance(near); shadowCam.setFarClippingDistance(far); return shadowCam; }
[ "static", "GVROrthogonalCamera", "makeOrthoShadowCamera", "(", "GVRPerspectiveCamera", "centerCam", ")", "{", "GVROrthogonalCamera", "shadowCam", "=", "new", "GVROrthogonalCamera", "(", "centerCam", ".", "getGVRContext", "(", ")", ")", ";", "float", "near", "=", "centerCam", ".", "getNearClippingDistance", "(", ")", ";", "float", "far", "=", "centerCam", ".", "getFarClippingDistance", "(", ")", ";", "float", "fovy", "=", "(", "float", ")", "Math", ".", "toRadians", "(", "centerCam", ".", "getFovY", "(", ")", ")", ";", "float", "h", "=", "(", "float", ")", "(", "Math", ".", "atan", "(", "fovy", "/", "2.0f", ")", "*", "far", ")", "/", "2.0f", ";", "shadowCam", ".", "setLeftClippingDistance", "(", "-", "h", ")", ";", "shadowCam", ".", "setRightClippingDistance", "(", "h", ")", ";", "shadowCam", ".", "setTopClippingDistance", "(", "h", ")", ";", "shadowCam", ".", "setBottomClippingDistance", "(", "-", "h", ")", ";", "shadowCam", ".", "setNearClippingDistance", "(", "near", ")", ";", "shadowCam", ".", "setFarClippingDistance", "(", "far", ")", ";", "return", "shadowCam", ";", "}" ]
Adds an orthographic camera constructed from the designated perspective camera to describe the shadow projection. The field of view and aspect ration of the perspective camera are used to obtain the view volume of the orthographic camera. This type of camera is used for shadows generated by direct lights at infinite distance. @param centerCam GVRPerspectiveCamera to derive shadow projection from @return Orthographic camera to use for shadow casting @see GVRDirectLight
[ "Adds", "an", "orthographic", "camera", "constructed", "from", "the", "designated", "perspective", "camera", "to", "describe", "the", "shadow", "projection", ".", "The", "field", "of", "view", "and", "aspect", "ration", "of", "the", "perspective", "camera", "are", "used", "to", "obtain", "the", "view", "volume", "of", "the", "orthographic", "camera", ".", "This", "type", "of", "camera", "is", "used", "for", "shadows", "generated", "by", "direct", "lights", "at", "infinite", "distance", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L90-L105
161,616
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java
GVRShadowMap.makePerspShadowCamera
static GVRPerspectiveCamera makePerspShadowCamera(GVRPerspectiveCamera centerCam, float coneAngle) { GVRPerspectiveCamera camera = new GVRPerspectiveCamera(centerCam.getGVRContext()); float near = centerCam.getNearClippingDistance(); float far = centerCam.getFarClippingDistance(); camera.setNearClippingDistance(near); camera.setFarClippingDistance(far); camera.setFovY((float) Math.toDegrees(coneAngle)); camera.setAspectRatio(1.0f); return camera; }
java
static GVRPerspectiveCamera makePerspShadowCamera(GVRPerspectiveCamera centerCam, float coneAngle) { GVRPerspectiveCamera camera = new GVRPerspectiveCamera(centerCam.getGVRContext()); float near = centerCam.getNearClippingDistance(); float far = centerCam.getFarClippingDistance(); camera.setNearClippingDistance(near); camera.setFarClippingDistance(far); camera.setFovY((float) Math.toDegrees(coneAngle)); camera.setAspectRatio(1.0f); return camera; }
[ "static", "GVRPerspectiveCamera", "makePerspShadowCamera", "(", "GVRPerspectiveCamera", "centerCam", ",", "float", "coneAngle", ")", "{", "GVRPerspectiveCamera", "camera", "=", "new", "GVRPerspectiveCamera", "(", "centerCam", ".", "getGVRContext", "(", ")", ")", ";", "float", "near", "=", "centerCam", ".", "getNearClippingDistance", "(", ")", ";", "float", "far", "=", "centerCam", ".", "getFarClippingDistance", "(", ")", ";", "camera", ".", "setNearClippingDistance", "(", "near", ")", ";", "camera", ".", "setFarClippingDistance", "(", "far", ")", ";", "camera", ".", "setFovY", "(", "(", "float", ")", "Math", ".", "toDegrees", "(", "coneAngle", ")", ")", ";", "camera", ".", "setAspectRatio", "(", "1.0f", ")", ";", "return", "camera", ";", "}" ]
Adds a perspective camera constructed from the designated perspective camera to describe the shadow projection. This type of camera is used for shadows generated by spot lights. @param centerCam GVRPerspectiveCamera to derive shadow projection from @param coneAngle spot light cone angle @return Perspective camera to use for shadow casting @see GVRSpotLight
[ "Adds", "a", "perspective", "camera", "constructed", "from", "the", "designated", "perspective", "camera", "to", "describe", "the", "shadow", "projection", ".", "This", "type", "of", "camera", "is", "used", "for", "shadows", "generated", "by", "spot", "lights", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L116-L127
161,617
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnchorImplementation.java
AnchorImplementation.SetNewViewpoint
private void SetNewViewpoint(String url) { Viewpoint vp = null; // get the name without the '#' sign String vpURL = url.substring(1, url.length()); for (Viewpoint viewpoint : viewpoints) { if ( viewpoint.getName().equalsIgnoreCase(vpURL) ) { vp = viewpoint; } } if ( vp != null ) { // found the Viewpoint matching the url GVRCameraRig mainCameraRig = gvrContext.getMainScene().getMainCameraRig(); float[] cameraPosition = vp.getPosition(); mainCameraRig.getTransform().setPosition( cameraPosition[0], cameraPosition[1], cameraPosition[2] ); // Set the Gaze controller position which is where the pick ray // begins in the direction of camera.lookt() GVRCursorController gazeController = null; GVRInputManager inputManager = gvrContext.getInputManager(); List<GVRCursorController> controllerList = inputManager.getCursorControllers(); for(GVRCursorController controller: controllerList){ if(controller.getControllerType() == GVRControllerType.GAZE); { gazeController = controller; break; } } if ( gazeController != null) { gazeController.setOrigin(cameraPosition[0], cameraPosition[1], cameraPosition[2]); } } else { Log.e(TAG, "Viewpoint named " + vpURL + " not found (defined)."); } }
java
private void SetNewViewpoint(String url) { Viewpoint vp = null; // get the name without the '#' sign String vpURL = url.substring(1, url.length()); for (Viewpoint viewpoint : viewpoints) { if ( viewpoint.getName().equalsIgnoreCase(vpURL) ) { vp = viewpoint; } } if ( vp != null ) { // found the Viewpoint matching the url GVRCameraRig mainCameraRig = gvrContext.getMainScene().getMainCameraRig(); float[] cameraPosition = vp.getPosition(); mainCameraRig.getTransform().setPosition( cameraPosition[0], cameraPosition[1], cameraPosition[2] ); // Set the Gaze controller position which is where the pick ray // begins in the direction of camera.lookt() GVRCursorController gazeController = null; GVRInputManager inputManager = gvrContext.getInputManager(); List<GVRCursorController> controllerList = inputManager.getCursorControllers(); for(GVRCursorController controller: controllerList){ if(controller.getControllerType() == GVRControllerType.GAZE); { gazeController = controller; break; } } if ( gazeController != null) { gazeController.setOrigin(cameraPosition[0], cameraPosition[1], cameraPosition[2]); } } else { Log.e(TAG, "Viewpoint named " + vpURL + " not found (defined)."); } }
[ "private", "void", "SetNewViewpoint", "(", "String", "url", ")", "{", "Viewpoint", "vp", "=", "null", ";", "// get the name without the '#' sign", "String", "vpURL", "=", "url", ".", "substring", "(", "1", ",", "url", ".", "length", "(", ")", ")", ";", "for", "(", "Viewpoint", "viewpoint", ":", "viewpoints", ")", "{", "if", "(", "viewpoint", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "vpURL", ")", ")", "{", "vp", "=", "viewpoint", ";", "}", "}", "if", "(", "vp", "!=", "null", ")", "{", "// found the Viewpoint matching the url", "GVRCameraRig", "mainCameraRig", "=", "gvrContext", ".", "getMainScene", "(", ")", ".", "getMainCameraRig", "(", ")", ";", "float", "[", "]", "cameraPosition", "=", "vp", ".", "getPosition", "(", ")", ";", "mainCameraRig", ".", "getTransform", "(", ")", ".", "setPosition", "(", "cameraPosition", "[", "0", "]", ",", "cameraPosition", "[", "1", "]", ",", "cameraPosition", "[", "2", "]", ")", ";", "// Set the Gaze controller position which is where the pick ray", "// begins in the direction of camera.lookt()", "GVRCursorController", "gazeController", "=", "null", ";", "GVRInputManager", "inputManager", "=", "gvrContext", ".", "getInputManager", "(", ")", ";", "List", "<", "GVRCursorController", ">", "controllerList", "=", "inputManager", ".", "getCursorControllers", "(", ")", ";", "for", "(", "GVRCursorController", "controller", ":", "controllerList", ")", "{", "if", "(", "controller", ".", "getControllerType", "(", ")", "==", "GVRControllerType", ".", "GAZE", ")", ";", "{", "gazeController", "=", "controller", ";", "break", ";", "}", "}", "if", "(", "gazeController", "!=", "null", ")", "{", "gazeController", ".", "setOrigin", "(", "cameraPosition", "[", "0", "]", ",", "cameraPosition", "[", "1", "]", ",", "cameraPosition", "[", "2", "]", ")", ";", "}", "}", "else", "{", "Log", ".", "e", "(", "TAG", ",", "\"Viewpoint named \"", "+", "vpURL", "+", "\" not found (defined).\"", ")", ";", "}", "}" ]
end AnchorImplementation class
[ "end", "AnchorImplementation", "class" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnchorImplementation.java#L313-L349
161,618
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnchorImplementation.java
AnchorImplementation.WebPageCloseOnClick
private void WebPageCloseOnClick(GVRViewSceneObject gvrWebViewSceneObject, GVRSceneObject gvrSceneObjectAnchor, String url) { final String urlFinal = url; webPagePlusUISceneObject = new GVRSceneObject(gvrContext); webPagePlusUISceneObject.getTransform().setPosition(webPagePlusUIPosition[0], webPagePlusUIPosition[1], webPagePlusUIPosition[2]); GVRScene mainScene = gvrContext.getMainScene(); Sensor webPageSensor = new Sensor(urlFinal, Sensor.Type.TOUCH, gvrWebViewSceneObject, true); final GVRSceneObject gvrSceneObjectAnchorFinal = gvrSceneObjectAnchor; final GVRSceneObject gvrWebViewSceneObjectFinal = gvrWebViewSceneObject; final GVRSceneObject webPagePlusUISceneObjectFinal = webPagePlusUISceneObject; webPagePlusUISceneObjectFinal.addChildObject(gvrWebViewSceneObjectFinal); gvrSceneObjectAnchorFinal.addChildObject(webPagePlusUISceneObjectFinal); webPageSensor.addISensorEvents(new ISensorEvents() { boolean uiObjectIsActive = false; boolean clickDown = true; @Override public void onSensorEvent(SensorEvent event) { if (event.isActive()) { clickDown = !clickDown; if (clickDown) { // Delete the WebView page gvrSceneObjectAnchorFinal.removeChildObject(webPagePlusUISceneObjectFinal); webPageActive = false; webPagePlusUISceneObject = null; webPageClosed = true; // Make sure click up doesn't open web page behind it } } } }); }
java
private void WebPageCloseOnClick(GVRViewSceneObject gvrWebViewSceneObject, GVRSceneObject gvrSceneObjectAnchor, String url) { final String urlFinal = url; webPagePlusUISceneObject = new GVRSceneObject(gvrContext); webPagePlusUISceneObject.getTransform().setPosition(webPagePlusUIPosition[0], webPagePlusUIPosition[1], webPagePlusUIPosition[2]); GVRScene mainScene = gvrContext.getMainScene(); Sensor webPageSensor = new Sensor(urlFinal, Sensor.Type.TOUCH, gvrWebViewSceneObject, true); final GVRSceneObject gvrSceneObjectAnchorFinal = gvrSceneObjectAnchor; final GVRSceneObject gvrWebViewSceneObjectFinal = gvrWebViewSceneObject; final GVRSceneObject webPagePlusUISceneObjectFinal = webPagePlusUISceneObject; webPagePlusUISceneObjectFinal.addChildObject(gvrWebViewSceneObjectFinal); gvrSceneObjectAnchorFinal.addChildObject(webPagePlusUISceneObjectFinal); webPageSensor.addISensorEvents(new ISensorEvents() { boolean uiObjectIsActive = false; boolean clickDown = true; @Override public void onSensorEvent(SensorEvent event) { if (event.isActive()) { clickDown = !clickDown; if (clickDown) { // Delete the WebView page gvrSceneObjectAnchorFinal.removeChildObject(webPagePlusUISceneObjectFinal); webPageActive = false; webPagePlusUISceneObject = null; webPageClosed = true; // Make sure click up doesn't open web page behind it } } } }); }
[ "private", "void", "WebPageCloseOnClick", "(", "GVRViewSceneObject", "gvrWebViewSceneObject", ",", "GVRSceneObject", "gvrSceneObjectAnchor", ",", "String", "url", ")", "{", "final", "String", "urlFinal", "=", "url", ";", "webPagePlusUISceneObject", "=", "new", "GVRSceneObject", "(", "gvrContext", ")", ";", "webPagePlusUISceneObject", ".", "getTransform", "(", ")", ".", "setPosition", "(", "webPagePlusUIPosition", "[", "0", "]", ",", "webPagePlusUIPosition", "[", "1", "]", ",", "webPagePlusUIPosition", "[", "2", "]", ")", ";", "GVRScene", "mainScene", "=", "gvrContext", ".", "getMainScene", "(", ")", ";", "Sensor", "webPageSensor", "=", "new", "Sensor", "(", "urlFinal", ",", "Sensor", ".", "Type", ".", "TOUCH", ",", "gvrWebViewSceneObject", ",", "true", ")", ";", "final", "GVRSceneObject", "gvrSceneObjectAnchorFinal", "=", "gvrSceneObjectAnchor", ";", "final", "GVRSceneObject", "gvrWebViewSceneObjectFinal", "=", "gvrWebViewSceneObject", ";", "final", "GVRSceneObject", "webPagePlusUISceneObjectFinal", "=", "webPagePlusUISceneObject", ";", "webPagePlusUISceneObjectFinal", ".", "addChildObject", "(", "gvrWebViewSceneObjectFinal", ")", ";", "gvrSceneObjectAnchorFinal", ".", "addChildObject", "(", "webPagePlusUISceneObjectFinal", ")", ";", "webPageSensor", ".", "addISensorEvents", "(", "new", "ISensorEvents", "(", ")", "{", "boolean", "uiObjectIsActive", "=", "false", ";", "boolean", "clickDown", "=", "true", ";", "@", "Override", "public", "void", "onSensorEvent", "(", "SensorEvent", "event", ")", "{", "if", "(", "event", ".", "isActive", "(", ")", ")", "{", "clickDown", "=", "!", "clickDown", ";", "if", "(", "clickDown", ")", "{", "// Delete the WebView page", "gvrSceneObjectAnchorFinal", ".", "removeChildObject", "(", "webPagePlusUISceneObjectFinal", ")", ";", "webPageActive", "=", "false", ";", "webPagePlusUISceneObject", "=", "null", ";", "webPageClosed", "=", "true", ";", "// Make sure click up doesn't open web page behind it", "}", "}", "}", "}", ")", ";", "}" ]
Display web page, but no user interface - close
[ "Display", "web", "page", "but", "no", "user", "interface", "-", "close" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnchorImplementation.java#L408-L443
161,619
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/OrientedLayout.java
OrientedLayout.getOrientationAxis
public Axis getOrientationAxis() { final Axis axis; switch(getOrientation()) { case HORIZONTAL: axis = Axis.X; break; case VERTICAL: axis = Axis.Y; break; case STACK: axis = Axis.Z; break; default: Log.w(TAG, "Unsupported orientation %s", mOrientation); axis = Axis.X; break; } return axis; }
java
public Axis getOrientationAxis() { final Axis axis; switch(getOrientation()) { case HORIZONTAL: axis = Axis.X; break; case VERTICAL: axis = Axis.Y; break; case STACK: axis = Axis.Z; break; default: Log.w(TAG, "Unsupported orientation %s", mOrientation); axis = Axis.X; break; } return axis; }
[ "public", "Axis", "getOrientationAxis", "(", ")", "{", "final", "Axis", "axis", ";", "switch", "(", "getOrientation", "(", ")", ")", "{", "case", "HORIZONTAL", ":", "axis", "=", "Axis", ".", "X", ";", "break", ";", "case", "VERTICAL", ":", "axis", "=", "Axis", ".", "Y", ";", "break", ";", "case", "STACK", ":", "axis", "=", "Axis", ".", "Z", ";", "break", ";", "default", ":", "Log", ".", "w", "(", "TAG", ",", "\"Unsupported orientation %s\"", ",", "mOrientation", ")", ";", "axis", "=", "Axis", ".", "X", ";", "break", ";", "}", "return", "axis", ";", "}" ]
Get the axis along the orientation @return
[ "Get", "the", "axis", "along", "the", "orientation" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/OrientedLayout.java#L66-L84
161,620
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.attachComponent
public boolean attachComponent(GVRComponent component) { if (component.getNative() != 0) { NativeSceneObject.attachComponent(getNative(), component.getNative()); } synchronized (mComponents) { long type = component.getType(); if (!mComponents.containsKey(type)) { mComponents.put(type, component); component.setOwnerObject(this); return true; } } return false; }
java
public boolean attachComponent(GVRComponent component) { if (component.getNative() != 0) { NativeSceneObject.attachComponent(getNative(), component.getNative()); } synchronized (mComponents) { long type = component.getType(); if (!mComponents.containsKey(type)) { mComponents.put(type, component); component.setOwnerObject(this); return true; } } return false; }
[ "public", "boolean", "attachComponent", "(", "GVRComponent", "component", ")", "{", "if", "(", "component", ".", "getNative", "(", ")", "!=", "0", ")", "{", "NativeSceneObject", ".", "attachComponent", "(", "getNative", "(", ")", ",", "component", ".", "getNative", "(", ")", ")", ";", "}", "synchronized", "(", "mComponents", ")", "{", "long", "type", "=", "component", ".", "getType", "(", ")", ";", "if", "(", "!", "mComponents", ".", "containsKey", "(", "type", ")", ")", "{", "mComponents", ".", "put", "(", "type", ",", "component", ")", ";", "component", ".", "setOwnerObject", "(", "this", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Attach a component to this scene object. Each scene object has a list of components that may be attached to it. Only one component of a particular type can be attached. Components are retrieved based on their type. @return true if component is attached, false if a component of that class is already attached. @param component component to attach. @see GVRSceneObject#detachComponent(long) @see GVRSceneObject#getComponent(long)
[ "Attach", "a", "component", "to", "this", "scene", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L346-L359
161,621
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.detachComponent
public GVRComponent detachComponent(long type) { NativeSceneObject.detachComponent(getNative(), type); synchronized (mComponents) { GVRComponent component = mComponents.remove(type); if (component != null) { component.setOwnerObject(null); } return component; } }
java
public GVRComponent detachComponent(long type) { NativeSceneObject.detachComponent(getNative(), type); synchronized (mComponents) { GVRComponent component = mComponents.remove(type); if (component != null) { component.setOwnerObject(null); } return component; } }
[ "public", "GVRComponent", "detachComponent", "(", "long", "type", ")", "{", "NativeSceneObject", ".", "detachComponent", "(", "getNative", "(", ")", ",", "type", ")", ";", "synchronized", "(", "mComponents", ")", "{", "GVRComponent", "component", "=", "mComponents", ".", "remove", "(", "type", ")", ";", "if", "(", "component", "!=", "null", ")", "{", "component", ".", "setOwnerObject", "(", "null", ")", ";", "}", "return", "component", ";", "}", "}" ]
Detach the component of the specified type from this scene object. Each scene object has a list of components. Only one component of a particular type can be attached. Components are detached based on their type. @return GVRComponent detached or null if component not found @param type type of component to detach @see GVRSceneObject#attachComponent(GVRComponent)
[ "Detach", "the", "component", "of", "the", "specified", "type", "from", "this", "scene", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L371-L380
161,622
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.getAllComponents
@SuppressWarnings("unchecked") public <T extends GVRComponent> ArrayList<T> getAllComponents(long type) { ArrayList<T> list = new ArrayList<T>(); GVRComponent component = getComponent(type); if (component != null) list.add((T) component); for (GVRSceneObject child : mChildren) { ArrayList<T> temp = child.getAllComponents(type); list.addAll(temp); } return list; }
java
@SuppressWarnings("unchecked") public <T extends GVRComponent> ArrayList<T> getAllComponents(long type) { ArrayList<T> list = new ArrayList<T>(); GVRComponent component = getComponent(type); if (component != null) list.add((T) component); for (GVRSceneObject child : mChildren) { ArrayList<T> temp = child.getAllComponents(type); list.addAll(temp); } return list; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", "extends", "GVRComponent", ">", "ArrayList", "<", "T", ">", "getAllComponents", "(", "long", "type", ")", "{", "ArrayList", "<", "T", ">", "list", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "GVRComponent", "component", "=", "getComponent", "(", "type", ")", ";", "if", "(", "component", "!=", "null", ")", "list", ".", "add", "(", "(", "T", ")", "component", ")", ";", "for", "(", "GVRSceneObject", "child", ":", "mChildren", ")", "{", "ArrayList", "<", "T", ">", "temp", "=", "child", ".", "getAllComponents", "(", "type", ")", ";", "list", ".", "addAll", "(", "temp", ")", ";", "}", "return", "list", ";", "}" ]
Get all components of a specific class from this scene object and its descendants. @param type component type (as returned from getComponentType()) @return ArrayList of components with the specified class.
[ "Get", "all", "components", "of", "a", "specific", "class", "from", "this", "scene", "object", "and", "its", "descendants", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L569-L580
161,623
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.setPickingEnabled
public void setPickingEnabled(boolean enabled) { if (enabled != getPickingEnabled()) { if (enabled) { attachComponent(new GVRSphereCollider(getGVRContext())); } else { detachComponent(GVRCollider.getComponentType()); } } }
java
public void setPickingEnabled(boolean enabled) { if (enabled != getPickingEnabled()) { if (enabled) { attachComponent(new GVRSphereCollider(getGVRContext())); } else { detachComponent(GVRCollider.getComponentType()); } } }
[ "public", "void", "setPickingEnabled", "(", "boolean", "enabled", ")", "{", "if", "(", "enabled", "!=", "getPickingEnabled", "(", ")", ")", "{", "if", "(", "enabled", ")", "{", "attachComponent", "(", "new", "GVRSphereCollider", "(", "getGVRContext", "(", ")", ")", ")", ";", "}", "else", "{", "detachComponent", "(", "GVRCollider", ".", "getComponentType", "(", ")", ")", ";", "}", "}", "}" ]
Simple, high-level API to enable or disable eye picking for this scene object. The {@linkplain #attachCollider low-level API} gives you a lot of control over eye picking, but it does involve an awful lot of details. This method (and {@link #getPickingEnabled()}) provides a simple boolean property. It attaches a GVRSphereCollider to the scene object. If you want more accurate picking, you can use {@link #attachComponent(GVRComponent)} to attach a mesh collider instead. The mesh collider is more accurate but also costs more to compute. @param enabled Should eye picking 'see' this scene object? @since 2.0.2 @see GVRSphereCollider @see GVRMeshCollider
[ "Simple", "high", "-", "level", "API", "to", "enable", "or", "disable", "eye", "picking", "for", "this", "scene", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L633-L641
161,624
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.removeChildObjectsByName
public int removeChildObjectsByName(final String name) { int removed = 0; if (null != name && !name.isEmpty()) { removed = removeChildObjectsByNameImpl(name); } return removed; }
java
public int removeChildObjectsByName(final String name) { int removed = 0; if (null != name && !name.isEmpty()) { removed = removeChildObjectsByNameImpl(name); } return removed; }
[ "public", "int", "removeChildObjectsByName", "(", "final", "String", "name", ")", "{", "int", "removed", "=", "0", ";", "if", "(", "null", "!=", "name", "&&", "!", "name", ".", "isEmpty", "(", ")", ")", "{", "removed", "=", "removeChildObjectsByNameImpl", "(", "name", ")", ";", "}", "return", "removed", ";", "}" ]
Removes any child object that has the given name by performing case-sensitive search. @param name name of scene object to be removed. @return number of removed objects, 0 if none was found.
[ "Removes", "any", "child", "object", "that", "has", "the", "given", "name", "by", "performing", "case", "-", "sensitive", "search", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L730-L738
161,625
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.removeChildObjectByName
public boolean removeChildObjectByName(final String name) { if (null != name && !name.isEmpty()) { GVRSceneObject found = null; for (GVRSceneObject child : mChildren) { GVRSceneObject object = child.getSceneObjectByName(name); if (object != null) { found = object; break; } } if (found != null) { removeChildObject(found); return true; } } return false; }
java
public boolean removeChildObjectByName(final String name) { if (null != name && !name.isEmpty()) { GVRSceneObject found = null; for (GVRSceneObject child : mChildren) { GVRSceneObject object = child.getSceneObjectByName(name); if (object != null) { found = object; break; } } if (found != null) { removeChildObject(found); return true; } } return false; }
[ "public", "boolean", "removeChildObjectByName", "(", "final", "String", "name", ")", "{", "if", "(", "null", "!=", "name", "&&", "!", "name", ".", "isEmpty", "(", ")", ")", "{", "GVRSceneObject", "found", "=", "null", ";", "for", "(", "GVRSceneObject", "child", ":", "mChildren", ")", "{", "GVRSceneObject", "object", "=", "child", ".", "getSceneObjectByName", "(", "name", ")", ";", "if", "(", "object", "!=", "null", ")", "{", "found", "=", "object", ";", "break", ";", "}", "}", "if", "(", "found", "!=", "null", ")", "{", "removeChildObject", "(", "found", ")", ";", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Performs case-sensitive depth-first search for a child object and then removes it if found. @param name name of scene object to be removed. @return true if child was found (and removed), else false
[ "Performs", "case", "-", "sensitive", "depth", "-", "first", "search", "for", "a", "child", "object", "and", "then", "removes", "it", "if", "found", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L748-L764
161,626
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.onNewParentObject
protected void onNewParentObject(GVRSceneObject parent) { for (GVRComponent comp : mComponents.values()) { comp.onNewOwnersParent(parent); } }
java
protected void onNewParentObject(GVRSceneObject parent) { for (GVRComponent comp : mComponents.values()) { comp.onNewOwnersParent(parent); } }
[ "protected", "void", "onNewParentObject", "(", "GVRSceneObject", "parent", ")", "{", "for", "(", "GVRComponent", "comp", ":", "mComponents", ".", "values", "(", ")", ")", "{", "comp", ".", "onNewOwnersParent", "(", "parent", ")", ";", "}", "}" ]
Called when the scene object gets a new parent. @param parent New parent of this scene object.
[ "Called", "when", "the", "scene", "object", "gets", "a", "new", "parent", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L771-L775
161,627
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.onRemoveParentObject
protected void onRemoveParentObject(GVRSceneObject parent) { for (GVRComponent comp : mComponents.values()) { comp.onRemoveOwnersParent(parent); } }
java
protected void onRemoveParentObject(GVRSceneObject parent) { for (GVRComponent comp : mComponents.values()) { comp.onRemoveOwnersParent(parent); } }
[ "protected", "void", "onRemoveParentObject", "(", "GVRSceneObject", "parent", ")", "{", "for", "(", "GVRComponent", "comp", ":", "mComponents", ".", "values", "(", ")", ")", "{", "comp", ".", "onRemoveOwnersParent", "(", "parent", ")", ";", "}", "}" ]
Called when is removed the parent of the scene object. @param parent Old parent of this scene object.
[ "Called", "when", "is", "removed", "the", "parent", "of", "the", "scene", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L782-L786
161,628
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java
GVRSceneObject.prettyPrint
public void prettyPrint(StringBuffer sb, int indent) { sb.append(Log.getSpaces(indent)); sb.append(getClass().getSimpleName()); sb.append(" [name="); sb.append(this.getName()); sb.append("]"); sb.append(System.lineSeparator()); GVRRenderData rdata = getRenderData(); GVRTransform trans = getTransform(); if (rdata == null) { sb.append(Log.getSpaces(indent + 2)); sb.append("RenderData: null"); sb.append(System.lineSeparator()); } else { rdata.prettyPrint(sb, indent + 2); } sb.append(Log.getSpaces(indent + 2)); sb.append("Transform: "); sb.append(trans); sb.append(System.lineSeparator()); // dump its children for (GVRSceneObject child : getChildren()) { child.prettyPrint(sb, indent + 2); } }
java
public void prettyPrint(StringBuffer sb, int indent) { sb.append(Log.getSpaces(indent)); sb.append(getClass().getSimpleName()); sb.append(" [name="); sb.append(this.getName()); sb.append("]"); sb.append(System.lineSeparator()); GVRRenderData rdata = getRenderData(); GVRTransform trans = getTransform(); if (rdata == null) { sb.append(Log.getSpaces(indent + 2)); sb.append("RenderData: null"); sb.append(System.lineSeparator()); } else { rdata.prettyPrint(sb, indent + 2); } sb.append(Log.getSpaces(indent + 2)); sb.append("Transform: "); sb.append(trans); sb.append(System.lineSeparator()); // dump its children for (GVRSceneObject child : getChildren()) { child.prettyPrint(sb, indent + 2); } }
[ "public", "void", "prettyPrint", "(", "StringBuffer", "sb", ",", "int", "indent", ")", "{", "sb", ".", "append", "(", "Log", ".", "getSpaces", "(", "indent", ")", ")", ";", "sb", ".", "append", "(", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", "sb", ".", "append", "(", "\" [name=\"", ")", ";", "sb", ".", "append", "(", "this", ".", "getName", "(", ")", ")", ";", "sb", ".", "append", "(", "\"]\"", ")", ";", "sb", ".", "append", "(", "System", ".", "lineSeparator", "(", ")", ")", ";", "GVRRenderData", "rdata", "=", "getRenderData", "(", ")", ";", "GVRTransform", "trans", "=", "getTransform", "(", ")", ";", "if", "(", "rdata", "==", "null", ")", "{", "sb", ".", "append", "(", "Log", ".", "getSpaces", "(", "indent", "+", "2", ")", ")", ";", "sb", ".", "append", "(", "\"RenderData: null\"", ")", ";", "sb", ".", "append", "(", "System", ".", "lineSeparator", "(", ")", ")", ";", "}", "else", "{", "rdata", ".", "prettyPrint", "(", "sb", ",", "indent", "+", "2", ")", ";", "}", "sb", ".", "append", "(", "Log", ".", "getSpaces", "(", "indent", "+", "2", ")", ")", ";", "sb", ".", "append", "(", "\"Transform: \"", ")", ";", "sb", ".", "append", "(", "trans", ")", ";", "sb", ".", "append", "(", "System", ".", "lineSeparator", "(", ")", ")", ";", "// dump its children", "for", "(", "GVRSceneObject", "child", ":", "getChildren", "(", ")", ")", "{", "child", ".", "prettyPrint", "(", "sb", ",", "indent", "+", "2", ")", ";", "}", "}" ]
Generate debug dump of the tree from the scene object. It should include a newline character at the end. @param sb the {@code StringBuffer} to dump the object. @param indent indentation level as number of spaces.
[ "Generate", "debug", "dump", "of", "the", "tree", "from", "the", "scene", "object", ".", "It", "should", "include", "a", "newline", "character", "at", "the", "end", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L1183-L1208
161,629
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java
GVRGearCursorController.setControllerModel
public void setControllerModel(GVRSceneObject controllerModel) { if (mControllerModel != null) { mControllerGroup.removeChildObject(mControllerModel); } mControllerModel = controllerModel; mControllerGroup.addChildObject(mControllerModel); mControllerModel.setEnable(mShowControllerModel); }
java
public void setControllerModel(GVRSceneObject controllerModel) { if (mControllerModel != null) { mControllerGroup.removeChildObject(mControllerModel); } mControllerModel = controllerModel; mControllerGroup.addChildObject(mControllerModel); mControllerModel.setEnable(mShowControllerModel); }
[ "public", "void", "setControllerModel", "(", "GVRSceneObject", "controllerModel", ")", "{", "if", "(", "mControllerModel", "!=", "null", ")", "{", "mControllerGroup", ".", "removeChildObject", "(", "mControllerModel", ")", ";", "}", "mControllerModel", "=", "controllerModel", ";", "mControllerGroup", ".", "addChildObject", "(", "mControllerModel", ")", ";", "mControllerModel", ".", "setEnable", "(", "mShowControllerModel", ")", ";", "}" ]
Replaces the model used to depict the controller in the scene. @param controllerModel root of hierarchy to use for controller model @see #getControllerModel() @see #showControllerModel(boolean)
[ "Replaces", "the", "model", "used", "to", "depict", "the", "controller", "in", "the", "scene", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java#L276-L285
161,630
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java
GVRGearCursorController.setCursorDepth
@Override public void setCursorDepth(float depth) { super.setCursorDepth(depth); if (mRayModel != null) { mRayModel.getTransform().setScaleZ(mCursorDepth); } }
java
@Override public void setCursorDepth(float depth) { super.setCursorDepth(depth); if (mRayModel != null) { mRayModel.getTransform().setScaleZ(mCursorDepth); } }
[ "@", "Override", "public", "void", "setCursorDepth", "(", "float", "depth", ")", "{", "super", ".", "setCursorDepth", "(", "depth", ")", ";", "if", "(", "mRayModel", "!=", "null", ")", "{", "mRayModel", ".", "getTransform", "(", ")", ".", "setScaleZ", "(", "mCursorDepth", ")", ";", "}", "}" ]
Set the depth of the cursor. This is the length of the ray from the origin to the cursor. @param depth default cursor depth
[ "Set", "the", "depth", "of", "the", "cursor", ".", "This", "is", "the", "length", "of", "the", "ray", "from", "the", "origin", "to", "the", "cursor", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java#L293-L301
161,631
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java
GVRGearCursorController.setPosition
@Override public void setPosition(float x, float y, float z) { position.set(x, y, z); pickDir.set(x, y, z); pickDir.normalize(); invalidate(); }
java
@Override public void setPosition(float x, float y, float z) { position.set(x, y, z); pickDir.set(x, y, z); pickDir.normalize(); invalidate(); }
[ "@", "Override", "public", "void", "setPosition", "(", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "position", ".", "set", "(", "x", ",", "y", ",", "z", ")", ";", "pickDir", ".", "set", "(", "x", ",", "y", ",", "z", ")", ";", "pickDir", ".", "normalize", "(", ")", ";", "invalidate", "(", ")", ";", "}" ]
Set the position of the pick ray. This function is used internally to update the pick ray with the new controller position. @param x the x value of the position. @param y the y value of the position. @param z the z value of the position.
[ "Set", "the", "position", "of", "the", "pick", "ray", ".", "This", "function", "is", "used", "internally", "to", "update", "the", "pick", "ray", "with", "the", "new", "controller", "position", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java#L338-L345
161,632
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java
GVRGearCursorController.getHandedness
@SuppressWarnings("unused") public Handedness getHandedness() { if ((currentControllerEvent == null) || currentControllerEvent.isRecycled()) { return null; } return currentControllerEvent.handedness == 0.0f ? Handedness.LEFT : Handedness.RIGHT; }
java
@SuppressWarnings("unused") public Handedness getHandedness() { if ((currentControllerEvent == null) || currentControllerEvent.isRecycled()) { return null; } return currentControllerEvent.handedness == 0.0f ? Handedness.LEFT : Handedness.RIGHT; }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "public", "Handedness", "getHandedness", "(", ")", "{", "if", "(", "(", "currentControllerEvent", "==", "null", ")", "||", "currentControllerEvent", ".", "isRecycled", "(", ")", ")", "{", "return", "null", ";", "}", "return", "currentControllerEvent", ".", "handedness", "==", "0.0f", "?", "Handedness", ".", "LEFT", ":", "Handedness", ".", "RIGHT", ";", "}" ]
Return the current handedness of the Gear Controller. @return returns whether the user is using the controller left or right handed. This function returns <code>null</code> if the controller is unavailable or the data is stale.
[ "Return", "the", "current", "handedness", "of", "the", "Gear", "Controller", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRGearCursorController.java#L503-L512
161,633
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java
GVRCursorController.updatePicker
protected void updatePicker(MotionEvent event, boolean isActive) { final MotionEvent newEvent = (event != null) ? event : null; final ControllerPick controllerPick = new ControllerPick(mPicker, newEvent, isActive); context.runOnGlThread(controllerPick); }
java
protected void updatePicker(MotionEvent event, boolean isActive) { final MotionEvent newEvent = (event != null) ? event : null; final ControllerPick controllerPick = new ControllerPick(mPicker, newEvent, isActive); context.runOnGlThread(controllerPick); }
[ "protected", "void", "updatePicker", "(", "MotionEvent", "event", ",", "boolean", "isActive", ")", "{", "final", "MotionEvent", "newEvent", "=", "(", "event", "!=", "null", ")", "?", "event", ":", "null", ";", "final", "ControllerPick", "controllerPick", "=", "new", "ControllerPick", "(", "mPicker", ",", "newEvent", ",", "isActive", ")", ";", "context", ".", "runOnGlThread", "(", "controllerPick", ")", ";", "}" ]
Update the state of the picker. If it has an owner, the picker will use that object to derive its position and orientation. The "active" state of this controller is used to indicate touch. The cursor position is updated after picking.
[ "Update", "the", "state", "of", "the", "picker", ".", "If", "it", "has", "an", "owner", "the", "picker", "will", "use", "that", "object", "to", "derive", "its", "position", "and", "orientation", ".", "The", "active", "state", "of", "this", "controller", "is", "used", "to", "indicate", "touch", ".", "The", "cursor", "position", "is", "updated", "after", "picking", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java#L1120-L1125
161,634
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java
JSONHelpers.loadJSONAsset
public static JSONObject loadJSONAsset(Context context, final String asset) { if (asset == null) { return new JSONObject(); } return getJsonObject(org.gearvrf.widgetlib.main.Utility.readTextFile(context, asset)); }
java
public static JSONObject loadJSONAsset(Context context, final String asset) { if (asset == null) { return new JSONObject(); } return getJsonObject(org.gearvrf.widgetlib.main.Utility.readTextFile(context, asset)); }
[ "public", "static", "JSONObject", "loadJSONAsset", "(", "Context", "context", ",", "final", "String", "asset", ")", "{", "if", "(", "asset", "==", "null", ")", "{", "return", "new", "JSONObject", "(", ")", ";", "}", "return", "getJsonObject", "(", "org", ".", "gearvrf", ".", "widgetlib", ".", "main", ".", "Utility", ".", "readTextFile", "(", "context", ",", "asset", ")", ")", ";", "}" ]
Load a JSON file from the application's "asset" directory. @param context Valid {@link Context} @param asset Name of the JSON file @return New instance of {@link JSONObject}
[ "Load", "a", "JSON", "file", "from", "the", "application", "s", "asset", "directory", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1138-L1143
161,635
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java
JSONHelpers.getJSONColor
public static int getJSONColor(final JSONObject json, String elementName) throws JSONException { Object raw = json.get(elementName); return convertJSONColor(raw); }
java
public static int getJSONColor(final JSONObject json, String elementName) throws JSONException { Object raw = json.get(elementName); return convertJSONColor(raw); }
[ "public", "static", "int", "getJSONColor", "(", "final", "JSONObject", "json", ",", "String", "elementName", ")", "throws", "JSONException", "{", "Object", "raw", "=", "json", ".", "get", "(", "elementName", ")", ";", "return", "convertJSONColor", "(", "raw", ")", ";", "}" ]
Gets a color formatted as an integer with ARGB ordering. @param json {@link JSONObject} to get the color from @param elementName Name of the color element @return An ARGB formatted integer @throws JSONException
[ "Gets", "a", "color", "formatted", "as", "an", "integer", "with", "ARGB", "ordering", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L1664-L1667
161,636
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java
GVRAsynchronousResourceLoader.loadFutureCubemapTexture
public static GVRTexture loadFutureCubemapTexture( GVRContext gvrContext, ResourceCache<GVRImage> textureCache, GVRAndroidResource resource, int priority, Map<String, Integer> faceIndexMap) { GVRTexture tex = new GVRTexture(gvrContext); GVRImage cached = textureCache.get(resource); if (cached != null) { Log.v("ASSET", "Future Texture: %s loaded from cache", cached.getFileName()); tex.setImage(cached); } else { AsyncCubemapTexture.get().loadTexture(gvrContext, CancelableCallbackWrapper.wrap(GVRCubemapImage.class, tex), resource, priority, faceIndexMap); } return tex; }
java
public static GVRTexture loadFutureCubemapTexture( GVRContext gvrContext, ResourceCache<GVRImage> textureCache, GVRAndroidResource resource, int priority, Map<String, Integer> faceIndexMap) { GVRTexture tex = new GVRTexture(gvrContext); GVRImage cached = textureCache.get(resource); if (cached != null) { Log.v("ASSET", "Future Texture: %s loaded from cache", cached.getFileName()); tex.setImage(cached); } else { AsyncCubemapTexture.get().loadTexture(gvrContext, CancelableCallbackWrapper.wrap(GVRCubemapImage.class, tex), resource, priority, faceIndexMap); } return tex; }
[ "public", "static", "GVRTexture", "loadFutureCubemapTexture", "(", "GVRContext", "gvrContext", ",", "ResourceCache", "<", "GVRImage", ">", "textureCache", ",", "GVRAndroidResource", "resource", ",", "int", "priority", ",", "Map", "<", "String", ",", "Integer", ">", "faceIndexMap", ")", "{", "GVRTexture", "tex", "=", "new", "GVRTexture", "(", "gvrContext", ")", ";", "GVRImage", "cached", "=", "textureCache", ".", "get", "(", "resource", ")", ";", "if", "(", "cached", "!=", "null", ")", "{", "Log", ".", "v", "(", "\"ASSET\"", ",", "\"Future Texture: %s loaded from cache\"", ",", "cached", ".", "getFileName", "(", ")", ")", ";", "tex", ".", "setImage", "(", "cached", ")", ";", "}", "else", "{", "AsyncCubemapTexture", ".", "get", "(", ")", ".", "loadTexture", "(", "gvrContext", ",", "CancelableCallbackWrapper", ".", "wrap", "(", "GVRCubemapImage", ".", "class", ",", "tex", ")", ",", "resource", ",", "priority", ",", "faceIndexMap", ")", ";", "}", "return", "tex", ";", "}" ]
Load a cube map texture asynchronously. This is the implementation of {@link GVRAssetLoader#loadCubemapTexture(GVRAndroidResource)} - it will usually be more convenient (and more efficient) to call that directly. @param gvrContext The GVRF context @param textureCache Texture cache - may be {@code null} @param resource A steam containing a zip file which contains six bitmaps. The six bitmaps correspond to +x, -x, +y, -y, +z, and -z faces of the cube map texture respectively. The default names of the six images are "posx.png", "negx.png", "posy.png", "negx.png", "posz.png", and "negz.png", which can be changed by calling {@link GVRCubemapImage#setFaceNames(String[])}. @param priority This request's priority. Please see the notes on asynchronous priorities in the <a href="package-summary.html#async">package description</a>. @return A {@link Future} that you can pass to methods like {@link GVRShaderData#setMainTexture(Future)}
[ "Load", "a", "cube", "map", "texture", "asynchronously", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java#L315-L334
161,637
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java
GVRAsynchronousResourceLoader.loadCubemapTexture
public static void loadCubemapTexture(final GVRContext context, ResourceCache<GVRImage> textureCache, final TextureCallback callback, final GVRAndroidResource resource, int priority, Map<String, Integer> faceIndexMap) throws IllegalArgumentException { validatePriorityCallbackParameters(context, callback, resource, priority); final GVRImage cached = textureCache == null ? null : (GVRImage) textureCache.get(resource); if (cached != null) { Log.v("ASSET", "Texture: %s loaded from cache", cached.getFileName()); context.runOnGlThread(new Runnable() { @Override public void run() { callback.loaded(cached, resource); } }); } else { TextureCallback actualCallback = (textureCache == null) ? callback : ResourceCache.wrapCallback(textureCache, callback); AsyncCubemapTexture.loadTexture(context, CancelableCallbackWrapper.wrap(GVRCubemapImage.class, actualCallback), resource, priority, faceIndexMap); } }
java
public static void loadCubemapTexture(final GVRContext context, ResourceCache<GVRImage> textureCache, final TextureCallback callback, final GVRAndroidResource resource, int priority, Map<String, Integer> faceIndexMap) throws IllegalArgumentException { validatePriorityCallbackParameters(context, callback, resource, priority); final GVRImage cached = textureCache == null ? null : (GVRImage) textureCache.get(resource); if (cached != null) { Log.v("ASSET", "Texture: %s loaded from cache", cached.getFileName()); context.runOnGlThread(new Runnable() { @Override public void run() { callback.loaded(cached, resource); } }); } else { TextureCallback actualCallback = (textureCache == null) ? callback : ResourceCache.wrapCallback(textureCache, callback); AsyncCubemapTexture.loadTexture(context, CancelableCallbackWrapper.wrap(GVRCubemapImage.class, actualCallback), resource, priority, faceIndexMap); } }
[ "public", "static", "void", "loadCubemapTexture", "(", "final", "GVRContext", "context", ",", "ResourceCache", "<", "GVRImage", ">", "textureCache", ",", "final", "TextureCallback", "callback", ",", "final", "GVRAndroidResource", "resource", ",", "int", "priority", ",", "Map", "<", "String", ",", "Integer", ">", "faceIndexMap", ")", "throws", "IllegalArgumentException", "{", "validatePriorityCallbackParameters", "(", "context", ",", "callback", ",", "resource", ",", "priority", ")", ";", "final", "GVRImage", "cached", "=", "textureCache", "==", "null", "?", "null", ":", "(", "GVRImage", ")", "textureCache", ".", "get", "(", "resource", ")", ";", "if", "(", "cached", "!=", "null", ")", "{", "Log", ".", "v", "(", "\"ASSET\"", ",", "\"Texture: %s loaded from cache\"", ",", "cached", ".", "getFileName", "(", ")", ")", ";", "context", ".", "runOnGlThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "callback", ".", "loaded", "(", "cached", ",", "resource", ")", ";", "}", "}", ")", ";", "}", "else", "{", "TextureCallback", "actualCallback", "=", "(", "textureCache", "==", "null", ")", "?", "callback", ":", "ResourceCache", ".", "wrapCallback", "(", "textureCache", ",", "callback", ")", ";", "AsyncCubemapTexture", ".", "loadTexture", "(", "context", ",", "CancelableCallbackWrapper", ".", "wrap", "(", "GVRCubemapImage", ".", "class", ",", "actualCallback", ")", ",", "resource", ",", "priority", ",", "faceIndexMap", ")", ";", "}", "}" ]
Load a cubemap texture asynchronously. This is the implementation of {@link GVRAssetLoader#loadCubemapTexture(GVRAndroidResource.TextureCallback, GVRAndroidResource, int)} - it will usually be more convenient (and more efficient) to call that directly. @param context The GVRF context @param textureCache Texture cache - may be {@code null} @param callback Asynchronous notifications @param resource Basically, a stream containing a compressed texture. Taking a {@link GVRAndroidResource} parameter eliminates six overloads. @param priority This request's priority. Please see the notes on asynchronous priorities in the <a href="package-summary.html#async">package description</a>. @return A {@link Future} that you can pass to methods like {@link GVRShaderData#setMainTexture(Future)}
[ "Load", "a", "cubemap", "texture", "asynchronously", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java#L360-L392
161,638
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java
GVRAsynchronousResourceLoader.decodeStream
public static Bitmap decodeStream(InputStream stream, boolean closeStream) { return AsyncBitmapTexture.decodeStream(stream, AsyncBitmapTexture.glMaxTextureSize, AsyncBitmapTexture.glMaxTextureSize, true, null, closeStream); }
java
public static Bitmap decodeStream(InputStream stream, boolean closeStream) { return AsyncBitmapTexture.decodeStream(stream, AsyncBitmapTexture.glMaxTextureSize, AsyncBitmapTexture.glMaxTextureSize, true, null, closeStream); }
[ "public", "static", "Bitmap", "decodeStream", "(", "InputStream", "stream", ",", "boolean", "closeStream", ")", "{", "return", "AsyncBitmapTexture", ".", "decodeStream", "(", "stream", ",", "AsyncBitmapTexture", ".", "glMaxTextureSize", ",", "AsyncBitmapTexture", ".", "glMaxTextureSize", ",", "true", ",", "null", ",", "closeStream", ")", ";", "}" ]
An internal method, public only so that GVRContext can make cross-package calls. A synchronous (blocking) wrapper around {@link android.graphics.BitmapFactory#decodeStream(InputStream) BitmapFactory.decodeStream} that uses an {@link android.graphics.BitmapFactory.Options} <code>inTempStorage</code> decode buffer. On low memory, returns half (quarter, eighth, ...) size images. <p> If {@code stream} is a {@link FileInputStream} and is at offset 0 (zero), uses {@link android.graphics.BitmapFactory#decodeFileDescriptor(FileDescriptor) BitmapFactory.decodeFileDescriptor()} instead of {@link android.graphics.BitmapFactory#decodeStream(InputStream) BitmapFactory.decodeStream()}. @param stream Bitmap stream @param closeStream If {@code true}, closes {@code stream} @return Bitmap, or null if cannot be decoded into a bitmap
[ "An", "internal", "method", "public", "only", "so", "that", "GVRContext", "can", "make", "cross", "-", "package", "calls", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/GVRAsynchronousResourceLoader.java#L668-L672
161,639
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderManager.java
GVRShaderManager.getShaderType
public GVRShaderId getShaderType(Class<? extends GVRShader> shaderClass) { GVRShaderId shaderId = mShaderTemplates.get(shaderClass); if (shaderId == null) { GVRContext ctx = getGVRContext(); shaderId = new GVRShaderId(shaderClass); mShaderTemplates.put(shaderClass, shaderId); shaderId.getTemplate(ctx); } return shaderId; }
java
public GVRShaderId getShaderType(Class<? extends GVRShader> shaderClass) { GVRShaderId shaderId = mShaderTemplates.get(shaderClass); if (shaderId == null) { GVRContext ctx = getGVRContext(); shaderId = new GVRShaderId(shaderClass); mShaderTemplates.put(shaderClass, shaderId); shaderId.getTemplate(ctx); } return shaderId; }
[ "public", "GVRShaderId", "getShaderType", "(", "Class", "<", "?", "extends", "GVRShader", ">", "shaderClass", ")", "{", "GVRShaderId", "shaderId", "=", "mShaderTemplates", ".", "get", "(", "shaderClass", ")", ";", "if", "(", "shaderId", "==", "null", ")", "{", "GVRContext", "ctx", "=", "getGVRContext", "(", ")", ";", "shaderId", "=", "new", "GVRShaderId", "(", "shaderClass", ")", ";", "mShaderTemplates", ".", "put", "(", "shaderClass", ",", "shaderId", ")", ";", "shaderId", ".", "getTemplate", "(", "ctx", ")", ";", "}", "return", "shaderId", ";", "}" ]
Retrieves the Material Shader ID associated with the given shader template class. A shader template is capable of generating multiple variants from a single shader source. The exact vertex and fragment shaders are generated by GearVRF based on the lights being used and the material attributes. you may subclass GVRShaderTemplate to create your own shader templates. @param shaderClass shader class to find (subclass of GVRShader) @return GVRShaderId associated with that shader template @see GVRShaderTemplate GVRShader
[ "Retrieves", "the", "Material", "Shader", "ID", "associated", "with", "the", "given", "shader", "template", "class", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderManager.java#L80-L92
161,640
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderManager.java
GVRShaderManager.makeLayout
static String makeLayout(String descriptor, String blockName, boolean useUBO) { return NativeShaderManager.makeLayout(descriptor, blockName, useUBO); }
java
static String makeLayout(String descriptor, String blockName, boolean useUBO) { return NativeShaderManager.makeLayout(descriptor, blockName, useUBO); }
[ "static", "String", "makeLayout", "(", "String", "descriptor", ",", "String", "blockName", ",", "boolean", "useUBO", ")", "{", "return", "NativeShaderManager", ".", "makeLayout", "(", "descriptor", ",", "blockName", ",", "useUBO", ")", ";", "}" ]
Make a string with the shader layout for a uniform block with a given descriptor. The format of the descriptor is the same as for a @{link GVRShaderData} - a string of types and names of each field. <p> This function will return a Vulkan shader layout if the Vulkan renderer is being used. Otherwise, it returns an OpenGL layout. @param descriptor string with types and names of each field @param blockName name of uniform block @param useUBO true to output uniform buffer layout, false for push constants @return string with shader declaration
[ "Make", "a", "string", "with", "the", "shader", "layout", "for", "a", "uniform", "block", "with", "a", "given", "descriptor", ".", "The", "format", "of", "the", "descriptor", "is", "the", "same", "as", "for", "a" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderManager.java#L113-L116
161,641
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java
GVRTransform.rotateWithPivot
public void rotateWithPivot(float quatW, float quatX, float quatY, float quatZ, float pivotX, float pivotY, float pivotZ) { NativeTransform.rotateWithPivot(getNative(), quatW, quatX, quatY, quatZ, pivotX, pivotY, pivotZ); }
java
public void rotateWithPivot(float quatW, float quatX, float quatY, float quatZ, float pivotX, float pivotY, float pivotZ) { NativeTransform.rotateWithPivot(getNative(), quatW, quatX, quatY, quatZ, pivotX, pivotY, pivotZ); }
[ "public", "void", "rotateWithPivot", "(", "float", "quatW", ",", "float", "quatX", ",", "float", "quatY", ",", "float", "quatZ", ",", "float", "pivotX", ",", "float", "pivotY", ",", "float", "pivotZ", ")", "{", "NativeTransform", ".", "rotateWithPivot", "(", "getNative", "(", ")", ",", "quatW", ",", "quatX", ",", "quatY", ",", "quatZ", ",", "pivotX", ",", "pivotY", ",", "pivotZ", ")", ";", "}" ]
Modify the transform's current rotation in quaternion terms, around a pivot other than the origin. @param quatW 'W' component of the rotation quaternion. @param quatX 'X' component of the rotation quaternion. @param quatY 'Y' component of the rotation quaternion. @param quatZ 'Z' component of the rotation quaternion. @param pivotX 'X' component of the pivot's location. @param pivotY 'Y' component of the pivot's location. @param pivotZ 'Z' component of the pivot's location.
[ "Modify", "the", "transform", "s", "current", "rotation", "in", "quaternion", "terms", "around", "a", "pivot", "other", "than", "the", "origin", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java#L492-L496
161,642
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCubemapImage.java
GVRCubemapImage.setFaceNames
public static void setFaceNames(String[] nameArray) { if (nameArray.length != 6) { throw new IllegalArgumentException("nameArray length is not 6."); } for (int i = 0; i < 6; i++) { faceIndexMap.put(nameArray[i], i); } }
java
public static void setFaceNames(String[] nameArray) { if (nameArray.length != 6) { throw new IllegalArgumentException("nameArray length is not 6."); } for (int i = 0; i < 6; i++) { faceIndexMap.put(nameArray[i], i); } }
[ "public", "static", "void", "setFaceNames", "(", "String", "[", "]", "nameArray", ")", "{", "if", "(", "nameArray", ".", "length", "!=", "6", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"nameArray length is not 6.\"", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "6", ";", "i", "++", ")", "{", "faceIndexMap", ".", "put", "(", "nameArray", "[", "i", "]", ",", "i", ")", ";", "}", "}" ]
Set the names of six images in the zip file. The default names of the six images are "posx.png", "negx.png", "posy.png", "negx.png", "posz.png", and "negz.png". If the names of the six images in the zip file are different to the default ones, this function must be called before load the zip file. @param nameArray An array containing six strings which are names of images corresponding to +x, -x, +y, -y, +z, and -z faces of the cube map texture respectively.
[ "Set", "the", "names", "of", "six", "images", "in", "the", "zip", "file", ".", "The", "default", "names", "of", "the", "six", "images", "are", "posx", ".", "png", "negx", ".", "png", "posy", ".", "png", "negx", ".", "png", "posz", ".", "png", "and", "negz", ".", "png", ".", "If", "the", "names", "of", "the", "six", "images", "in", "the", "zip", "file", "are", "different", "to", "the", "default", "ones", "this", "function", "must", "be", "called", "before", "load", "the", "zip", "file", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCubemapImage.java#L76-L86
161,643
Samsung/GearVRf
GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRWorld.java
GVRWorld.startDrag
public boolean startDrag(final GVRSceneObject sceneObject, final float hitX, final float hitY, final float hitZ) { final GVRRigidBody dragMe = (GVRRigidBody)sceneObject.getComponent(GVRRigidBody.getComponentType()); if (dragMe == null || dragMe.getSimulationType() != GVRRigidBody.DYNAMIC || !contains(dragMe)) return false; GVRTransform t = sceneObject.getTransform(); final Vector3f relPos = new Vector3f(hitX, hitY, hitZ); relPos.mul(t.getScaleX(), t.getScaleY(), t.getScaleZ()); relPos.rotate(new Quaternionf(t.getRotationX(), t.getRotationY(), t.getRotationZ(), t.getRotationW())); final GVRSceneObject pivotObject = mPhysicsDragger.startDrag(sceneObject, relPos.x, relPos.y, relPos.z); if (pivotObject == null) return false; mPhysicsContext.runOnPhysicsThread(new Runnable() { @Override public void run() { mRigidBodyDragMe = dragMe; NativePhysics3DWorld.startDrag(getNative(), pivotObject.getNative(), dragMe.getNative(), hitX, hitY, hitZ); } }); return true; }
java
public boolean startDrag(final GVRSceneObject sceneObject, final float hitX, final float hitY, final float hitZ) { final GVRRigidBody dragMe = (GVRRigidBody)sceneObject.getComponent(GVRRigidBody.getComponentType()); if (dragMe == null || dragMe.getSimulationType() != GVRRigidBody.DYNAMIC || !contains(dragMe)) return false; GVRTransform t = sceneObject.getTransform(); final Vector3f relPos = new Vector3f(hitX, hitY, hitZ); relPos.mul(t.getScaleX(), t.getScaleY(), t.getScaleZ()); relPos.rotate(new Quaternionf(t.getRotationX(), t.getRotationY(), t.getRotationZ(), t.getRotationW())); final GVRSceneObject pivotObject = mPhysicsDragger.startDrag(sceneObject, relPos.x, relPos.y, relPos.z); if (pivotObject == null) return false; mPhysicsContext.runOnPhysicsThread(new Runnable() { @Override public void run() { mRigidBodyDragMe = dragMe; NativePhysics3DWorld.startDrag(getNative(), pivotObject.getNative(), dragMe.getNative(), hitX, hitY, hitZ); } }); return true; }
[ "public", "boolean", "startDrag", "(", "final", "GVRSceneObject", "sceneObject", ",", "final", "float", "hitX", ",", "final", "float", "hitY", ",", "final", "float", "hitZ", ")", "{", "final", "GVRRigidBody", "dragMe", "=", "(", "GVRRigidBody", ")", "sceneObject", ".", "getComponent", "(", "GVRRigidBody", ".", "getComponentType", "(", ")", ")", ";", "if", "(", "dragMe", "==", "null", "||", "dragMe", ".", "getSimulationType", "(", ")", "!=", "GVRRigidBody", ".", "DYNAMIC", "||", "!", "contains", "(", "dragMe", ")", ")", "return", "false", ";", "GVRTransform", "t", "=", "sceneObject", ".", "getTransform", "(", ")", ";", "final", "Vector3f", "relPos", "=", "new", "Vector3f", "(", "hitX", ",", "hitY", ",", "hitZ", ")", ";", "relPos", ".", "mul", "(", "t", ".", "getScaleX", "(", ")", ",", "t", ".", "getScaleY", "(", ")", ",", "t", ".", "getScaleZ", "(", ")", ")", ";", "relPos", ".", "rotate", "(", "new", "Quaternionf", "(", "t", ".", "getRotationX", "(", ")", ",", "t", ".", "getRotationY", "(", ")", ",", "t", ".", "getRotationZ", "(", ")", ",", "t", ".", "getRotationW", "(", ")", ")", ")", ";", "final", "GVRSceneObject", "pivotObject", "=", "mPhysicsDragger", ".", "startDrag", "(", "sceneObject", ",", "relPos", ".", "x", ",", "relPos", ".", "y", ",", "relPos", ".", "z", ")", ";", "if", "(", "pivotObject", "==", "null", ")", "return", "false", ";", "mPhysicsContext", ".", "runOnPhysicsThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "mRigidBodyDragMe", "=", "dragMe", ";", "NativePhysics3DWorld", ".", "startDrag", "(", "getNative", "(", ")", ",", "pivotObject", ".", "getNative", "(", ")", ",", "dragMe", ".", "getNative", "(", ")", ",", "hitX", ",", "hitY", ",", "hitZ", ")", ";", "}", "}", ")", ";", "return", "true", ";", "}" ]
Start the drag operation of a scene object with a rigid body. @param sceneObject Scene object with a rigid body attached to it. @param hitX rel position in x-axis. @param hitY rel position in y-axis. @param hitZ rel position in z-axis. @return true if success, otherwise returns false.
[ "Start", "the", "drag", "operation", "of", "a", "scene", "object", "with", "a", "rigid", "body", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRWorld.java#L190-L217
161,644
Samsung/GearVRf
GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRWorld.java
GVRWorld.stopDrag
public void stopDrag() { mPhysicsDragger.stopDrag(); mPhysicsContext.runOnPhysicsThread(new Runnable() { @Override public void run() { if (mRigidBodyDragMe != null) { NativePhysics3DWorld.stopDrag(getNative()); mRigidBodyDragMe = null; } } }); }
java
public void stopDrag() { mPhysicsDragger.stopDrag(); mPhysicsContext.runOnPhysicsThread(new Runnable() { @Override public void run() { if (mRigidBodyDragMe != null) { NativePhysics3DWorld.stopDrag(getNative()); mRigidBodyDragMe = null; } } }); }
[ "public", "void", "stopDrag", "(", ")", "{", "mPhysicsDragger", ".", "stopDrag", "(", ")", ";", "mPhysicsContext", ".", "runOnPhysicsThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "mRigidBodyDragMe", "!=", "null", ")", "{", "NativePhysics3DWorld", ".", "stopDrag", "(", "getNative", "(", ")", ")", ";", "mRigidBodyDragMe", "=", "null", ";", "}", "}", "}", ")", ";", "}" ]
Stop the drag action.
[ "Stop", "the", "drag", "action", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRWorld.java#L222-L234
161,645
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRScaleKey.java
GVRScaleKey.setValue
public void setValue(Vector3f scale) { mX = scale.x; mY = scale.y; mZ = scale.z; }
java
public void setValue(Vector3f scale) { mX = scale.x; mY = scale.y; mZ = scale.z; }
[ "public", "void", "setValue", "(", "Vector3f", "scale", ")", "{", "mX", "=", "scale", ".", "x", ";", "mY", "=", "scale", ".", "y", ";", "mZ", "=", "scale", ".", "z", ";", "}" ]
Sets the scale vector of the keyframe.
[ "Sets", "the", "scale", "vector", "of", "the", "keyframe", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRScaleKey.java#L42-L46
161,646
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSwitch.java
GVRSwitch.selectByName
public void selectByName(String childName) { int i = 0; GVRSceneObject owner = getOwnerObject(); if (owner == null) { return; } for (GVRSceneObject child : owner.children()) { if (child.getName().equals(childName)) { mSwitchIndex = i; return; } ++i; } }
java
public void selectByName(String childName) { int i = 0; GVRSceneObject owner = getOwnerObject(); if (owner == null) { return; } for (GVRSceneObject child : owner.children()) { if (child.getName().equals(childName)) { mSwitchIndex = i; return; } ++i; } }
[ "public", "void", "selectByName", "(", "String", "childName", ")", "{", "int", "i", "=", "0", ";", "GVRSceneObject", "owner", "=", "getOwnerObject", "(", ")", ";", "if", "(", "owner", "==", "null", ")", "{", "return", ";", "}", "for", "(", "GVRSceneObject", "child", ":", "owner", ".", "children", "(", ")", ")", "{", "if", "(", "child", ".", "getName", "(", ")", ".", "equals", "(", "childName", ")", ")", "{", "mSwitchIndex", "=", "i", ";", "return", ";", "}", "++", "i", ";", "}", "}" ]
Sets the current switch index based on object name. This function finds the child of the scene object this component is attached to and sets the switch index to reference it so this is the object that will be displayed. If it is out of range, none of the children will be shown. @param childName name of child to select @see GVRSceneObject#getChildByIndex(int)
[ "Sets", "the", "current", "switch", "index", "based", "on", "object", "name", ".", "This", "function", "finds", "the", "child", "of", "the", "scene", "object", "this", "component", "is", "attached", "to", "and", "sets", "the", "switch", "index", "to", "reference", "it", "so", "this", "is", "the", "object", "that", "will", "be", "displayed", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSwitch.java#L94-L111
161,647
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMeshMorph.java
GVRMeshMorph.onAttach
public void onAttach(GVRSceneObject sceneObj) { super.onAttach(sceneObj); GVRComponent comp = getComponent(GVRRenderData.getComponentType()); if (comp == null) { throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh"); } GVRMesh mesh = ((GVRRenderData) comp).getMesh(); if (mesh == null) { throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh"); } GVRShaderData mtl = getMaterial(); if ((mtl == null) || !mtl.getTextureDescriptor().contains("blendshapeTexture")) { throw new IllegalStateException("Scene object shader does not support morphing"); } copyBaseShape(mesh.getVertexBuffer()); mtl.setInt("u_numblendshapes", mNumBlendShapes); mtl.setFloatArray("u_blendweights", mWeights); }
java
public void onAttach(GVRSceneObject sceneObj) { super.onAttach(sceneObj); GVRComponent comp = getComponent(GVRRenderData.getComponentType()); if (comp == null) { throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh"); } GVRMesh mesh = ((GVRRenderData) comp).getMesh(); if (mesh == null) { throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh"); } GVRShaderData mtl = getMaterial(); if ((mtl == null) || !mtl.getTextureDescriptor().contains("blendshapeTexture")) { throw new IllegalStateException("Scene object shader does not support morphing"); } copyBaseShape(mesh.getVertexBuffer()); mtl.setInt("u_numblendshapes", mNumBlendShapes); mtl.setFloatArray("u_blendweights", mWeights); }
[ "public", "void", "onAttach", "(", "GVRSceneObject", "sceneObj", ")", "{", "super", ".", "onAttach", "(", "sceneObj", ")", ";", "GVRComponent", "comp", "=", "getComponent", "(", "GVRRenderData", ".", "getComponentType", "(", ")", ")", ";", "if", "(", "comp", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot attach a morph to a scene object without a base mesh\"", ")", ";", "}", "GVRMesh", "mesh", "=", "(", "(", "GVRRenderData", ")", "comp", ")", ".", "getMesh", "(", ")", ";", "if", "(", "mesh", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot attach a morph to a scene object without a base mesh\"", ")", ";", "}", "GVRShaderData", "mtl", "=", "getMaterial", "(", ")", ";", "if", "(", "(", "mtl", "==", "null", ")", "||", "!", "mtl", ".", "getTextureDescriptor", "(", ")", ".", "contains", "(", "\"blendshapeTexture\"", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Scene object shader does not support morphing\"", ")", ";", "}", "copyBaseShape", "(", "mesh", ".", "getVertexBuffer", "(", ")", ")", ";", "mtl", ".", "setInt", "(", "\"u_numblendshapes\"", ",", "mNumBlendShapes", ")", ";", "mtl", ".", "setFloatArray", "(", "\"u_blendweights\"", ",", "mWeights", ")", ";", "}" ]
Attaches a morph to scene object with a base mesh @param sceneObj is the base mesh. @throws IllegalStateException if component is null @throws IllegalStateException if mesh is null @throws IllegalStateException if material is null
[ "Attaches", "a", "morph", "to", "scene", "object", "with", "a", "base", "mesh" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMeshMorph.java#L110-L135
161,648
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRObjectPicker.java
GVRObjectPicker.intersect
protected boolean intersect(GVRSceneObject.BoundingVolume bv1, GVRSceneObject.BoundingVolume bv2) { return (bv1.maxCorner.x >= bv2.minCorner.x) && (bv1.maxCorner.y >= bv2.minCorner.y) && (bv1.maxCorner.z >= bv2.minCorner.z) && (bv1.minCorner.x <= bv2.maxCorner.x) && (bv1.minCorner.y <= bv2.maxCorner.y) && (bv1.minCorner.z <= bv2.maxCorner.z); }
java
protected boolean intersect(GVRSceneObject.BoundingVolume bv1, GVRSceneObject.BoundingVolume bv2) { return (bv1.maxCorner.x >= bv2.minCorner.x) && (bv1.maxCorner.y >= bv2.minCorner.y) && (bv1.maxCorner.z >= bv2.minCorner.z) && (bv1.minCorner.x <= bv2.maxCorner.x) && (bv1.minCorner.y <= bv2.maxCorner.y) && (bv1.minCorner.z <= bv2.maxCorner.z); }
[ "protected", "boolean", "intersect", "(", "GVRSceneObject", ".", "BoundingVolume", "bv1", ",", "GVRSceneObject", ".", "BoundingVolume", "bv2", ")", "{", "return", "(", "bv1", ".", "maxCorner", ".", "x", ">=", "bv2", ".", "minCorner", ".", "x", ")", "&&", "(", "bv1", ".", "maxCorner", ".", "y", ">=", "bv2", ".", "minCorner", ".", "y", ")", "&&", "(", "bv1", ".", "maxCorner", ".", "z", ">=", "bv2", ".", "minCorner", ".", "z", ")", "&&", "(", "bv1", ".", "minCorner", ".", "x", "<=", "bv2", ".", "maxCorner", ".", "x", ")", "&&", "(", "bv1", ".", "minCorner", ".", "y", "<=", "bv2", ".", "maxCorner", ".", "y", ")", "&&", "(", "bv1", ".", "minCorner", ".", "z", "<=", "bv2", ".", "maxCorner", ".", "z", ")", ";", "}" ]
Determines whether or not two axially aligned bounding boxes in the same coordinate space intersect. @param bv1 first bounding volume to test. @param bv2 second bounding volume to test. @return true if the boxes intersect, false if not.
[ "Determines", "whether", "or", "not", "two", "axially", "aligned", "bounding", "boxes", "in", "the", "same", "coordinate", "space", "intersect", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRObjectPicker.java#L113-L121
161,649
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRVideoSceneObject.java
GVRVideoSceneObject.makePlayerInstance
public static GVRVideoSceneObjectPlayer<MediaPlayer> makePlayerInstance(final MediaPlayer mediaPlayer) { return new GVRVideoSceneObjectPlayer<MediaPlayer>() { @Override public MediaPlayer getPlayer() { return mediaPlayer; } @Override public void setSurface(Surface surface) { mediaPlayer.setSurface(surface); } @Override public void release() { mediaPlayer.release(); } @Override public boolean canReleaseSurfaceImmediately() { return true; } @Override public void pause() { try { mediaPlayer.pause(); } catch (final IllegalStateException exc) { //intentionally ignored; might have been released already or never got to be //initialized } } @Override public void start() { mediaPlayer.start(); } @Override public boolean isPlaying() { return mediaPlayer.isPlaying(); } }; }
java
public static GVRVideoSceneObjectPlayer<MediaPlayer> makePlayerInstance(final MediaPlayer mediaPlayer) { return new GVRVideoSceneObjectPlayer<MediaPlayer>() { @Override public MediaPlayer getPlayer() { return mediaPlayer; } @Override public void setSurface(Surface surface) { mediaPlayer.setSurface(surface); } @Override public void release() { mediaPlayer.release(); } @Override public boolean canReleaseSurfaceImmediately() { return true; } @Override public void pause() { try { mediaPlayer.pause(); } catch (final IllegalStateException exc) { //intentionally ignored; might have been released already or never got to be //initialized } } @Override public void start() { mediaPlayer.start(); } @Override public boolean isPlaying() { return mediaPlayer.isPlaying(); } }; }
[ "public", "static", "GVRVideoSceneObjectPlayer", "<", "MediaPlayer", ">", "makePlayerInstance", "(", "final", "MediaPlayer", "mediaPlayer", ")", "{", "return", "new", "GVRVideoSceneObjectPlayer", "<", "MediaPlayer", ">", "(", ")", "{", "@", "Override", "public", "MediaPlayer", "getPlayer", "(", ")", "{", "return", "mediaPlayer", ";", "}", "@", "Override", "public", "void", "setSurface", "(", "Surface", "surface", ")", "{", "mediaPlayer", ".", "setSurface", "(", "surface", ")", ";", "}", "@", "Override", "public", "void", "release", "(", ")", "{", "mediaPlayer", ".", "release", "(", ")", ";", "}", "@", "Override", "public", "boolean", "canReleaseSurfaceImmediately", "(", ")", "{", "return", "true", ";", "}", "@", "Override", "public", "void", "pause", "(", ")", "{", "try", "{", "mediaPlayer", ".", "pause", "(", ")", ";", "}", "catch", "(", "final", "IllegalStateException", "exc", ")", "{", "//intentionally ignored; might have been released already or never got to be", "//initialized", "}", "}", "@", "Override", "public", "void", "start", "(", ")", "{", "mediaPlayer", ".", "start", "(", ")", ";", "}", "@", "Override", "public", "boolean", "isPlaying", "(", ")", "{", "return", "mediaPlayer", ".", "isPlaying", "(", ")", ";", "}", "}", ";", "}" ]
Creates a player wrapper for the Android MediaPlayer.
[ "Creates", "a", "player", "wrapper", "for", "the", "Android", "MediaPlayer", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRVideoSceneObject.java#L491-L533
161,650
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRTextViewSceneObject.java
GVRTextViewSceneObject.setRefreshFrequency
public void setRefreshFrequency(IntervalFrequency frequency) { if (NONE_REFRESH_INTERVAL == mRefreshInterval && IntervalFrequency.NONE != frequency) { // Install draw-frame listener if frequency is no longer NONE getGVRContext().unregisterDrawFrameListener(mFrameListener); getGVRContext().registerDrawFrameListener(mFrameListener); } switch (frequency) { case REALTIME: mRefreshInterval = REALTIME_REFRESH_INTERVAL; break; case HIGH: mRefreshInterval = HIGH_REFRESH_INTERVAL; break; case MEDIUM: mRefreshInterval = MEDIUM_REFRESH_INTERVAL; break; case LOW: mRefreshInterval = LOW_REFRESH_INTERVAL; break; case NONE: mRefreshInterval = NONE_REFRESH_INTERVAL; break; default: break; } }
java
public void setRefreshFrequency(IntervalFrequency frequency) { if (NONE_REFRESH_INTERVAL == mRefreshInterval && IntervalFrequency.NONE != frequency) { // Install draw-frame listener if frequency is no longer NONE getGVRContext().unregisterDrawFrameListener(mFrameListener); getGVRContext().registerDrawFrameListener(mFrameListener); } switch (frequency) { case REALTIME: mRefreshInterval = REALTIME_REFRESH_INTERVAL; break; case HIGH: mRefreshInterval = HIGH_REFRESH_INTERVAL; break; case MEDIUM: mRefreshInterval = MEDIUM_REFRESH_INTERVAL; break; case LOW: mRefreshInterval = LOW_REFRESH_INTERVAL; break; case NONE: mRefreshInterval = NONE_REFRESH_INTERVAL; break; default: break; } }
[ "public", "void", "setRefreshFrequency", "(", "IntervalFrequency", "frequency", ")", "{", "if", "(", "NONE_REFRESH_INTERVAL", "==", "mRefreshInterval", "&&", "IntervalFrequency", ".", "NONE", "!=", "frequency", ")", "{", "// Install draw-frame listener if frequency is no longer NONE", "getGVRContext", "(", ")", ".", "unregisterDrawFrameListener", "(", "mFrameListener", ")", ";", "getGVRContext", "(", ")", ".", "registerDrawFrameListener", "(", "mFrameListener", ")", ";", "}", "switch", "(", "frequency", ")", "{", "case", "REALTIME", ":", "mRefreshInterval", "=", "REALTIME_REFRESH_INTERVAL", ";", "break", ";", "case", "HIGH", ":", "mRefreshInterval", "=", "HIGH_REFRESH_INTERVAL", ";", "break", ";", "case", "MEDIUM", ":", "mRefreshInterval", "=", "MEDIUM_REFRESH_INTERVAL", ";", "break", ";", "case", "LOW", ":", "mRefreshInterval", "=", "LOW_REFRESH_INTERVAL", ";", "break", ";", "case", "NONE", ":", "mRefreshInterval", "=", "NONE_REFRESH_INTERVAL", ";", "break", ";", "default", ":", "break", ";", "}", "}" ]
Set the refresh frequency of this scene object. Use NONE for improved performance when the text is set initially and never changed. @param frequency The refresh frequency of this TextViewSceneObject.
[ "Set", "the", "refresh", "frequency", "of", "this", "scene", "object", ".", "Use", "NONE", "for", "improved", "performance", "when", "the", "text", "is", "set", "initially", "and", "never", "changed", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRTextViewSceneObject.java#L594-L619
161,651
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRTextViewSceneObject.java
GVRTextViewSceneObject.getRefreshFrequency
public IntervalFrequency getRefreshFrequency() { switch (mRefreshInterval) { case REALTIME_REFRESH_INTERVAL: return IntervalFrequency.REALTIME; case HIGH_REFRESH_INTERVAL: return IntervalFrequency.HIGH; case LOW_REFRESH_INTERVAL: return IntervalFrequency.LOW; case MEDIUM_REFRESH_INTERVAL: return IntervalFrequency.MEDIUM; default: return IntervalFrequency.NONE; } }
java
public IntervalFrequency getRefreshFrequency() { switch (mRefreshInterval) { case REALTIME_REFRESH_INTERVAL: return IntervalFrequency.REALTIME; case HIGH_REFRESH_INTERVAL: return IntervalFrequency.HIGH; case LOW_REFRESH_INTERVAL: return IntervalFrequency.LOW; case MEDIUM_REFRESH_INTERVAL: return IntervalFrequency.MEDIUM; default: return IntervalFrequency.NONE; } }
[ "public", "IntervalFrequency", "getRefreshFrequency", "(", ")", "{", "switch", "(", "mRefreshInterval", ")", "{", "case", "REALTIME_REFRESH_INTERVAL", ":", "return", "IntervalFrequency", ".", "REALTIME", ";", "case", "HIGH_REFRESH_INTERVAL", ":", "return", "IntervalFrequency", ".", "HIGH", ";", "case", "LOW_REFRESH_INTERVAL", ":", "return", "IntervalFrequency", ".", "LOW", ";", "case", "MEDIUM_REFRESH_INTERVAL", ":", "return", "IntervalFrequency", ".", "MEDIUM", ";", "default", ":", "return", "IntervalFrequency", ".", "NONE", ";", "}", "}" ]
Get the refresh frequency of this scene object. @return The refresh frequency of this TextViewSceneObject.
[ "Get", "the", "refresh", "frequency", "of", "this", "scene", "object", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRTextViewSceneObject.java#L627-L640
161,652
Samsung/GearVRf
GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRPlaneEmitter.java
GVRPlaneEmitter.generateParticleVelocities
private float[] generateParticleVelocities() { float velocities[] = new float[mEmitRate * 3]; for ( int i = 0; i < mEmitRate * 3; i +=3 ) { Vector3f nexVel = getNextVelocity(); velocities[i] = nexVel.x; velocities[i+1] = nexVel.y; velocities[i+2] = nexVel.z; } return velocities; }
java
private float[] generateParticleVelocities() { float velocities[] = new float[mEmitRate * 3]; for ( int i = 0; i < mEmitRate * 3; i +=3 ) { Vector3f nexVel = getNextVelocity(); velocities[i] = nexVel.x; velocities[i+1] = nexVel.y; velocities[i+2] = nexVel.z; } return velocities; }
[ "private", "float", "[", "]", "generateParticleVelocities", "(", ")", "{", "float", "velocities", "[", "]", "=", "new", "float", "[", "mEmitRate", "*", "3", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mEmitRate", "*", "3", ";", "i", "+=", "3", ")", "{", "Vector3f", "nexVel", "=", "getNextVelocity", "(", ")", ";", "velocities", "[", "i", "]", "=", "nexVel", ".", "x", ";", "velocities", "[", "i", "+", "1", "]", "=", "nexVel", ".", "y", ";", "velocities", "[", "i", "+", "2", "]", "=", "nexVel", ".", "z", ";", "}", "return", "velocities", ";", "}" ]
generate random velocities in the given range @return
[ "generate", "random", "velocities", "in", "the", "given", "range" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRPlaneEmitter.java#L86-L97
161,653
Samsung/GearVRf
GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRPlaneEmitter.java
GVRPlaneEmitter.generateParticleTimeStamps
private float[] generateParticleTimeStamps(float totalTime) { float timeStamps[] = new float[mEmitRate * 2]; for ( int i = 0; i < mEmitRate * 2; i +=2 ) { timeStamps[i] = totalTime + mRandom.nextFloat(); timeStamps[i + 1] = 0; } return timeStamps; }
java
private float[] generateParticleTimeStamps(float totalTime) { float timeStamps[] = new float[mEmitRate * 2]; for ( int i = 0; i < mEmitRate * 2; i +=2 ) { timeStamps[i] = totalTime + mRandom.nextFloat(); timeStamps[i + 1] = 0; } return timeStamps; }
[ "private", "float", "[", "]", "generateParticleTimeStamps", "(", "float", "totalTime", ")", "{", "float", "timeStamps", "[", "]", "=", "new", "float", "[", "mEmitRate", "*", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mEmitRate", "*", "2", ";", "i", "+=", "2", ")", "{", "timeStamps", "[", "i", "]", "=", "totalTime", "+", "mRandom", ".", "nextFloat", "(", ")", ";", "timeStamps", "[", "i", "+", "1", "]", "=", "0", ";", "}", "return", "timeStamps", ";", "}" ]
Generate random time stamps from the current time upto the next one second. Passed as texture coordinates to the vertex shader, an unused field is present with every pair passed. @param totalTime @return
[ "Generate", "random", "time", "stamps", "from", "the", "current", "time", "upto", "the", "next", "one", "second", ".", "Passed", "as", "texture", "coordinates", "to", "the", "vertex", "shader", "an", "unused", "field", "is", "present", "with", "every", "pair", "passed", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRPlaneEmitter.java#L107-L116
161,654
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/WidgetLib.java
WidgetLib.init
public static WidgetLib init(GVRContext gvrContext, String customPropertiesAsset) throws InterruptedException, JSONException, NoSuchMethodException { if (mInstance == null) { // Constructor sets mInstance to ensure the initialization order new WidgetLib(gvrContext, customPropertiesAsset); } return mInstance.get(); }
java
public static WidgetLib init(GVRContext gvrContext, String customPropertiesAsset) throws InterruptedException, JSONException, NoSuchMethodException { if (mInstance == null) { // Constructor sets mInstance to ensure the initialization order new WidgetLib(gvrContext, customPropertiesAsset); } return mInstance.get(); }
[ "public", "static", "WidgetLib", "init", "(", "GVRContext", "gvrContext", ",", "String", "customPropertiesAsset", ")", "throws", "InterruptedException", ",", "JSONException", ",", "NoSuchMethodException", "{", "if", "(", "mInstance", "==", "null", ")", "{", "// Constructor sets mInstance to ensure the initialization order", "new", "WidgetLib", "(", "gvrContext", ",", "customPropertiesAsset", ")", ";", "}", "return", "mInstance", ".", "get", "(", ")", ";", "}" ]
Initialize an instance of Widget Lib. It has to be done before any usage of library. The application needs to hold onto the returned WidgetLib reference for as long as the library is going to be used. @param gvrContext A valid {@link GVRContext} instance @param customPropertiesAsset An optional asset JSON file containing custom and overridden properties for the application @return Instance of Widget library @throws InterruptedException @throws JSONException @throws NoSuchMethodException
[ "Initialize", "an", "instance", "of", "Widget", "Lib", ".", "It", "has", "to", "be", "done", "before", "any", "usage", "of", "library", ".", "The", "application", "needs", "to", "hold", "onto", "the", "returned", "WidgetLib", "reference", "for", "as", "long", "as", "the", "library", "is", "going", "to", "be", "used", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/WidgetLib.java#L49-L56
161,655
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java
AnimationInteractivityManager.BuildInteractiveObjectFromAnchor
public void BuildInteractiveObjectFromAnchor(Sensor anchorSensor, String anchorDestination) { InteractiveObject interactiveObject = new InteractiveObject(); interactiveObject.setSensor(anchorSensor, anchorDestination); interactiveObjects.add(interactiveObject); }
java
public void BuildInteractiveObjectFromAnchor(Sensor anchorSensor, String anchorDestination) { InteractiveObject interactiveObject = new InteractiveObject(); interactiveObject.setSensor(anchorSensor, anchorDestination); interactiveObjects.add(interactiveObject); }
[ "public", "void", "BuildInteractiveObjectFromAnchor", "(", "Sensor", "anchorSensor", ",", "String", "anchorDestination", ")", "{", "InteractiveObject", "interactiveObject", "=", "new", "InteractiveObject", "(", ")", ";", "interactiveObject", ".", "setSensor", "(", "anchorSensor", ",", "anchorDestination", ")", ";", "interactiveObjects", ".", "add", "(", "interactiveObject", ")", ";", "}" ]
BuildInteractiveObjectFromAnchor is a special type of interactive object in that it does not get built using ROUTE's. @param anchorSensor is the Sensor that describes the sensor set to an Anchor @param anchorDestination is either another Viewpoint, url to a web site or another x3d scene
[ "BuildInteractiveObjectFromAnchor", "is", "a", "special", "type", "of", "interactive", "object", "in", "that", "it", "does", "not", "get", "built", "using", "ROUTE", "s", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java#L502-L506
161,656
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java
AnimationInteractivityManager.RunScript
private void RunScript(InteractiveObject interactiveObject, String functionName, Object[] parameters) { boolean complete = false; if ( V8JavaScriptEngine) { GVRJavascriptV8File gvrJavascriptV8File = interactiveObject.getScriptObject().getGVRJavascriptV8File(); String paramString = "var params =["; for (int i = 0; i < parameters.length; i++ ) { paramString += (parameters[i] + ", "); } paramString = paramString.substring(0, (paramString.length()-2)) + "];"; final GVRJavascriptV8File gvrJavascriptV8FileFinal = gvrJavascriptV8File; final InteractiveObject interactiveObjectFinal = interactiveObject; final String functionNameFinal = functionName; final Object[] parametersFinal = parameters; final String paramStringFinal = paramString; gvrContext.runOnGlThread(new Runnable() { @Override public void run() { RunScriptThread (gvrJavascriptV8FileFinal, interactiveObjectFinal, functionNameFinal, parametersFinal, paramStringFinal); } }); } // end V8JavaScriptEngine else { // Mozilla Rhino engine GVRJavascriptScriptFile gvrJavascriptFile = interactiveObject.getScriptObject().getGVRJavascriptScriptFile(); complete = gvrJavascriptFile.invokeFunction(functionName, parameters); if (complete) { // The JavaScript (JS) ran. Now get the return // values (saved as X3D data types such as SFColor) // stored in 'localBindings'. // Then call SetResultsFromScript() to set the GearVR values Bindings localBindings = gvrJavascriptFile.getLocalBindings(); SetResultsFromScript(interactiveObject, localBindings); } else { Log.e(TAG, "Error in SCRIPT node '" + interactiveObject.getScriptObject().getName() + "' running Rhino Engine JavaScript function '" + functionName + "'"); } } }
java
private void RunScript(InteractiveObject interactiveObject, String functionName, Object[] parameters) { boolean complete = false; if ( V8JavaScriptEngine) { GVRJavascriptV8File gvrJavascriptV8File = interactiveObject.getScriptObject().getGVRJavascriptV8File(); String paramString = "var params =["; for (int i = 0; i < parameters.length; i++ ) { paramString += (parameters[i] + ", "); } paramString = paramString.substring(0, (paramString.length()-2)) + "];"; final GVRJavascriptV8File gvrJavascriptV8FileFinal = gvrJavascriptV8File; final InteractiveObject interactiveObjectFinal = interactiveObject; final String functionNameFinal = functionName; final Object[] parametersFinal = parameters; final String paramStringFinal = paramString; gvrContext.runOnGlThread(new Runnable() { @Override public void run() { RunScriptThread (gvrJavascriptV8FileFinal, interactiveObjectFinal, functionNameFinal, parametersFinal, paramStringFinal); } }); } // end V8JavaScriptEngine else { // Mozilla Rhino engine GVRJavascriptScriptFile gvrJavascriptFile = interactiveObject.getScriptObject().getGVRJavascriptScriptFile(); complete = gvrJavascriptFile.invokeFunction(functionName, parameters); if (complete) { // The JavaScript (JS) ran. Now get the return // values (saved as X3D data types such as SFColor) // stored in 'localBindings'. // Then call SetResultsFromScript() to set the GearVR values Bindings localBindings = gvrJavascriptFile.getLocalBindings(); SetResultsFromScript(interactiveObject, localBindings); } else { Log.e(TAG, "Error in SCRIPT node '" + interactiveObject.getScriptObject().getName() + "' running Rhino Engine JavaScript function '" + functionName + "'"); } } }
[ "private", "void", "RunScript", "(", "InteractiveObject", "interactiveObject", ",", "String", "functionName", ",", "Object", "[", "]", "parameters", ")", "{", "boolean", "complete", "=", "false", ";", "if", "(", "V8JavaScriptEngine", ")", "{", "GVRJavascriptV8File", "gvrJavascriptV8File", "=", "interactiveObject", ".", "getScriptObject", "(", ")", ".", "getGVRJavascriptV8File", "(", ")", ";", "String", "paramString", "=", "\"var params =[\"", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameters", ".", "length", ";", "i", "++", ")", "{", "paramString", "+=", "(", "parameters", "[", "i", "]", "+", "\", \"", ")", ";", "}", "paramString", "=", "paramString", ".", "substring", "(", "0", ",", "(", "paramString", ".", "length", "(", ")", "-", "2", ")", ")", "+", "\"];\"", ";", "final", "GVRJavascriptV8File", "gvrJavascriptV8FileFinal", "=", "gvrJavascriptV8File", ";", "final", "InteractiveObject", "interactiveObjectFinal", "=", "interactiveObject", ";", "final", "String", "functionNameFinal", "=", "functionName", ";", "final", "Object", "[", "]", "parametersFinal", "=", "parameters", ";", "final", "String", "paramStringFinal", "=", "paramString", ";", "gvrContext", ".", "runOnGlThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "RunScriptThread", "(", "gvrJavascriptV8FileFinal", ",", "interactiveObjectFinal", ",", "functionNameFinal", ",", "parametersFinal", ",", "paramStringFinal", ")", ";", "}", "}", ")", ";", "}", "// end V8JavaScriptEngine", "else", "{", "// Mozilla Rhino engine", "GVRJavascriptScriptFile", "gvrJavascriptFile", "=", "interactiveObject", ".", "getScriptObject", "(", ")", ".", "getGVRJavascriptScriptFile", "(", ")", ";", "complete", "=", "gvrJavascriptFile", ".", "invokeFunction", "(", "functionName", ",", "parameters", ")", ";", "if", "(", "complete", ")", "{", "// The JavaScript (JS) ran. Now get the return", "// values (saved as X3D data types such as SFColor)", "// stored in 'localBindings'.", "// Then call SetResultsFromScript() to set the GearVR values", "Bindings", "localBindings", "=", "gvrJavascriptFile", ".", "getLocalBindings", "(", ")", ";", "SetResultsFromScript", "(", "interactiveObject", ",", "localBindings", ")", ";", "}", "else", "{", "Log", ".", "e", "(", "TAG", ",", "\"Error in SCRIPT node '\"", "+", "interactiveObject", ".", "getScriptObject", "(", ")", ".", "getName", "(", ")", "+", "\"' running Rhino Engine JavaScript function '\"", "+", "functionName", "+", "\"'\"", ")", ";", "}", "}", "}" ]
Run the JavaScript program, Output saved in localBindings
[ "Run", "the", "JavaScript", "program", "Output", "saved", "in", "localBindings" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java#L2210-L2249
161,657
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java
AnimationInteractivityManager.ConvertDirectionalVectorToQuaternion
public Quaternionf ConvertDirectionalVectorToQuaternion(Vector3f d) { d.negate(); Quaternionf q = new Quaternionf(); // check for exception condition if ((d.x == 0) && (d.z == 0)) { // exception condition if direction is (0,y,0): // straight up, straight down or all zero's. if (d.y > 0) { // direction straight up AxisAngle4f angleAxis = new AxisAngle4f(-(float) Math.PI / 2, 1, 0, 0); q.set(angleAxis); } else if (d.y < 0) { // direction straight down AxisAngle4f angleAxis = new AxisAngle4f((float) Math.PI / 2, 1, 0, 0); q.set(angleAxis); } else { // All zero's. Just set to identity quaternion q.identity(); } } else { d.normalize(); Vector3f up = new Vector3f(0, 1, 0); Vector3f s = new Vector3f(); d.cross(up, s); s.normalize(); Vector3f u = new Vector3f(); d.cross(s, u); u.normalize(); Matrix4f matrix = new Matrix4f(s.x, s.y, s.z, 0, u.x, u.y, u.z, 0, d.x, d.y, d.z, 0, 0, 0, 0, 1); q.setFromNormalized(matrix); } return q; }
java
public Quaternionf ConvertDirectionalVectorToQuaternion(Vector3f d) { d.negate(); Quaternionf q = new Quaternionf(); // check for exception condition if ((d.x == 0) && (d.z == 0)) { // exception condition if direction is (0,y,0): // straight up, straight down or all zero's. if (d.y > 0) { // direction straight up AxisAngle4f angleAxis = new AxisAngle4f(-(float) Math.PI / 2, 1, 0, 0); q.set(angleAxis); } else if (d.y < 0) { // direction straight down AxisAngle4f angleAxis = new AxisAngle4f((float) Math.PI / 2, 1, 0, 0); q.set(angleAxis); } else { // All zero's. Just set to identity quaternion q.identity(); } } else { d.normalize(); Vector3f up = new Vector3f(0, 1, 0); Vector3f s = new Vector3f(); d.cross(up, s); s.normalize(); Vector3f u = new Vector3f(); d.cross(s, u); u.normalize(); Matrix4f matrix = new Matrix4f(s.x, s.y, s.z, 0, u.x, u.y, u.z, 0, d.x, d.y, d.z, 0, 0, 0, 0, 1); q.setFromNormalized(matrix); } return q; }
[ "public", "Quaternionf", "ConvertDirectionalVectorToQuaternion", "(", "Vector3f", "d", ")", "{", "d", ".", "negate", "(", ")", ";", "Quaternionf", "q", "=", "new", "Quaternionf", "(", ")", ";", "// check for exception condition", "if", "(", "(", "d", ".", "x", "==", "0", ")", "&&", "(", "d", ".", "z", "==", "0", ")", ")", "{", "// exception condition if direction is (0,y,0):", "// straight up, straight down or all zero's.", "if", "(", "d", ".", "y", ">", "0", ")", "{", "// direction straight up", "AxisAngle4f", "angleAxis", "=", "new", "AxisAngle4f", "(", "-", "(", "float", ")", "Math", ".", "PI", "/", "2", ",", "1", ",", "0", ",", "0", ")", ";", "q", ".", "set", "(", "angleAxis", ")", ";", "}", "else", "if", "(", "d", ".", "y", "<", "0", ")", "{", "// direction straight down", "AxisAngle4f", "angleAxis", "=", "new", "AxisAngle4f", "(", "(", "float", ")", "Math", ".", "PI", "/", "2", ",", "1", ",", "0", ",", "0", ")", ";", "q", ".", "set", "(", "angleAxis", ")", ";", "}", "else", "{", "// All zero's. Just set to identity quaternion", "q", ".", "identity", "(", ")", ";", "}", "}", "else", "{", "d", ".", "normalize", "(", ")", ";", "Vector3f", "up", "=", "new", "Vector3f", "(", "0", ",", "1", ",", "0", ")", ";", "Vector3f", "s", "=", "new", "Vector3f", "(", ")", ";", "d", ".", "cross", "(", "up", ",", "s", ")", ";", "s", ".", "normalize", "(", ")", ";", "Vector3f", "u", "=", "new", "Vector3f", "(", ")", ";", "d", ".", "cross", "(", "s", ",", "u", ")", ";", "u", ".", "normalize", "(", ")", ";", "Matrix4f", "matrix", "=", "new", "Matrix4f", "(", "s", ".", "x", ",", "s", ".", "y", ",", "s", ".", "z", ",", "0", ",", "u", ".", "x", ",", "u", ".", "y", ",", "u", ".", "z", ",", "0", ",", "d", ".", "x", ",", "d", ".", "y", ",", "d", ".", "z", ",", "0", ",", "0", ",", "0", ",", "0", ",", "1", ")", ";", "q", ".", "setFromNormalized", "(", "matrix", ")", ";", "}", "return", "q", ";", "}" ]
Converts a vector into a quaternion. Used for the direction of spot and directional lights Called upon initialization and updates to those vectors @param d
[ "Converts", "a", "vector", "into", "a", "quaternion", ".", "Used", "for", "the", "direction", "of", "spot", "and", "directional", "lights", "Called", "upon", "initialization", "and", "updates", "to", "those", "vectors" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/AnimationInteractivityManager.java#L2701-L2732
161,658
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java
FPSCounter.count
public static void count() { long duration = SystemClock.uptimeMillis() - startTime; float avgFPS = sumFrames / (duration / 1000f); Log.v("FPSCounter", "total frames = %d, total elapsed time = %d ms, average fps = %f", sumFrames, duration, avgFPS); }
java
public static void count() { long duration = SystemClock.uptimeMillis() - startTime; float avgFPS = sumFrames / (duration / 1000f); Log.v("FPSCounter", "total frames = %d, total elapsed time = %d ms, average fps = %f", sumFrames, duration, avgFPS); }
[ "public", "static", "void", "count", "(", ")", "{", "long", "duration", "=", "SystemClock", ".", "uptimeMillis", "(", ")", "-", "startTime", ";", "float", "avgFPS", "=", "sumFrames", "/", "(", "duration", "/", "1000f", ")", ";", "Log", ".", "v", "(", "\"FPSCounter\"", ",", "\"total frames = %d, total elapsed time = %d ms, average fps = %f\"", ",", "sumFrames", ",", "duration", ",", "avgFPS", ")", ";", "}" ]
Computes FPS average
[ "Computes", "FPS", "average" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java#L35-L42
161,659
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java
FPSCounter.startCheck
public static void startCheck(String extra) { startCheckTime = System.currentTimeMillis(); nextCheckTime = startCheckTime; Log.d(Log.SUBSYSTEM.TRACING, "FPSCounter" , "[%d] startCheck %s", startCheckTime, extra); }
java
public static void startCheck(String extra) { startCheckTime = System.currentTimeMillis(); nextCheckTime = startCheckTime; Log.d(Log.SUBSYSTEM.TRACING, "FPSCounter" , "[%d] startCheck %s", startCheckTime, extra); }
[ "public", "static", "void", "startCheck", "(", "String", "extra", ")", "{", "startCheckTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "nextCheckTime", "=", "startCheckTime", ";", "Log", ".", "d", "(", "Log", ".", "SUBSYSTEM", ".", "TRACING", ",", "\"FPSCounter\"", ",", "\"[%d] startCheck %s\"", ",", "startCheckTime", ",", "extra", ")", ";", "}" ]
Start check of execution time @param extra
[ "Start", "check", "of", "execution", "time" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java#L56-L60
161,660
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java
FPSCounter.timeCheck
public static void timeCheck(String extra) { if (startCheckTime > 0) { long now = System.currentTimeMillis(); long diff = now - nextCheckTime; nextCheckTime = now; Log.d(Log.SUBSYSTEM.TRACING, "FPSCounter", "[%d, %d] timeCheck: %s", now, diff, extra); } }
java
public static void timeCheck(String extra) { if (startCheckTime > 0) { long now = System.currentTimeMillis(); long diff = now - nextCheckTime; nextCheckTime = now; Log.d(Log.SUBSYSTEM.TRACING, "FPSCounter", "[%d, %d] timeCheck: %s", now, diff, extra); } }
[ "public", "static", "void", "timeCheck", "(", "String", "extra", ")", "{", "if", "(", "startCheckTime", ">", "0", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "diff", "=", "now", "-", "nextCheckTime", ";", "nextCheckTime", "=", "now", ";", "Log", ".", "d", "(", "Log", ".", "SUBSYSTEM", ".", "TRACING", ",", "\"FPSCounter\"", ",", "\"[%d, %d] timeCheck: %s\"", ",", "now", ",", "diff", ",", "extra", ")", ";", "}", "}" ]
Computes execution time @param extra
[ "Computes", "execution", "time" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/thread/FPSCounter.java#L66-L73
161,661
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRMorphAnimation.java
GVRMorphAnimation.animate
public void animate(GVRHybridObject object, float animationTime) { GVRMeshMorph morph = (GVRMeshMorph) mTarget; mKeyInterpolator.animate(animationTime * mDuration, mCurrentValues); morph.setWeights(mCurrentValues); }
java
public void animate(GVRHybridObject object, float animationTime) { GVRMeshMorph morph = (GVRMeshMorph) mTarget; mKeyInterpolator.animate(animationTime * mDuration, mCurrentValues); morph.setWeights(mCurrentValues); }
[ "public", "void", "animate", "(", "GVRHybridObject", "object", ",", "float", "animationTime", ")", "{", "GVRMeshMorph", "morph", "=", "(", "GVRMeshMorph", ")", "mTarget", ";", "mKeyInterpolator", ".", "animate", "(", "animationTime", "*", "mDuration", ",", "mCurrentValues", ")", ";", "morph", ".", "setWeights", "(", "mCurrentValues", ")", ";", "}" ]
Computes the blend weights for the given time and updates them in the target.
[ "Computes", "the", "blend", "weights", "for", "the", "given", "time", "and", "updates", "them", "in", "the", "target", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRMorphAnimation.java#L55-L62
161,662
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLODGroup.java
GVRLODGroup.addRange
public synchronized void addRange(final float range, final GVRSceneObject sceneObject) { if (null == sceneObject) { throw new IllegalArgumentException("sceneObject must be specified!"); } if (range < 0) { throw new IllegalArgumentException("range cannot be negative"); } final int size = mRanges.size(); final float rangePow2 = range*range; final Object[] newElement = new Object[] {rangePow2, sceneObject}; for (int i = 0; i < size; ++i) { final Object[] el = mRanges.get(i); final Float r = (Float)el[0]; if (r > rangePow2) { mRanges.add(i, newElement); break; } } if (mRanges.size() == size) { mRanges.add(newElement); } final GVRSceneObject owner = getOwnerObject(); if (null != owner) { owner.addChildObject(sceneObject); } }
java
public synchronized void addRange(final float range, final GVRSceneObject sceneObject) { if (null == sceneObject) { throw new IllegalArgumentException("sceneObject must be specified!"); } if (range < 0) { throw new IllegalArgumentException("range cannot be negative"); } final int size = mRanges.size(); final float rangePow2 = range*range; final Object[] newElement = new Object[] {rangePow2, sceneObject}; for (int i = 0; i < size; ++i) { final Object[] el = mRanges.get(i); final Float r = (Float)el[0]; if (r > rangePow2) { mRanges.add(i, newElement); break; } } if (mRanges.size() == size) { mRanges.add(newElement); } final GVRSceneObject owner = getOwnerObject(); if (null != owner) { owner.addChildObject(sceneObject); } }
[ "public", "synchronized", "void", "addRange", "(", "final", "float", "range", ",", "final", "GVRSceneObject", "sceneObject", ")", "{", "if", "(", "null", "==", "sceneObject", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"sceneObject must be specified!\"", ")", ";", "}", "if", "(", "range", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"range cannot be negative\"", ")", ";", "}", "final", "int", "size", "=", "mRanges", ".", "size", "(", ")", ";", "final", "float", "rangePow2", "=", "range", "*", "range", ";", "final", "Object", "[", "]", "newElement", "=", "new", "Object", "[", "]", "{", "rangePow2", ",", "sceneObject", "}", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "++", "i", ")", "{", "final", "Object", "[", "]", "el", "=", "mRanges", ".", "get", "(", "i", ")", ";", "final", "Float", "r", "=", "(", "Float", ")", "el", "[", "0", "]", ";", "if", "(", "r", ">", "rangePow2", ")", "{", "mRanges", ".", "add", "(", "i", ",", "newElement", ")", ";", "break", ";", "}", "}", "if", "(", "mRanges", ".", "size", "(", ")", "==", "size", ")", "{", "mRanges", ".", "add", "(", "newElement", ")", ";", "}", "final", "GVRSceneObject", "owner", "=", "getOwnerObject", "(", ")", ";", "if", "(", "null", "!=", "owner", ")", "{", "owner", ".", "addChildObject", "(", "sceneObject", ")", ";", "}", "}" ]
Add a range to this LOD group. Specify the scene object that should be displayed in this range. Add the LOG group as a component to the parent scene object. The scene objects associated with each range will automatically be added as children to the parent. @param range show the scene object if the camera distance is greater than this value @param sceneObject scene object that should be rendered when in this range @throws IllegalArgumentException if range is negative or sceneObject null
[ "Add", "a", "range", "to", "this", "LOD", "group", ".", "Specify", "the", "scene", "object", "that", "should", "be", "displayed", "in", "this", "range", ".", "Add", "the", "LOG", "group", "as", "a", "component", "to", "the", "parent", "scene", "object", ".", "The", "scene", "objects", "associated", "with", "each", "range", "will", "automatically", "be", "added", "as", "children", "to", "the", "parent", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLODGroup.java#L64-L94
161,663
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLODGroup.java
GVRLODGroup.onDrawFrame
public void onDrawFrame(float frameTime) { final GVRSceneObject owner = getOwnerObject(); if (owner == null) { return; } final int size = mRanges.size(); final GVRTransform t = getGVRContext().getMainScene().getMainCameraRig().getCenterCamera().getTransform(); for (final Object[] range : mRanges) { ((GVRSceneObject)range[1]).setEnable(false); } for (int i = size - 1; i >= 0; --i) { final Object[] range = mRanges.get(i); final GVRSceneObject child = (GVRSceneObject) range[1]; if (child.getParent() != owner) { Log.w(TAG, "the scene object for distance greater than " + range[0] + " is not a child of the owner; skipping it"); continue; } final float[] values = child.getBoundingVolumeRawValues(); mCenter.set(values[0], values[1], values[2], 1.0f); mVector.set(t.getPositionX(), t.getPositionY(), t.getPositionZ(), 1.0f); mVector.sub(mCenter); mVector.negate(); float distance = mVector.dot(mVector); if (distance >= (Float) range[0]) { child.setEnable(true); break; } } }
java
public void onDrawFrame(float frameTime) { final GVRSceneObject owner = getOwnerObject(); if (owner == null) { return; } final int size = mRanges.size(); final GVRTransform t = getGVRContext().getMainScene().getMainCameraRig().getCenterCamera().getTransform(); for (final Object[] range : mRanges) { ((GVRSceneObject)range[1]).setEnable(false); } for (int i = size - 1; i >= 0; --i) { final Object[] range = mRanges.get(i); final GVRSceneObject child = (GVRSceneObject) range[1]; if (child.getParent() != owner) { Log.w(TAG, "the scene object for distance greater than " + range[0] + " is not a child of the owner; skipping it"); continue; } final float[] values = child.getBoundingVolumeRawValues(); mCenter.set(values[0], values[1], values[2], 1.0f); mVector.set(t.getPositionX(), t.getPositionY(), t.getPositionZ(), 1.0f); mVector.sub(mCenter); mVector.negate(); float distance = mVector.dot(mVector); if (distance >= (Float) range[0]) { child.setEnable(true); break; } } }
[ "public", "void", "onDrawFrame", "(", "float", "frameTime", ")", "{", "final", "GVRSceneObject", "owner", "=", "getOwnerObject", "(", ")", ";", "if", "(", "owner", "==", "null", ")", "{", "return", ";", "}", "final", "int", "size", "=", "mRanges", ".", "size", "(", ")", ";", "final", "GVRTransform", "t", "=", "getGVRContext", "(", ")", ".", "getMainScene", "(", ")", ".", "getMainCameraRig", "(", ")", ".", "getCenterCamera", "(", ")", ".", "getTransform", "(", ")", ";", "for", "(", "final", "Object", "[", "]", "range", ":", "mRanges", ")", "{", "(", "(", "GVRSceneObject", ")", "range", "[", "1", "]", ")", ".", "setEnable", "(", "false", ")", ";", "}", "for", "(", "int", "i", "=", "size", "-", "1", ";", "i", ">=", "0", ";", "--", "i", ")", "{", "final", "Object", "[", "]", "range", "=", "mRanges", ".", "get", "(", "i", ")", ";", "final", "GVRSceneObject", "child", "=", "(", "GVRSceneObject", ")", "range", "[", "1", "]", ";", "if", "(", "child", ".", "getParent", "(", ")", "!=", "owner", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"the scene object for distance greater than \"", "+", "range", "[", "0", "]", "+", "\" is not a child of the owner; skipping it\"", ")", ";", "continue", ";", "}", "final", "float", "[", "]", "values", "=", "child", ".", "getBoundingVolumeRawValues", "(", ")", ";", "mCenter", ".", "set", "(", "values", "[", "0", "]", ",", "values", "[", "1", "]", ",", "values", "[", "2", "]", ",", "1.0f", ")", ";", "mVector", ".", "set", "(", "t", ".", "getPositionX", "(", ")", ",", "t", ".", "getPositionY", "(", ")", ",", "t", ".", "getPositionZ", "(", ")", ",", "1.0f", ")", ";", "mVector", ".", "sub", "(", "mCenter", ")", ";", "mVector", ".", "negate", "(", ")", ";", "float", "distance", "=", "mVector", ".", "dot", "(", "mVector", ")", ";", "if", "(", "distance", ">=", "(", "Float", ")", "range", "[", "0", "]", ")", "{", "child", ".", "setEnable", "(", "true", ")", ";", "break", ";", "}", "}", "}" ]
Do not call directly. @deprecated
[ "Do", "not", "call", "directly", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRLODGroup.java#L100-L135
161,664
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java
ShellFactory.createConsoleShell
public static Shell createConsoleShell(String prompt, String appName, Object... handlers) { ConsoleIO io = new ConsoleIO(); List<String> path = new ArrayList<String>(1); path.add(prompt); MultiMap<String, Object> modifAuxHandlers = new ArrayHashMultiMap<String, Object>(); modifAuxHandlers.put("!", io); Shell theShell = new Shell(new Shell.Settings(io, io, modifAuxHandlers, false), new CommandTable(new DashJoinedNamer(true)), path); theShell.setAppName(appName); theShell.addMainHandler(theShell, "!"); theShell.addMainHandler(new HelpCommandHandler(), "?"); for (Object h : handlers) { theShell.addMainHandler(h, ""); } return theShell; }
java
public static Shell createConsoleShell(String prompt, String appName, Object... handlers) { ConsoleIO io = new ConsoleIO(); List<String> path = new ArrayList<String>(1); path.add(prompt); MultiMap<String, Object> modifAuxHandlers = new ArrayHashMultiMap<String, Object>(); modifAuxHandlers.put("!", io); Shell theShell = new Shell(new Shell.Settings(io, io, modifAuxHandlers, false), new CommandTable(new DashJoinedNamer(true)), path); theShell.setAppName(appName); theShell.addMainHandler(theShell, "!"); theShell.addMainHandler(new HelpCommandHandler(), "?"); for (Object h : handlers) { theShell.addMainHandler(h, ""); } return theShell; }
[ "public", "static", "Shell", "createConsoleShell", "(", "String", "prompt", ",", "String", "appName", ",", "Object", "...", "handlers", ")", "{", "ConsoleIO", "io", "=", "new", "ConsoleIO", "(", ")", ";", "List", "<", "String", ">", "path", "=", "new", "ArrayList", "<", "String", ">", "(", "1", ")", ";", "path", ".", "add", "(", "prompt", ")", ";", "MultiMap", "<", "String", ",", "Object", ">", "modifAuxHandlers", "=", "new", "ArrayHashMultiMap", "<", "String", ",", "Object", ">", "(", ")", ";", "modifAuxHandlers", ".", "put", "(", "\"!\"", ",", "io", ")", ";", "Shell", "theShell", "=", "new", "Shell", "(", "new", "Shell", ".", "Settings", "(", "io", ",", "io", ",", "modifAuxHandlers", ",", "false", ")", ",", "new", "CommandTable", "(", "new", "DashJoinedNamer", "(", "true", ")", ")", ",", "path", ")", ";", "theShell", ".", "setAppName", "(", "appName", ")", ";", "theShell", ".", "addMainHandler", "(", "theShell", ",", "\"!\"", ")", ";", "theShell", ".", "addMainHandler", "(", "new", "HelpCommandHandler", "(", ")", ",", "\"?\"", ")", ";", "for", "(", "Object", "h", ":", "handlers", ")", "{", "theShell", ".", "addMainHandler", "(", "h", ",", "\"\"", ")", ";", "}", "return", "theShell", ";", "}" ]
One of facade methods for operating the Shell. Run the obtained Shell with commandLoop(). @see org.gearvrf.debug.cli.Shell#Shell(org.gearvrf.debug.cli.Shell.Settings, org.gearvrf.debug.cli.CommandTable, java.util.List) @param prompt Prompt to be displayed @param appName The app name string @param handlers Command handlers @return Shell that can be either further customized or run directly by calling commandLoop().
[ "One", "of", "facade", "methods", "for", "operating", "the", "Shell", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L35-L55
161,665
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java
ShellFactory.createConsoleShell
public static Shell createConsoleShell(String prompt, String appName, Object mainHandler) { return createConsoleShell(prompt, appName, mainHandler, new EmptyMultiMap<String, Object>()); }
java
public static Shell createConsoleShell(String prompt, String appName, Object mainHandler) { return createConsoleShell(prompt, appName, mainHandler, new EmptyMultiMap<String, Object>()); }
[ "public", "static", "Shell", "createConsoleShell", "(", "String", "prompt", ",", "String", "appName", ",", "Object", "mainHandler", ")", "{", "return", "createConsoleShell", "(", "prompt", ",", "appName", ",", "mainHandler", ",", "new", "EmptyMultiMap", "<", "String", ",", "Object", ">", "(", ")", ")", ";", "}" ]
Facade method for operating the Shell. Run the obtained Shell with commandLoop(). @see org.gearvrf.debug.cli.Shell#Shell(org.gearvrf.debug.cli.Shell.Settings, org.gearvrf.debug.cli.CommandTable, java.util.List) @param prompt Prompt to be displayed @param appName The app name string @param mainHandler Command handler @return Shell that can be either further customized or run directly by calling commandLoop().
[ "Facade", "method", "for", "operating", "the", "Shell", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L104-L106
161,666
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java
ShellFactory.createSubshell
public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler, MultiMap<String, Object> auxHandlers) { List<String> newPath = new ArrayList<String>(parent.getPath()); newPath.add(pathElement); Shell subshell = new Shell(parent.getSettings().createWithAddedAuxHandlers(auxHandlers), new CommandTable(parent.getCommandTable().getNamer()), newPath); subshell.setAppName(appName); subshell.addMainHandler(subshell, "!"); subshell.addMainHandler(new HelpCommandHandler(), "?"); subshell.addMainHandler(mainHandler, ""); return subshell; }
java
public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler, MultiMap<String, Object> auxHandlers) { List<String> newPath = new ArrayList<String>(parent.getPath()); newPath.add(pathElement); Shell subshell = new Shell(parent.getSettings().createWithAddedAuxHandlers(auxHandlers), new CommandTable(parent.getCommandTable().getNamer()), newPath); subshell.setAppName(appName); subshell.addMainHandler(subshell, "!"); subshell.addMainHandler(new HelpCommandHandler(), "?"); subshell.addMainHandler(mainHandler, ""); return subshell; }
[ "public", "static", "Shell", "createSubshell", "(", "String", "pathElement", ",", "Shell", "parent", ",", "String", "appName", ",", "Object", "mainHandler", ",", "MultiMap", "<", "String", ",", "Object", ">", "auxHandlers", ")", "{", "List", "<", "String", ">", "newPath", "=", "new", "ArrayList", "<", "String", ">", "(", "parent", ".", "getPath", "(", ")", ")", ";", "newPath", ".", "add", "(", "pathElement", ")", ";", "Shell", "subshell", "=", "new", "Shell", "(", "parent", ".", "getSettings", "(", ")", ".", "createWithAddedAuxHandlers", "(", "auxHandlers", ")", ",", "new", "CommandTable", "(", "parent", ".", "getCommandTable", "(", ")", ".", "getNamer", "(", ")", ")", ",", "newPath", ")", ";", "subshell", ".", "setAppName", "(", "appName", ")", ";", "subshell", ".", "addMainHandler", "(", "subshell", ",", "\"!\"", ")", ";", "subshell", ".", "addMainHandler", "(", "new", "HelpCommandHandler", "(", ")", ",", "\"?\"", ")", ";", "subshell", ".", "addMainHandler", "(", "mainHandler", ",", "\"\"", ")", ";", "return", "subshell", ";", "}" ]
Facade method facilitating the creation of subshell. Subshell is created and run inside Command method and shares the same IO and naming strategy. Run the obtained Shell with commandLoop(). @param pathElement sub-prompt @param parent Shell to be subshell'd @param appName The app name string @param mainHandler Command handler @param auxHandlers Aux handlers to be passed to all subshells. @return subshell
[ "Facade", "method", "facilitating", "the", "creation", "of", "subshell", ".", "Subshell", "is", "created", "and", "run", "inside", "Command", "method", "and", "shares", "the", "same", "IO", "and", "naming", "strategy", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L121-L136
161,667
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java
ShellFactory.createSubshell
public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler) { return createSubshell(pathElement, parent, appName, mainHandler, new EmptyMultiMap<String, Object>()); }
java
public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler) { return createSubshell(pathElement, parent, appName, mainHandler, new EmptyMultiMap<String, Object>()); }
[ "public", "static", "Shell", "createSubshell", "(", "String", "pathElement", ",", "Shell", "parent", ",", "String", "appName", ",", "Object", "mainHandler", ")", "{", "return", "createSubshell", "(", "pathElement", ",", "parent", ",", "appName", ",", "mainHandler", ",", "new", "EmptyMultiMap", "<", "String", ",", "Object", ">", "(", ")", ")", ";", "}" ]
Facade method facilitating the creation of subshell. Subshell is created and run inside Command method and shares the same IO and naming strtategy. Run the obtained Shell with commandLoop(). @param pathElement sub-prompt @param parent Shell to be subshell'd @param appName The app name string @param mainHandler Command handler @return subshell
[ "Facade", "method", "facilitating", "the", "creation", "of", "subshell", ".", "Subshell", "is", "created", "and", "run", "inside", "Command", "method", "and", "shares", "the", "same", "IO", "and", "naming", "strtategy", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L150-L152
161,668
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java
GVRAnimationChannel.animate
public void animate(float animationTime, Matrix4f mat) { mRotInterpolator.animate(animationTime, mRotKey); mPosInterpolator.animate(animationTime, mPosKey); mSclInterpolator.animate(animationTime, mScaleKey); mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mRotKey[0], mRotKey[1], mRotKey[2], mRotKey[3], mScaleKey[0], mScaleKey[1], mScaleKey[2]); }
java
public void animate(float animationTime, Matrix4f mat) { mRotInterpolator.animate(animationTime, mRotKey); mPosInterpolator.animate(animationTime, mPosKey); mSclInterpolator.animate(animationTime, mScaleKey); mat.translationRotateScale(mPosKey[0], mPosKey[1], mPosKey[2], mRotKey[0], mRotKey[1], mRotKey[2], mRotKey[3], mScaleKey[0], mScaleKey[1], mScaleKey[2]); }
[ "public", "void", "animate", "(", "float", "animationTime", ",", "Matrix4f", "mat", ")", "{", "mRotInterpolator", ".", "animate", "(", "animationTime", ",", "mRotKey", ")", ";", "mPosInterpolator", ".", "animate", "(", "animationTime", ",", "mPosKey", ")", ";", "mSclInterpolator", ".", "animate", "(", "animationTime", ",", "mScaleKey", ")", ";", "mat", ".", "translationRotateScale", "(", "mPosKey", "[", "0", "]", ",", "mPosKey", "[", "1", "]", ",", "mPosKey", "[", "2", "]", ",", "mRotKey", "[", "0", "]", ",", "mRotKey", "[", "1", "]", ",", "mRotKey", "[", "2", "]", ",", "mRotKey", "[", "3", "]", ",", "mScaleKey", "[", "0", "]", ",", "mScaleKey", "[", "1", "]", ",", "mScaleKey", "[", "2", "]", ")", ";", "}" ]
Obtains the transform for a specific time in animation. @param animationTime The time in animation. @return The transform.
[ "Obtains", "the", "transform", "for", "a", "specific", "time", "in", "animation", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRAnimationChannel.java#L291-L298
161,669
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java
GVRPointLight.setAmbientIntensity
public void setAmbientIntensity(float r, float g, float b, float a) { setVec4("ambient_intensity", r, g, b, a); }
java
public void setAmbientIntensity(float r, float g, float b, float a) { setVec4("ambient_intensity", r, g, b, a); }
[ "public", "void", "setAmbientIntensity", "(", "float", "r", ",", "float", "g", ",", "float", "b", ",", "float", "a", ")", "{", "setVec4", "(", "\"ambient_intensity\"", ",", "r", ",", "g", ",", "b", ",", "a", ")", ";", "}" ]
Set the ambient light intensity. This designates the color of the ambient reflection. It is multiplied by the material ambient color to derive the hue of the ambient reflection for that material. The built-in phong shader {@link GVRPhongShader} uses a {@code vec4} uniform named {@code ambient_intensity} to control the intensity of ambient light reflected. @param r red component (0 to 1) @param g green component (0 to 1) @param b blue component (0 to 1) @param a alpha component (0 to 1)
[ "Set", "the", "ambient", "light", "intensity", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java#L116-L118
161,670
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java
GVRPointLight.setDiffuseIntensity
public void setDiffuseIntensity(float r, float g, float b, float a) { setVec4("diffuse_intensity", r, g, b, a); }
java
public void setDiffuseIntensity(float r, float g, float b, float a) { setVec4("diffuse_intensity", r, g, b, a); }
[ "public", "void", "setDiffuseIntensity", "(", "float", "r", ",", "float", "g", ",", "float", "b", ",", "float", "a", ")", "{", "setVec4", "(", "\"diffuse_intensity\"", ",", "r", ",", "g", ",", "b", ",", "a", ")", ";", "}" ]
Set the diffuse light intensity. This designates the color of the diffuse reflection. It is multiplied by the material diffuse color to derive the hue of the diffuse reflection for that material. The built-in phong shader {@link GVRPhongShader} uses a {@code vec4} uniform named {@code diffuse_intensity} to control the intensity of diffuse light reflected. @param r red component (0 to 1) @param g green component (0 to 1) @param b blue component (0 to 1) @param a alpha component (0 to 1)
[ "Set", "the", "diffuse", "light", "intensity", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java#L150-L152
161,671
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java
GVRPointLight.setSpecularIntensity
public void setSpecularIntensity(float r, float g, float b, float a) { setVec4("specular_intensity", r, g, b, a); }
java
public void setSpecularIntensity(float r, float g, float b, float a) { setVec4("specular_intensity", r, g, b, a); }
[ "public", "void", "setSpecularIntensity", "(", "float", "r", ",", "float", "g", ",", "float", "b", ",", "float", "a", ")", "{", "setVec4", "(", "\"specular_intensity\"", ",", "r", ",", "g", ",", "b", ",", "a", ")", ";", "}" ]
Set the specular intensity of the light. This designates the color of the specular reflection. It is multiplied by the material specular color to derive the hue of the specular reflection for that material. The built-in phong shader {@link GVRPhongShader} uses a {@code vec4} uniform named {@code specular_intensity} to control the specular intensity. @param r red component (0 to 1) @param g green component (0 to 1) @param b blue component (0 to 1) @param a alpha component (0 to 1)
[ "Set", "the", "specular", "intensity", "of", "the", "light", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java#L183-L185
161,672
Samsung/GearVRf
GVRf/Framework/backend_monoscopic/src/main/java/org/gearvrf/MonoscopicInternalSensorListener.java
MonoscopicInternalSensorListener.getQuaternionW
private float getQuaternionW(float x, float y, float z) { return (float) Math.cos(Math.asin(Math.sqrt(x * x + y * y + z * z))); }
java
private float getQuaternionW(float x, float y, float z) { return (float) Math.cos(Math.asin(Math.sqrt(x * x + y * y + z * z))); }
[ "private", "float", "getQuaternionW", "(", "float", "x", ",", "float", "y", ",", "float", "z", ")", "{", "return", "(", "float", ")", "Math", ".", "cos", "(", "Math", ".", "asin", "(", "Math", ".", "sqrt", "(", "x", "*", "x", "+", "y", "*", "y", "+", "z", "*", "z", ")", ")", ")", ";", "}" ]
Finds the missing value. Seems to lose a degree of freedom, but it doesn't. That degree of freedom is already lost by the sensor.
[ "Finds", "the", "missing", "value", ".", "Seems", "to", "lose", "a", "degree", "of", "freedom", "but", "it", "doesn", "t", ".", "That", "degree", "of", "freedom", "is", "already", "lost", "by", "the", "sensor", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_monoscopic/src/main/java/org/gearvrf/MonoscopicInternalSensorListener.java#L69-L71
161,673
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/DebugServer.java
DebugServer.shutdown
public void shutdown() { debugConnection = null; shuttingDown = true; try { if (serverSocket != null) { serverSocket.close(); } } catch (IOException e) { e.printStackTrace(); } }
java
public void shutdown() { debugConnection = null; shuttingDown = true; try { if (serverSocket != null) { serverSocket.close(); } } catch (IOException e) { e.printStackTrace(); } }
[ "public", "void", "shutdown", "(", ")", "{", "debugConnection", "=", "null", ";", "shuttingDown", "=", "true", ";", "try", "{", "if", "(", "serverSocket", "!=", "null", ")", "{", "serverSocket", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}" ]
Shuts down the server. Active connections are not affected.
[ "Shuts", "down", "the", "server", ".", "Active", "connections", "are", "not", "affected", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/DebugServer.java#L159-L169
161,674
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/debug/DebugServer.java
DebugServer.run
@Override public void run() { ExecutorService executorService = Executors.newFixedThreadPool(maxClients); try { serverSocket = new ServerSocket(port, maxClients); while (!shuttingDown) { try { Socket socket = serverSocket.accept(); debugConnection = new DebugConnection(socket); executorService.submit(debugConnection); } catch (SocketException e) { // closed debugConnection = null; } } } catch (IOException e) { e.printStackTrace(); } finally { try { debugConnection = null; serverSocket.close(); } catch (Exception e) { } executorService.shutdownNow(); } }
java
@Override public void run() { ExecutorService executorService = Executors.newFixedThreadPool(maxClients); try { serverSocket = new ServerSocket(port, maxClients); while (!shuttingDown) { try { Socket socket = serverSocket.accept(); debugConnection = new DebugConnection(socket); executorService.submit(debugConnection); } catch (SocketException e) { // closed debugConnection = null; } } } catch (IOException e) { e.printStackTrace(); } finally { try { debugConnection = null; serverSocket.close(); } catch (Exception e) { } executorService.shutdownNow(); } }
[ "@", "Override", "public", "void", "run", "(", ")", "{", "ExecutorService", "executorService", "=", "Executors", ".", "newFixedThreadPool", "(", "maxClients", ")", ";", "try", "{", "serverSocket", "=", "new", "ServerSocket", "(", "port", ",", "maxClients", ")", ";", "while", "(", "!", "shuttingDown", ")", "{", "try", "{", "Socket", "socket", "=", "serverSocket", ".", "accept", "(", ")", ";", "debugConnection", "=", "new", "DebugConnection", "(", "socket", ")", ";", "executorService", ".", "submit", "(", "debugConnection", ")", ";", "}", "catch", "(", "SocketException", "e", ")", "{", "// closed", "debugConnection", "=", "null", ";", "}", "}", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "finally", "{", "try", "{", "debugConnection", "=", "null", ";", "serverSocket", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "executorService", ".", "shutdownNow", "(", ")", ";", "}", "}" ]
Runs the server.
[ "Runs", "the", "server", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/DebugServer.java#L174-L199
161,675
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRScene.java
GVRScene.removeAllSceneObjects
public synchronized void removeAllSceneObjects() { final GVRCameraRig rig = getMainCameraRig(); final GVRSceneObject head = rig.getOwnerObject(); rig.removeAllChildren(); NativeScene.removeAllSceneObjects(getNative()); for (final GVRSceneObject child : mSceneRoot.getChildren()) { child.getParent().removeChildObject(child); } if (null != head) { mSceneRoot.addChildObject(head); } final int numControllers = getGVRContext().getInputManager().clear(); if (numControllers > 0) { getGVRContext().getInputManager().selectController(); } getGVRContext().runOnGlThread(new Runnable() { @Override public void run() { NativeScene.deleteLightsAndDepthTextureOnRenderThread(getNative()); } }); }
java
public synchronized void removeAllSceneObjects() { final GVRCameraRig rig = getMainCameraRig(); final GVRSceneObject head = rig.getOwnerObject(); rig.removeAllChildren(); NativeScene.removeAllSceneObjects(getNative()); for (final GVRSceneObject child : mSceneRoot.getChildren()) { child.getParent().removeChildObject(child); } if (null != head) { mSceneRoot.addChildObject(head); } final int numControllers = getGVRContext().getInputManager().clear(); if (numControllers > 0) { getGVRContext().getInputManager().selectController(); } getGVRContext().runOnGlThread(new Runnable() { @Override public void run() { NativeScene.deleteLightsAndDepthTextureOnRenderThread(getNative()); } }); }
[ "public", "synchronized", "void", "removeAllSceneObjects", "(", ")", "{", "final", "GVRCameraRig", "rig", "=", "getMainCameraRig", "(", ")", ";", "final", "GVRSceneObject", "head", "=", "rig", ".", "getOwnerObject", "(", ")", ";", "rig", ".", "removeAllChildren", "(", ")", ";", "NativeScene", ".", "removeAllSceneObjects", "(", "getNative", "(", ")", ")", ";", "for", "(", "final", "GVRSceneObject", "child", ":", "mSceneRoot", ".", "getChildren", "(", ")", ")", "{", "child", ".", "getParent", "(", ")", ".", "removeChildObject", "(", "child", ")", ";", "}", "if", "(", "null", "!=", "head", ")", "{", "mSceneRoot", ".", "addChildObject", "(", "head", ")", ";", "}", "final", "int", "numControllers", "=", "getGVRContext", "(", ")", ".", "getInputManager", "(", ")", ".", "clear", "(", ")", ";", "if", "(", "numControllers", ">", "0", ")", "{", "getGVRContext", "(", ")", ".", "getInputManager", "(", ")", ".", "selectController", "(", ")", ";", "}", "getGVRContext", "(", ")", ".", "runOnGlThread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "NativeScene", ".", "deleteLightsAndDepthTextureOnRenderThread", "(", "getNative", "(", ")", ")", ";", "}", "}", ")", ";", "}" ]
Remove all scene objects.
[ "Remove", "all", "scene", "objects", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRScene.java#L159-L185
161,676
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.setPickRay
public void setPickRay(float ox, float oy, float oz, float dx, float dy, float dz) { synchronized (this) { mRayOrigin.x = ox; mRayOrigin.y = oy; mRayOrigin.z = oz; mRayDirection.x = dx; mRayDirection.y = dy; mRayDirection.z = dz; } }
java
public void setPickRay(float ox, float oy, float oz, float dx, float dy, float dz) { synchronized (this) { mRayOrigin.x = ox; mRayOrigin.y = oy; mRayOrigin.z = oz; mRayDirection.x = dx; mRayDirection.y = dy; mRayDirection.z = dz; } }
[ "public", "void", "setPickRay", "(", "float", "ox", ",", "float", "oy", ",", "float", "oz", ",", "float", "dx", ",", "float", "dy", ",", "float", "dz", ")", "{", "synchronized", "(", "this", ")", "{", "mRayOrigin", ".", "x", "=", "ox", ";", "mRayOrigin", ".", "y", "=", "oy", ";", "mRayOrigin", ".", "z", "=", "oz", ";", "mRayDirection", ".", "x", "=", "dx", ";", "mRayDirection", ".", "y", "=", "dy", ";", "mRayDirection", ".", "z", "=", "dz", ";", "}", "}" ]
Sets the origin and direction of the pick ray. @param ox X coordinate of origin. @param oy Y coordinate of origin. @param oz Z coordinate of origin. @param dx X coordinate of ray direction. @param dy Y coordinate of ray direction. @param dz Z coordinate of ray direction. The coordinate system of the ray depends on the whether the picker is attached to a scene object or not. When attached to a scene object, the ray is in the coordinate system of that object where (0, 0, 0) is the center of the scene object and (0, 0, 1) is it's positive Z axis. If not attached to an object, the ray is in the coordinate system of the scene's main camera with (0, 0, 0) at the viewer and (0, 0, -1) where the viewer is looking. @see #doPick() @see #getPickRay() @see #getWorldPickRay(Vector3f, Vector3f)
[ "Sets", "the", "origin", "and", "direction", "of", "the", "pick", "ray", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L418-L429
161,677
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.onDrawFrame
public void onDrawFrame(float frameTime) { if (isEnabled() && (mScene != null) && mPickEventLock.tryLock()) { // Don't call if we are in the middle of processing another pick try { doPick(); } finally { mPickEventLock.unlock(); } } }
java
public void onDrawFrame(float frameTime) { if (isEnabled() && (mScene != null) && mPickEventLock.tryLock()) { // Don't call if we are in the middle of processing another pick try { doPick(); } finally { mPickEventLock.unlock(); } } }
[ "public", "void", "onDrawFrame", "(", "float", "frameTime", ")", "{", "if", "(", "isEnabled", "(", ")", "&&", "(", "mScene", "!=", "null", ")", "&&", "mPickEventLock", ".", "tryLock", "(", ")", ")", "{", "// Don't call if we are in the middle of processing another pick", "try", "{", "doPick", "(", ")", ";", "}", "finally", "{", "mPickEventLock", ".", "unlock", "(", ")", ";", "}", "}", "}" ]
Called every frame if the picker is enabled to generate pick events. @param frameTime starting time of the current frame
[ "Called", "every", "frame", "if", "the", "picker", "is", "enabled", "to", "generate", "pick", "events", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L487-L501
161,678
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.processPick
public void processPick(boolean touched, MotionEvent event) { mPickEventLock.lock(); mTouched = touched; mMotionEvent = event; doPick(); mPickEventLock.unlock(); }
java
public void processPick(boolean touched, MotionEvent event) { mPickEventLock.lock(); mTouched = touched; mMotionEvent = event; doPick(); mPickEventLock.unlock(); }
[ "public", "void", "processPick", "(", "boolean", "touched", ",", "MotionEvent", "event", ")", "{", "mPickEventLock", ".", "lock", "(", ")", ";", "mTouched", "=", "touched", ";", "mMotionEvent", "=", "event", ";", "doPick", "(", ")", ";", "mPickEventLock", ".", "unlock", "(", ")", ";", "}" ]
Scans the scene graph to collect picked items and generates appropriate pick and touch events. This function is called by the cursor controller internally but can also be used to funnel a stream of Android motion events into the picker. @see #pickObjects(GVRScene, float, float, float, float, float, float) @param touched true if the "touched" button is pressed. Which button indicates touch is controller dependent. @param event Android MotionEvent which caused the pick @see IPickEvents @see ITouchEvents
[ "Scans", "the", "scene", "graph", "to", "collect", "picked", "items", "and", "generates", "appropriate", "pick", "and", "touch", "events", ".", "This", "function", "is", "called", "by", "the", "cursor", "controller", "internally", "but", "can", "also", "be", "used", "to", "funnel", "a", "stream", "of", "Android", "motion", "events", "into", "the", "picker", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L555-L562
161,679
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.propagateOnNoPick
protected void propagateOnNoPick(GVRPicker picker) { if (mEventOptions.contains(EventOptions.SEND_PICK_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { getGVRContext().getEventManager().sendEvent(this, IPickEvents.class, "onNoPick", picker); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { getGVRContext().getEventManager().sendEvent(mScene, IPickEvents.class, "onNoPick", picker); } } }
java
protected void propagateOnNoPick(GVRPicker picker) { if (mEventOptions.contains(EventOptions.SEND_PICK_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { getGVRContext().getEventManager().sendEvent(this, IPickEvents.class, "onNoPick", picker); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { getGVRContext().getEventManager().sendEvent(mScene, IPickEvents.class, "onNoPick", picker); } } }
[ "protected", "void", "propagateOnNoPick", "(", "GVRPicker", "picker", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_PICK_EVENTS", ")", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_LISTENERS", ")", ")", "{", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ".", "sendEvent", "(", "this", ",", "IPickEvents", ".", "class", ",", "\"onNoPick\"", ",", "picker", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_SCENE", ")", "&&", "(", "mScene", "!=", "null", ")", ")", "{", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ".", "sendEvent", "(", "mScene", ",", "IPickEvents", ".", "class", ",", "\"onNoPick\"", ",", "picker", ")", ";", "}", "}", "}" ]
Propagate onNoPick events to listeners @param picker GVRPicker which generated the event
[ "Propagate", "onNoPick", "events", "to", "listeners" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L666-L679
161,680
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.propagateOnMotionOutside
protected void propagateOnMotionOutside(MotionEvent event) { if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { getGVRContext().getEventManager().sendEvent(this, ITouchEvents.class, "onMotionOutside", this, event); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { getGVRContext().getEventManager().sendEvent(mScene, ITouchEvents.class, "onMotionOutside", this, event); } } }
java
protected void propagateOnMotionOutside(MotionEvent event) { if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { getGVRContext().getEventManager().sendEvent(this, ITouchEvents.class, "onMotionOutside", this, event); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { getGVRContext().getEventManager().sendEvent(mScene, ITouchEvents.class, "onMotionOutside", this, event); } } }
[ "protected", "void", "propagateOnMotionOutside", "(", "MotionEvent", "event", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TOUCH_EVENTS", ")", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_LISTENERS", ")", ")", "{", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ".", "sendEvent", "(", "this", ",", "ITouchEvents", ".", "class", ",", "\"onMotionOutside\"", ",", "this", ",", "event", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_SCENE", ")", "&&", "(", "mScene", "!=", "null", ")", ")", "{", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ".", "sendEvent", "(", "mScene", ",", "ITouchEvents", ".", "class", ",", "\"onMotionOutside\"", ",", "this", ",", "event", ")", ";", "}", "}", "}" ]
Propagate onMotionOutside events to listeners @param MotionEvent Android MotionEvent when nothing is picked
[ "Propagate", "onMotionOutside", "events", "to", "listeners" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L704-L717
161,681
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.propagateOnEnter
protected void propagateOnEnter(GVRPickedObject hit) { GVRSceneObject hitObject = hit.getHitObject(); GVREventManager eventManager = getGVRContext().getEventManager(); if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, ITouchEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, ITouchEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, ITouchEvents.class, "onEnter", hitObject, hit); } } if (mEventOptions.contains(EventOptions.SEND_PICK_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, IPickEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, IPickEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, IPickEvents.class, "onEnter", hitObject, hit); } } }
java
protected void propagateOnEnter(GVRPickedObject hit) { GVRSceneObject hitObject = hit.getHitObject(); GVREventManager eventManager = getGVRContext().getEventManager(); if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, ITouchEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, ITouchEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, ITouchEvents.class, "onEnter", hitObject, hit); } } if (mEventOptions.contains(EventOptions.SEND_PICK_EVENTS)) { if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, IPickEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, IPickEvents.class, "onEnter", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, IPickEvents.class, "onEnter", hitObject, hit); } } }
[ "protected", "void", "propagateOnEnter", "(", "GVRPickedObject", "hit", ")", "{", "GVRSceneObject", "hitObject", "=", "hit", ".", "getHitObject", "(", ")", ";", "GVREventManager", "eventManager", "=", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ";", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TOUCH_EVENTS", ")", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_LISTENERS", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "this", ",", "ITouchEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_HIT_OBJECT", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "hitObject", ",", "ITouchEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_SCENE", ")", "&&", "(", "mScene", "!=", "null", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "mScene", ",", "ITouchEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_PICK_EVENTS", ")", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_LISTENERS", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "this", ",", "IPickEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_HIT_OBJECT", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "hitObject", ",", "IPickEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_SCENE", ")", "&&", "(", "mScene", "!=", "null", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "mScene", ",", "IPickEvents", ".", "class", ",", "\"onEnter\"", ",", "hitObject", ",", "hit", ")", ";", "}", "}", "}" ]
Propagate onEnter events to listeners @param hit collision object
[ "Propagate", "onEnter", "events", "to", "listeners" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L723-L757
161,682
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.propagateOnTouch
protected void propagateOnTouch(GVRPickedObject hit) { if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { GVREventManager eventManager = getGVRContext().getEventManager(); GVRSceneObject hitObject = hit.getHitObject(); if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, ITouchEvents.class, "onTouchStart", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, ITouchEvents.class, "onTouchStart", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, ITouchEvents.class, "onTouchStart", hitObject, hit); } } }
java
protected void propagateOnTouch(GVRPickedObject hit) { if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS)) { GVREventManager eventManager = getGVRContext().getEventManager(); GVRSceneObject hitObject = hit.getHitObject(); if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS)) { eventManager.sendEvent(this, ITouchEvents.class, "onTouchStart", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_HIT_OBJECT)) { eventManager.sendEvent(hitObject, ITouchEvents.class, "onTouchStart", hitObject, hit); } if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null)) { eventManager.sendEvent(mScene, ITouchEvents.class, "onTouchStart", hitObject, hit); } } }
[ "protected", "void", "propagateOnTouch", "(", "GVRPickedObject", "hit", ")", "{", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TOUCH_EVENTS", ")", ")", "{", "GVREventManager", "eventManager", "=", "getGVRContext", "(", ")", ".", "getEventManager", "(", ")", ";", "GVRSceneObject", "hitObject", "=", "hit", ".", "getHitObject", "(", ")", ";", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_LISTENERS", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "this", ",", "ITouchEvents", ".", "class", ",", "\"onTouchStart\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_HIT_OBJECT", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "hitObject", ",", "ITouchEvents", ".", "class", ",", "\"onTouchStart\"", ",", "hitObject", ",", "hit", ")", ";", "}", "if", "(", "mEventOptions", ".", "contains", "(", "EventOptions", ".", "SEND_TO_SCENE", ")", "&&", "(", "mScene", "!=", "null", ")", ")", "{", "eventManager", ".", "sendEvent", "(", "mScene", ",", "ITouchEvents", ".", "class", ",", "\"onTouchStart\"", ",", "hitObject", ",", "hit", ")", ";", "}", "}", "}" ]
Propagate onTouchStart events to listeners @param hit collision object
[ "Propagate", "onTouchStart", "events", "to", "listeners" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L763-L782
161,683
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.findCollider
protected GVRPickedObject findCollider(GVRPickedObject[] pickList, GVRCollider findme) { if (pickList == null) { return null; } for (GVRPickedObject hit : pickList) { if ((hit != null) && (hit.hitCollider == findme)) { return hit; } } return null; }
java
protected GVRPickedObject findCollider(GVRPickedObject[] pickList, GVRCollider findme) { if (pickList == null) { return null; } for (GVRPickedObject hit : pickList) { if ((hit != null) && (hit.hitCollider == findme)) { return hit; } } return null; }
[ "protected", "GVRPickedObject", "findCollider", "(", "GVRPickedObject", "[", "]", "pickList", ",", "GVRCollider", "findme", ")", "{", "if", "(", "pickList", "==", "null", ")", "{", "return", "null", ";", "}", "for", "(", "GVRPickedObject", "hit", ":", "pickList", ")", "{", "if", "(", "(", "hit", "!=", "null", ")", "&&", "(", "hit", ".", "hitCollider", "==", "findme", ")", ")", "{", "return", "hit", ";", "}", "}", "return", "null", ";", "}" ]
Find the collision against a specific collider in a list of collisions. @param pickList collision list @param findme collider to find @return collision with the specified collider, null if not found
[ "Find", "the", "collision", "against", "a", "specific", "collider", "in", "a", "list", "of", "collisions", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L894-L908
161,684
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.pickObjects
public static final GVRPickedObject[] pickObjects(GVRScene scene, float ox, float oy, float oz, float dx, float dy, float dz) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickObjects(scene.getNative(), 0L, ox, oy, oz, dx, dy, dz); return result; } finally { sFindObjectsLock.unlock(); } }
java
public static final GVRPickedObject[] pickObjects(GVRScene scene, float ox, float oy, float oz, float dx, float dy, float dz) { sFindObjectsLock.lock(); try { final GVRPickedObject[] result = NativePicker.pickObjects(scene.getNative(), 0L, ox, oy, oz, dx, dy, dz); return result; } finally { sFindObjectsLock.unlock(); } }
[ "public", "static", "final", "GVRPickedObject", "[", "]", "pickObjects", "(", "GVRScene", "scene", ",", "float", "ox", ",", "float", "oy", ",", "float", "oz", ",", "float", "dx", ",", "float", "dy", ",", "float", "dz", ")", "{", "sFindObjectsLock", ".", "lock", "(", ")", ";", "try", "{", "final", "GVRPickedObject", "[", "]", "result", "=", "NativePicker", ".", "pickObjects", "(", "scene", ".", "getNative", "(", ")", ",", "0L", ",", "ox", ",", "oy", ",", "oz", ",", "dx", ",", "dy", ",", "dz", ")", ";", "return", "result", ";", "}", "finally", "{", "sFindObjectsLock", ".", "unlock", "(", ")", ";", "}", "}" ]
Casts a ray into the scene graph, and returns the objects it intersects. The ray is defined by its origin {@code [ox, oy, oz]} and its direction {@code [dx, dy, dz]}. <p> The ray origin may be [0, 0, 0] and the direction components should be normalized from -1 to 1: Note that the y direction runs from -1 at the bottom to 1 at the top. To construct a picking ray originating at the user's head and pointing into the scene along the camera lookat vector, pass in 0, 0, 0 for the origin and 0, 0, -1 for the direction. <p> This method is thread safe because it guarantees that only one thread at a time is doing a ray cast into a 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. <p> Depending on the type of collider, that the hit location may not be exactly where the ray would intersect the scene object itself. Rather, it is where the ray intersects the collision geometry associated with the collider. @param scene The {@link GVRScene} with all the objects to be tested. @param ox The x coordinate of the ray origin. @param oy The y coordinate of the ray origin. @param oz The z coordinate of the ray origin. @param dx The x vector of the ray direction. @param dy The y vector of the ray direction. @param dz The z vector of the ray direction. @return A list of {@link GVRPickedObject}, sorted by distance from the camera rig. Each {@link GVRPickedObject} contains the scene object which owns the {@link GVRCollider} along with the hit location and distance from the camera. @since 1.6.6
[ "Casts", "a", "ray", "into", "the", "scene", "graph", "and", "returns", "the", "objects", "it", "intersects", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L1065-L1074
161,685
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java
GVRPicker.makeHitMesh
static GVRPickedObject makeHitMesh(long colliderPointer, float distance, float hitx, float hity, float hitz, int faceIndex, float barycentricx, float barycentricy, float barycentricz, float texu, float texv, float normalx, float normaly, float normalz) { GVRCollider collider = GVRCollider.lookup(colliderPointer); if (collider == null) { Log.d(TAG, "makeHit: cannot find collider for %x", colliderPointer); return null; } return new GVRPicker.GVRPickedObject(collider, new float[] { hitx, hity, hitz }, distance, faceIndex, new float[] {barycentricx, barycentricy, barycentricz}, new float[]{ texu, texv }, new float[]{normalx, normaly, normalz}); }
java
static GVRPickedObject makeHitMesh(long colliderPointer, float distance, float hitx, float hity, float hitz, int faceIndex, float barycentricx, float barycentricy, float barycentricz, float texu, float texv, float normalx, float normaly, float normalz) { GVRCollider collider = GVRCollider.lookup(colliderPointer); if (collider == null) { Log.d(TAG, "makeHit: cannot find collider for %x", colliderPointer); return null; } return new GVRPicker.GVRPickedObject(collider, new float[] { hitx, hity, hitz }, distance, faceIndex, new float[] {barycentricx, barycentricy, barycentricz}, new float[]{ texu, texv }, new float[]{normalx, normaly, normalz}); }
[ "static", "GVRPickedObject", "makeHitMesh", "(", "long", "colliderPointer", ",", "float", "distance", ",", "float", "hitx", ",", "float", "hity", ",", "float", "hitz", ",", "int", "faceIndex", ",", "float", "barycentricx", ",", "float", "barycentricy", ",", "float", "barycentricz", ",", "float", "texu", ",", "float", "texv", ",", "float", "normalx", ",", "float", "normaly", ",", "float", "normalz", ")", "{", "GVRCollider", "collider", "=", "GVRCollider", ".", "lookup", "(", "colliderPointer", ")", ";", "if", "(", "collider", "==", "null", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"makeHit: cannot find collider for %x\"", ",", "colliderPointer", ")", ";", "return", "null", ";", "}", "return", "new", "GVRPicker", ".", "GVRPickedObject", "(", "collider", ",", "new", "float", "[", "]", "{", "hitx", ",", "hity", ",", "hitz", "}", ",", "distance", ",", "faceIndex", ",", "new", "float", "[", "]", "{", "barycentricx", ",", "barycentricy", ",", "barycentricz", "}", ",", "new", "float", "[", "]", "{", "texu", ",", "texv", "}", ",", "new", "float", "[", "]", "{", "normalx", ",", "normaly", ",", "normalz", "}", ")", ";", "}" ]
Internal utility to help JNI add hit objects to the pick list. Specifically for MeshColliders with picking for UV, Barycentric, and normal coordinates enabled
[ "Internal", "utility", "to", "help", "JNI", "add", "hit", "objects", "to", "the", "pick", "list", ".", "Specifically", "for", "MeshColliders", "with", "picking", "for", "UV", "Barycentric", "and", "normal", "coordinates", "enabled" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPicker.java#L1233-L1247
161,686
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/AsyncAtlasInfo.java
AsyncAtlasInfo.loadAtlasInformation
public static List<GVRAtlasInformation> loadAtlasInformation(InputStream ins) { try { int size = ins.available(); byte[] buffer = new byte[size]; ins.read(buffer); return loadAtlasInformation(new JSONArray(new String(buffer, "UTF-8"))); } catch (JSONException je) { je.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return null; }
java
public static List<GVRAtlasInformation> loadAtlasInformation(InputStream ins) { try { int size = ins.available(); byte[] buffer = new byte[size]; ins.read(buffer); return loadAtlasInformation(new JSONArray(new String(buffer, "UTF-8"))); } catch (JSONException je) { je.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return null; }
[ "public", "static", "List", "<", "GVRAtlasInformation", ">", "loadAtlasInformation", "(", "InputStream", "ins", ")", "{", "try", "{", "int", "size", "=", "ins", ".", "available", "(", ")", ";", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "size", "]", ";", "ins", ".", "read", "(", "buffer", ")", ";", "return", "loadAtlasInformation", "(", "new", "JSONArray", "(", "new", "String", "(", "buffer", ",", "\"UTF-8\"", ")", ")", ")", ";", "}", "catch", "(", "JSONException", "je", ")", "{", "je", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}" ]
This method is a sync parse to the JSON stream of atlas information. @return List of atlas information.
[ "This", "method", "is", "a", "sync", "parse", "to", "the", "JSON", "stream", "of", "atlas", "information", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/asynchronous/AsyncAtlasInfo.java#L41-L56
161,687
Samsung/GearVRf
GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/MovieTexture.java
MovieTexture.setSpeed
public void setSpeed(float newValue) { if (newValue < 0) newValue = 0; this.pitch.setValue( newValue ); this.speed.setValue( newValue ); }
java
public void setSpeed(float newValue) { if (newValue < 0) newValue = 0; this.pitch.setValue( newValue ); this.speed.setValue( newValue ); }
[ "public", "void", "setSpeed", "(", "float", "newValue", ")", "{", "if", "(", "newValue", "<", "0", ")", "newValue", "=", "0", ";", "this", ".", "pitch", ".", "setValue", "(", "newValue", ")", ";", "this", ".", "speed", ".", "setValue", "(", "newValue", ")", ";", "}" ]
Assign float value to inputOutput SFFloat field named speed. Note that our implementation with ExoPlayer that pitch and speed will be set to the same value. @param newValue
[ "Assign", "float", "value", "to", "inputOutput", "SFFloat", "field", "named", "speed", ".", "Note", "that", "our", "implementation", "with", "ExoPlayer", "that", "pitch", "and", "speed", "will", "be", "set", "to", "the", "same", "value", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/MovieTexture.java#L124-L128
161,688
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java
GVRShaderId.getUniformDescriptor
public String getUniformDescriptor(GVRContext ctx) { if (mShaderTemplate == null) { mShaderTemplate = makeTemplate(ID, ctx); ctx.getShaderManager().addShaderID(this); } return mShaderTemplate.getUniformDescriptor(); }
java
public String getUniformDescriptor(GVRContext ctx) { if (mShaderTemplate == null) { mShaderTemplate = makeTemplate(ID, ctx); ctx.getShaderManager().addShaderID(this); } return mShaderTemplate.getUniformDescriptor(); }
[ "public", "String", "getUniformDescriptor", "(", "GVRContext", "ctx", ")", "{", "if", "(", "mShaderTemplate", "==", "null", ")", "{", "mShaderTemplate", "=", "makeTemplate", "(", "ID", ",", "ctx", ")", ";", "ctx", ".", "getShaderManager", "(", ")", ".", "addShaderID", "(", "this", ")", ";", "}", "return", "mShaderTemplate", ".", "getUniformDescriptor", "(", ")", ";", "}" ]
Gets the string describing the uniforms used by shaders of this type. @param ctx GVFContext shader is associated with @return uniform descriptor string @see #getTemplate(GVRContext) GVRShader#getUniformDescriptor()
[ "Gets", "the", "string", "describing", "the", "uniforms", "used", "by", "shaders", "of", "this", "type", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java#L48-L56
161,689
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java
GVRShaderId.getTemplate
public GVRShader getTemplate(GVRContext ctx) { if (mShaderTemplate == null) { mShaderTemplate = makeTemplate(ID, ctx); ctx.getShaderManager().addShaderID(this); } return mShaderTemplate; }
java
public GVRShader getTemplate(GVRContext ctx) { if (mShaderTemplate == null) { mShaderTemplate = makeTemplate(ID, ctx); ctx.getShaderManager().addShaderID(this); } return mShaderTemplate; }
[ "public", "GVRShader", "getTemplate", "(", "GVRContext", "ctx", ")", "{", "if", "(", "mShaderTemplate", "==", "null", ")", "{", "mShaderTemplate", "=", "makeTemplate", "(", "ID", ",", "ctx", ")", ";", "ctx", ".", "getShaderManager", "(", ")", ".", "addShaderID", "(", "this", ")", ";", "}", "return", "mShaderTemplate", ";", "}" ]
Gets the Java subclass of GVRShader which implements this shader type. @param ctx GVRContext shader is associated with @return GVRShader class implementing the shader type
[ "Gets", "the", "Java", "subclass", "of", "GVRShader", "which", "implements", "this", "shader", "type", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java#L80-L88
161,690
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java
GVRShaderId.makeTemplate
GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx) { try { Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(GVRContext.class); return maker.newInstance(ctx); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex) { try { Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(); return maker.newInstance(); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex2) { ctx.getEventManager().sendEvent(ctx, IErrorEvents.class, "onError", new Object[] {ex2.getMessage(), this}); return null; } } }
java
GVRShader makeTemplate(Class<? extends GVRShader> id, GVRContext ctx) { try { Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(GVRContext.class); return maker.newInstance(ctx); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex) { try { Constructor<? extends GVRShader> maker = id.getDeclaredConstructor(); return maker.newInstance(); } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex2) { ctx.getEventManager().sendEvent(ctx, IErrorEvents.class, "onError", new Object[] {ex2.getMessage(), this}); return null; } } }
[ "GVRShader", "makeTemplate", "(", "Class", "<", "?", "extends", "GVRShader", ">", "id", ",", "GVRContext", "ctx", ")", "{", "try", "{", "Constructor", "<", "?", "extends", "GVRShader", ">", "maker", "=", "id", ".", "getDeclaredConstructor", "(", "GVRContext", ".", "class", ")", ";", "return", "maker", ".", "newInstance", "(", "ctx", ")", ";", "}", "catch", "(", "NoSuchMethodException", "|", "IllegalAccessException", "|", "InstantiationException", "|", "InvocationTargetException", "ex", ")", "{", "try", "{", "Constructor", "<", "?", "extends", "GVRShader", ">", "maker", "=", "id", ".", "getDeclaredConstructor", "(", ")", ";", "return", "maker", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "NoSuchMethodException", "|", "IllegalAccessException", "|", "InstantiationException", "|", "InvocationTargetException", "ex2", ")", "{", "ctx", ".", "getEventManager", "(", ")", ".", "sendEvent", "(", "ctx", ",", "IErrorEvents", ".", "class", ",", "\"onError\"", ",", "new", "Object", "[", "]", "{", "ex2", ".", "getMessage", "(", ")", ",", "this", "}", ")", ";", "return", "null", ";", "}", "}", "}" ]
Instantiates an instance of input Java shader class, which must be derived from GVRShader or GVRShaderTemplate. @param id Java class which implements shaders of this type. @param ctx GVRContext shader belongs to @return GVRShader subclass which implements this shader type
[ "Instantiates", "an", "instance", "of", "input", "Java", "shader", "class", "which", "must", "be", "derived", "from", "GVRShader", "or", "GVRShaderTemplate", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShaderId.java#L107-L127
161,691
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/GVRAccessibilitySpeech.java
GVRAccessibilitySpeech.start
public void start(GVRAccessibilitySpeechListener speechListener) { mTts.setSpeechListener(speechListener); mTts.getSpeechRecognizer().startListening(mTts.getSpeechRecognizerIntent()); }
java
public void start(GVRAccessibilitySpeechListener speechListener) { mTts.setSpeechListener(speechListener); mTts.getSpeechRecognizer().startListening(mTts.getSpeechRecognizerIntent()); }
[ "public", "void", "start", "(", "GVRAccessibilitySpeechListener", "speechListener", ")", "{", "mTts", ".", "setSpeechListener", "(", "speechListener", ")", ";", "mTts", ".", "getSpeechRecognizer", "(", ")", ".", "startListening", "(", "mTts", ".", "getSpeechRecognizerIntent", "(", ")", ")", ";", "}" ]
Start speech recognizer. @param speechListener
[ "Start", "speech", "recognizer", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/accessibility/GVRAccessibilitySpeech.java#L34-L37
161,692
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java
GVRMesh.setVertexBuffer
public void setVertexBuffer(GVRVertexBuffer vbuf) { if (vbuf == null) { throw new IllegalArgumentException("Vertex buffer cannot be null"); } mVertices = vbuf; NativeMesh.setVertexBuffer(getNative(), vbuf.getNative()); }
java
public void setVertexBuffer(GVRVertexBuffer vbuf) { if (vbuf == null) { throw new IllegalArgumentException("Vertex buffer cannot be null"); } mVertices = vbuf; NativeMesh.setVertexBuffer(getNative(), vbuf.getNative()); }
[ "public", "void", "setVertexBuffer", "(", "GVRVertexBuffer", "vbuf", ")", "{", "if", "(", "vbuf", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Vertex buffer cannot be null\"", ")", ";", "}", "mVertices", "=", "vbuf", ";", "NativeMesh", ".", "setVertexBuffer", "(", "getNative", "(", ")", ",", "vbuf", ".", "getNative", "(", ")", ")", ";", "}" ]
Changes the vertex buffer associated with this mesh. @param vbuf new vertex buffer to use @see #setVertices(float[]) @see #getVertexBuffer() @see #getVertices()
[ "Changes", "the", "vertex", "buffer", "associated", "with", "this", "mesh", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java#L184-L192
161,693
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java
GVRMesh.setIndexBuffer
public void setIndexBuffer(GVRIndexBuffer ibuf) { mIndices = ibuf; NativeMesh.setIndexBuffer(getNative(), (ibuf != null) ? ibuf.getNative() : 0L); }
java
public void setIndexBuffer(GVRIndexBuffer ibuf) { mIndices = ibuf; NativeMesh.setIndexBuffer(getNative(), (ibuf != null) ? ibuf.getNative() : 0L); }
[ "public", "void", "setIndexBuffer", "(", "GVRIndexBuffer", "ibuf", ")", "{", "mIndices", "=", "ibuf", ";", "NativeMesh", ".", "setIndexBuffer", "(", "getNative", "(", ")", ",", "(", "ibuf", "!=", "null", ")", "?", "ibuf", ".", "getNative", "(", ")", ":", "0L", ")", ";", "}" ]
Changes the index buffer associated with this mesh. @param ibuf new index buffer to use @see #setIndices(int[]) @see #getIndexBuffer() @see #getIntIndices()
[ "Changes", "the", "index", "buffer", "associated", "with", "this", "mesh", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java#L201-L205
161,694
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java
Log.rebuild
public static void rebuild(final MODE newMode) { if (mode != newMode) { mode = newMode; TYPE type; switch (mode) { case DEBUG: type = TYPE.ANDROID; Log.startFullLog(); break; case DEVELOPER: type = TYPE.PERSISTENT; Log.stopFullLog(); break; case USER: type = TYPE.ANDROID; break; default: type = DEFAULT_TYPE; Log.stopFullLog(); break; } currentLog = getLog(type); } }
java
public static void rebuild(final MODE newMode) { if (mode != newMode) { mode = newMode; TYPE type; switch (mode) { case DEBUG: type = TYPE.ANDROID; Log.startFullLog(); break; case DEVELOPER: type = TYPE.PERSISTENT; Log.stopFullLog(); break; case USER: type = TYPE.ANDROID; break; default: type = DEFAULT_TYPE; Log.stopFullLog(); break; } currentLog = getLog(type); } }
[ "public", "static", "void", "rebuild", "(", "final", "MODE", "newMode", ")", "{", "if", "(", "mode", "!=", "newMode", ")", "{", "mode", "=", "newMode", ";", "TYPE", "type", ";", "switch", "(", "mode", ")", "{", "case", "DEBUG", ":", "type", "=", "TYPE", ".", "ANDROID", ";", "Log", ".", "startFullLog", "(", ")", ";", "break", ";", "case", "DEVELOPER", ":", "type", "=", "TYPE", ".", "PERSISTENT", ";", "Log", ".", "stopFullLog", "(", ")", ";", "break", ";", "case", "USER", ":", "type", "=", "TYPE", ".", "ANDROID", ";", "break", ";", "default", ":", "type", "=", "DEFAULT_TYPE", ";", "Log", ".", "stopFullLog", "(", ")", ";", "break", ";", "}", "currentLog", "=", "getLog", "(", "type", ")", ";", "}", "}" ]
Rebuild logging systems with updated mode @param newMode log mode
[ "Rebuild", "logging", "systems", "with", "updated", "mode" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L167-L190
161,695
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java
Log.e
public static int e(ISubsystem subsystem, String tag, String msg) { return isEnabled(subsystem) ? currentLog.e(tag, getMsg(subsystem,msg)) : 0; }
java
public static int e(ISubsystem subsystem, String tag, String msg) { return isEnabled(subsystem) ? currentLog.e(tag, getMsg(subsystem,msg)) : 0; }
[ "public", "static", "int", "e", "(", "ISubsystem", "subsystem", ",", "String", "tag", ",", "String", "msg", ")", "{", "return", "isEnabled", "(", "subsystem", ")", "?", "currentLog", ".", "e", "(", "tag", ",", "getMsg", "(", "subsystem", ",", "msg", ")", ")", ":", "0", ";", "}" ]
Send an ERROR log message with specified subsystem. If subsystem is not enabled the message will not be logged @param subsystem logging subsystem @param tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. @param msg The message you would like logged. @return
[ "Send", "an", "ERROR", "log", "message", "with", "specified", "subsystem", ".", "If", "subsystem", "is", "not", "enabled", "the", "message", "will", "not", "be", "logged" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L423-L426
161,696
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java
Log.d
public static void d(ISubsystem subsystem, String tag, String pattern, Object... parameters) { if (!isEnabled(subsystem)) return; d(subsystem, tag, format(pattern, parameters)); }
java
public static void d(ISubsystem subsystem, String tag, String pattern, Object... parameters) { if (!isEnabled(subsystem)) return; d(subsystem, tag, format(pattern, parameters)); }
[ "public", "static", "void", "d", "(", "ISubsystem", "subsystem", ",", "String", "tag", ",", "String", "pattern", ",", "Object", "...", "parameters", ")", "{", "if", "(", "!", "isEnabled", "(", "subsystem", ")", ")", "return", ";", "d", "(", "subsystem", ",", "tag", ",", "format", "(", "pattern", ",", "parameters", ")", ")", ";", "}" ]
Send a DEBUG log message with specified subsystem. If subsystem is not enabled the message will not be logged @param subsystem logging subsystem @param tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs. @param pattern The message pattern @return
[ "Send", "a", "DEBUG", "log", "message", "with", "specified", "subsystem", ".", "If", "subsystem", "is", "not", "enabled", "the", "message", "will", "not", "be", "logged" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L603-L606
161,697
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java
Log.deleteOldAndEmptyFiles
private static void deleteOldAndEmptyFiles() { File dir = LOG_FILE_DIR; if (dir.exists()) { File[] files = dir.listFiles(); for (File f : files) { if (f.length() == 0 || f.lastModified() + MAXFILEAGE < System.currentTimeMillis()) { f.delete(); } } } }
java
private static void deleteOldAndEmptyFiles() { File dir = LOG_FILE_DIR; if (dir.exists()) { File[] files = dir.listFiles(); for (File f : files) { if (f.length() == 0 || f.lastModified() + MAXFILEAGE < System.currentTimeMillis()) { f.delete(); } } } }
[ "private", "static", "void", "deleteOldAndEmptyFiles", "(", ")", "{", "File", "dir", "=", "LOG_FILE_DIR", ";", "if", "(", "dir", ".", "exists", "(", ")", ")", "{", "File", "[", "]", "files", "=", "dir", ".", "listFiles", "(", ")", ";", "for", "(", "File", "f", ":", "files", ")", "{", "if", "(", "f", ".", "length", "(", ")", "==", "0", "||", "f", ".", "lastModified", "(", ")", "+", "MAXFILEAGE", "<", "System", ".", "currentTimeMillis", "(", ")", ")", "{", "f", ".", "delete", "(", ")", ";", "}", "}", "}", "}" ]
delete of files more than 1 day old
[ "delete", "of", "files", "more", "than", "1", "day", "old" ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L1217-L1229
161,698
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRExternalScene.java
GVRExternalScene.load
public boolean load(GVRScene scene) { GVRAssetLoader loader = getGVRContext().getAssetLoader(); if (scene == null) { scene = getGVRContext().getMainScene(); } if (mReplaceScene) { loader.loadScene(getOwnerObject(), mVolume, mImportSettings, scene, null); } else { loader.loadModel(getOwnerObject(), mVolume, mImportSettings, scene); } return true; }
java
public boolean load(GVRScene scene) { GVRAssetLoader loader = getGVRContext().getAssetLoader(); if (scene == null) { scene = getGVRContext().getMainScene(); } if (mReplaceScene) { loader.loadScene(getOwnerObject(), mVolume, mImportSettings, scene, null); } else { loader.loadModel(getOwnerObject(), mVolume, mImportSettings, scene); } return true; }
[ "public", "boolean", "load", "(", "GVRScene", "scene", ")", "{", "GVRAssetLoader", "loader", "=", "getGVRContext", "(", ")", ".", "getAssetLoader", "(", ")", ";", "if", "(", "scene", "==", "null", ")", "{", "scene", "=", "getGVRContext", "(", ")", ".", "getMainScene", "(", ")", ";", "}", "if", "(", "mReplaceScene", ")", "{", "loader", ".", "loadScene", "(", "getOwnerObject", "(", ")", ",", "mVolume", ",", "mImportSettings", ",", "scene", ",", "null", ")", ";", "}", "else", "{", "loader", ".", "loadModel", "(", "getOwnerObject", "(", ")", ",", "mVolume", ",", "mImportSettings", ",", "scene", ")", ";", "}", "return", "true", ";", "}" ]
Loads the asset referenced by the file name under the owner of this component. If this component was constructed to replace the scene with the asset, the scene will contain only the owner of this component upon return. Otherwise, the loaded asset is a child of this component's owner. Loading the asset is performed in a separate thread. This function returns before the asset has finished loading. IAssetEvents are emitted to the event listener on the context. @param scene scene to add the model to, null is permissible @return always true
[ "Loads", "the", "asset", "referenced", "by", "the", "file", "name", "under", "the", "owner", "of", "this", "component", ".", "If", "this", "component", "was", "constructed", "to", "replace", "the", "scene", "with", "the", "asset", "the", "scene", "will", "contain", "only", "the", "owner", "of", "this", "component", "upon", "return", ".", "Otherwise", "the", "loaded", "asset", "is", "a", "child", "of", "this", "component", "s", "owner", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRExternalScene.java#L133-L150
161,699
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/GVRExternalScene.java
GVRExternalScene.load
public void load(IAssetEvents handler) { GVRAssetLoader loader = getGVRContext().getAssetLoader(); if (mReplaceScene) { loader.loadScene(getOwnerObject(), mVolume, mImportSettings, getGVRContext().getMainScene(), handler); } else { loader.loadModel(mVolume, getOwnerObject(), mImportSettings, true, handler); } }
java
public void load(IAssetEvents handler) { GVRAssetLoader loader = getGVRContext().getAssetLoader(); if (mReplaceScene) { loader.loadScene(getOwnerObject(), mVolume, mImportSettings, getGVRContext().getMainScene(), handler); } else { loader.loadModel(mVolume, getOwnerObject(), mImportSettings, true, handler); } }
[ "public", "void", "load", "(", "IAssetEvents", "handler", ")", "{", "GVRAssetLoader", "loader", "=", "getGVRContext", "(", ")", ".", "getAssetLoader", "(", ")", ";", "if", "(", "mReplaceScene", ")", "{", "loader", ".", "loadScene", "(", "getOwnerObject", "(", ")", ",", "mVolume", ",", "mImportSettings", ",", "getGVRContext", "(", ")", ".", "getMainScene", "(", ")", ",", "handler", ")", ";", "}", "else", "{", "loader", ".", "loadModel", "(", "mVolume", ",", "getOwnerObject", "(", ")", ",", "mImportSettings", ",", "true", ",", "handler", ")", ";", "}", "}" ]
Loads the asset referenced by the file name under the owner of this component. If this component was constructed to replace the scene with the asset, the main scene of the current context will contain only the owner of this component upon return. Otherwise, the loaded asset is a child of this component's owner. Loading the asset is performed in a separate thread. This function returns before the asset has finished loading. IAssetEvents are emitted to the input event handler and to any event listener on the context. @param handler IAssetEvents handler to process asset loading events
[ "Loads", "the", "asset", "referenced", "by", "the", "file", "name", "under", "the", "owner", "of", "this", "component", ".", "If", "this", "component", "was", "constructed", "to", "replace", "the", "scene", "with", "the", "asset", "the", "main", "scene", "of", "the", "current", "context", "will", "contain", "only", "the", "owner", "of", "this", "component", "upon", "return", ".", "Otherwise", "the", "loaded", "asset", "is", "a", "child", "of", "this", "component", "s", "owner", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRExternalScene.java#L169-L181