repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRRotationKey.java | GVRRotationKey.setValue | public void setValue(Quaternionf rot) {
mX = rot.x;
mY = rot.y;
mZ = rot.z;
mW = rot.w;
} | java | public void setValue(Quaternionf rot) {
mX = rot.x;
mY = rot.y;
mZ = rot.z;
mW = rot.w;
} | [
"public",
"void",
"setValue",
"(",
"Quaternionf",
"rot",
")",
"{",
"mX",
"=",
"rot",
".",
"x",
";",
"mY",
"=",
"rot",
".",
"y",
";",
"mZ",
"=",
"rot",
".",
"z",
";",
"mW",
"=",
"rot",
".",
"w",
";",
"}"
] | Sets the quaternion of the keyframe. | [
"Sets",
"the",
"quaternion",
"of",
"the",
"keyframe",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/keyframe/GVRRotationKey.java#L44-L49 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFloatImage.java | GVRFloatImage.update | public void update(int width, int height, float[] data)
throws IllegalArgumentException
{
if ((width <= 0) || (height <= 0) ||
(data == null) || (data.length < height * width * mFloatsPerPixel))
{
throw new IllegalArgumentException();
}
NativeFloatImage.update(getNative(), width, height, 0, data);
} | java | public void update(int width, int height, float[] data)
throws IllegalArgumentException
{
if ((width <= 0) || (height <= 0) ||
(data == null) || (data.length < height * width * mFloatsPerPixel))
{
throw new IllegalArgumentException();
}
NativeFloatImage.update(getNative(), width, height, 0, data);
} | [
"public",
"void",
"update",
"(",
"int",
"width",
",",
"int",
"height",
",",
"float",
"[",
"]",
"data",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"(",
"width",
"<=",
"0",
")",
"||",
"(",
"height",
"<=",
"0",
")",
"||",
"(",
"data",
... | Copy new data to an existing float-point texture.
Creating a new {@link GVRFloatImage} is pretty cheap, but it's still
not a totally trivial operation: it does involve some memory management
and some GL hardware handshaking. Reusing the texture reduces this
overhead (primarily by delaying garbage collection). Do be aware that
updating a texture will affect any and all {@linkplain GVRMaterial
materials} (and/or post effects that use the texture!
@param width
Texture width, in pixels
@param height
Texture height, in pixels
@param data
A linear array of float pairs.
@return {@code true} if the updateGPU succeeded, and {@code false} if it
failed. Updating a texture requires that the new data parameter
has the exact same {@code width} and {@code height} and pixel
format as the original data.
@throws IllegalArgumentException
If {@code width} or {@code height} is {@literal <= 0,} or if
{@code data} is {@code null}, or if
{@code data.length < height * width * 2} | [
"Copy",
"new",
"data",
"to",
"an",
"existing",
"float",
"-",
"point",
"texture",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFloatImage.java#L92-L101 | train |
Samsung/GearVRf | GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/ImageTexture.java | ImageTexture.getUrl | public String[] getUrl() {
String[] valueDestination = new String[ url.size() ];
this.url.getValue(valueDestination);
return valueDestination;
} | java | public String[] getUrl() {
String[] valueDestination = new String[ url.size() ];
this.url.getValue(valueDestination);
return valueDestination;
} | [
"public",
"String",
"[",
"]",
"getUrl",
"(",
")",
"{",
"String",
"[",
"]",
"valueDestination",
"=",
"new",
"String",
"[",
"url",
".",
"size",
"(",
")",
"]",
";",
"this",
".",
"url",
".",
"getValue",
"(",
"valueDestination",
")",
";",
"return",
"value... | Provide array of String results from inputOutput MFString field named url.
@array saved in valueDestination | [
"Provide",
"array",
"of",
"String",
"results",
"from",
"inputOutput",
"MFString",
"field",
"named",
"url",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/x3d/src/main/java/org/gearvrf/x3d/node/ImageTexture.java#L68-L72 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/ArchLayout.java | ArchLayout.getSizeArcLength | protected float getSizeArcLength(float angle) {
if (mRadius <= 0) {
throw new IllegalArgumentException("mRadius is not specified!");
}
return angle == Float.MAX_VALUE ? Float.MAX_VALUE :
LayoutHelpers.lengthOfArc(angle, mRadius);
} | java | protected float getSizeArcLength(float angle) {
if (mRadius <= 0) {
throw new IllegalArgumentException("mRadius is not specified!");
}
return angle == Float.MAX_VALUE ? Float.MAX_VALUE :
LayoutHelpers.lengthOfArc(angle, mRadius);
} | [
"protected",
"float",
"getSizeArcLength",
"(",
"float",
"angle",
")",
"{",
"if",
"(",
"mRadius",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"mRadius is not specified!\"",
")",
";",
"}",
"return",
"angle",
"==",
"Float",
".",
"MAX_V... | Calculate the arc length by angle and radius
@param angle
@return arc length | [
"Calculate",
"the",
"arc",
"length",
"by",
"angle",
"and",
"radius"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/basic/ArchLayout.java#L114-L120 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java | GVRConsole.writeLine | public void writeLine(String pattern, Object... parameters) {
String line = (parameters == null || parameters.length == 0) ? pattern
: String.format(pattern, parameters);
lines.add(0, line); // we'll write bottom to top, then purge unwritten
// lines from end
updateHUD();
} | java | public void writeLine(String pattern, Object... parameters) {
String line = (parameters == null || parameters.length == 0) ? pattern
: String.format(pattern, parameters);
lines.add(0, line); // we'll write bottom to top, then purge unwritten
// lines from end
updateHUD();
} | [
"public",
"void",
"writeLine",
"(",
"String",
"pattern",
",",
"Object",
"...",
"parameters",
")",
"{",
"String",
"line",
"=",
"(",
"parameters",
"==",
"null",
"||",
"parameters",
".",
"length",
"==",
"0",
")",
"?",
"pattern",
":",
"String",
".",
"format"... | Write a message to the console.
@param pattern
A {@link String#format(String, Object...)} pattern
@param parameters
Optional parameters to plug into the pattern | [
"Write",
"a",
"message",
"to",
"the",
"console",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java#L178-L184 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java | GVRConsole.setCanvasWidthHeight | public void setCanvasWidthHeight(int width, int height) {
hudWidth = width;
hudHeight = height;
HUD = Bitmap.createBitmap(width, height, Config.ARGB_8888);
canvas = new Canvas(HUD);
texture = null;
} | java | public void setCanvasWidthHeight(int width, int height) {
hudWidth = width;
hudHeight = height;
HUD = Bitmap.createBitmap(width, height, Config.ARGB_8888);
canvas = new Canvas(HUD);
texture = null;
} | [
"public",
"void",
"setCanvasWidthHeight",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"hudWidth",
"=",
"width",
";",
"hudHeight",
"=",
"height",
";",
"HUD",
"=",
"Bitmap",
".",
"createBitmap",
"(",
"width",
",",
"height",
",",
"Config",
".",
"AR... | Sets the width and height of the canvas the text is drawn to.
@param width
width of the new canvas.
@param height
hegiht of the new canvas. | [
"Sets",
"the",
"width",
"and",
"height",
"of",
"the",
"canvas",
"the",
"text",
"is",
"drawn",
"to",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsole.java#L336-L342 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.scale | public static void scale(GVRMesh mesh, float x, float y, float z) {
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
for (int i = 0; i < vsize; i += 3) {
vertices[i] *= x;
vertices[i + 1] *= y;
vertices[i + 2] *= z;
}
mesh.setVertices(vertices);
} | java | public static void scale(GVRMesh mesh, float x, float y, float z) {
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
for (int i = 0; i < vsize; i += 3) {
vertices[i] *= x;
vertices[i + 1] *= y;
vertices[i + 2] *= z;
}
mesh.setVertices(vertices);
} | [
"public",
"static",
"void",
"scale",
"(",
"GVRMesh",
"mesh",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"final",
"float",
"[",
"]",
"vertices",
"=",
"mesh",
".",
"getVertices",
"(",
")",
";",
"final",
"int",
"vsize",
"=",
"v... | Scale the mesh at x, y and z axis.
@param mesh Mesh to be scaled.
@param x Scale to be applied on x-axis.
@param y Scale to be applied on y-axis.
@param z Scale to be applied on z-axis. | [
"Scale",
"the",
"mesh",
"at",
"x",
"y",
"and",
"z",
"axis",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L35-L46 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.resize | public static void resize(GVRMesh mesh, float xsize, float ysize, float zsize) {
float dim[] = getBoundingSize(mesh);
scale(mesh, xsize / dim[0], ysize / dim[1], zsize / dim[2]);
} | java | public static void resize(GVRMesh mesh, float xsize, float ysize, float zsize) {
float dim[] = getBoundingSize(mesh);
scale(mesh, xsize / dim[0], ysize / dim[1], zsize / dim[2]);
} | [
"public",
"static",
"void",
"resize",
"(",
"GVRMesh",
"mesh",
",",
"float",
"xsize",
",",
"float",
"ysize",
",",
"float",
"zsize",
")",
"{",
"float",
"dim",
"[",
"]",
"=",
"getBoundingSize",
"(",
"mesh",
")",
";",
"scale",
"(",
"mesh",
",",
"xsize",
... | Resize the mesh to given size for each axis.
@param mesh Mesh to be resized.
@param xsize Size for x-axis.
@param ysize Size for y-axis.
@param zsize Size fof z-axis. | [
"Resize",
"the",
"mesh",
"to",
"given",
"size",
"for",
"each",
"axis",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L66-L70 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.resize | public static void resize(GVRMesh mesh, float size) {
float dim[] = getBoundingSize(mesh);
float maxsize = 0.0f;
if (dim[0] > maxsize) maxsize = dim[0];
if (dim[1] > maxsize) maxsize = dim[1];
if (dim[2] > maxsize) maxsize = dim[2];
scale(mesh, size / maxsize);
} | java | public static void resize(GVRMesh mesh, float size) {
float dim[] = getBoundingSize(mesh);
float maxsize = 0.0f;
if (dim[0] > maxsize) maxsize = dim[0];
if (dim[1] > maxsize) maxsize = dim[1];
if (dim[2] > maxsize) maxsize = dim[2];
scale(mesh, size / maxsize);
} | [
"public",
"static",
"void",
"resize",
"(",
"GVRMesh",
"mesh",
",",
"float",
"size",
")",
"{",
"float",
"dim",
"[",
"]",
"=",
"getBoundingSize",
"(",
"mesh",
")",
";",
"float",
"maxsize",
"=",
"0.0f",
";",
"if",
"(",
"dim",
"[",
"0",
"]",
">",
"maxs... | Resize the given mesh keeping its aspect ration.
@param mesh Mesh to be resized.
@param size Max size for the axis. | [
"Resize",
"the",
"given",
"mesh",
"keeping",
"its",
"aspect",
"ration",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L77-L86 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.getBoundingSize | public static float[] getBoundingSize(GVRMesh mesh) {
final float [] dim = new float[3];
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
float minx = Integer.MAX_VALUE;
float miny = Integer.MAX_VALUE;
float minz = Integer.MAX_VALUE;
float maxx = Integer.MIN_VALUE;
float maxy = Integer.MIN_VALUE;
float maxz = Integer.MIN_VALUE;
for (int i = 0; i < vsize; i += 3) {
if (vertices[i] < minx) minx = vertices[i];
if (vertices[i] > maxx) maxx = vertices[i];
if (vertices[i + 1] < miny) miny = vertices[i + 1];
if (vertices[i + 1] > maxy) maxy = vertices[i + 1];
if (vertices[i + 2] < minz) minz = vertices[i + 2];
if (vertices[i + 2] > maxz) maxz = vertices[i + 2];
}
dim[0] = maxx - minx;
dim[1] = maxy - miny;
dim[2] = maxz - minz;
return dim;
} | java | public static float[] getBoundingSize(GVRMesh mesh) {
final float [] dim = new float[3];
final float [] vertices = mesh.getVertices();
final int vsize = vertices.length;
float minx = Integer.MAX_VALUE;
float miny = Integer.MAX_VALUE;
float minz = Integer.MAX_VALUE;
float maxx = Integer.MIN_VALUE;
float maxy = Integer.MIN_VALUE;
float maxz = Integer.MIN_VALUE;
for (int i = 0; i < vsize; i += 3) {
if (vertices[i] < minx) minx = vertices[i];
if (vertices[i] > maxx) maxx = vertices[i];
if (vertices[i + 1] < miny) miny = vertices[i + 1];
if (vertices[i + 1] > maxy) maxy = vertices[i + 1];
if (vertices[i + 2] < minz) minz = vertices[i + 2];
if (vertices[i + 2] > maxz) maxz = vertices[i + 2];
}
dim[0] = maxx - minx;
dim[1] = maxy - miny;
dim[2] = maxz - minz;
return dim;
} | [
"public",
"static",
"float",
"[",
"]",
"getBoundingSize",
"(",
"GVRMesh",
"mesh",
")",
"{",
"final",
"float",
"[",
"]",
"dim",
"=",
"new",
"float",
"[",
"3",
"]",
";",
"final",
"float",
"[",
"]",
"vertices",
"=",
"mesh",
".",
"getVertices",
"(",
")",... | Calcs the bonding size of given mesh.
@param mesh Mesh to calc its bouding size.
@return The bounding size for x, y and z axis. | [
"Calcs",
"the",
"bonding",
"size",
"of",
"given",
"mesh",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L107-L134 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java | MeshUtils.createQuad | public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {
GVRMesh mesh = new GVRMesh(gvrContext);
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, height * -0.5f, 0.0f };
mesh.setVertices(vertices);
final float[] normals = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 1.0f };
mesh.setNormals(normals);
final float[] texCoords = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
1.0f };
mesh.setTexCoords(texCoords);
char[] triangles = { 0, 1, 2, 1, 3, 2 };
mesh.setIndices(triangles);
return mesh;
} | java | public static GVRMesh createQuad(GVRContext gvrContext, float width, float height) {
GVRMesh mesh = new GVRMesh(gvrContext);
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, height * -0.5f, 0.0f };
mesh.setVertices(vertices);
final float[] normals = { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 1.0f };
mesh.setNormals(normals);
final float[] texCoords = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
1.0f };
mesh.setTexCoords(texCoords);
char[] triangles = { 0, 1, 2, 1, 3, 2 };
mesh.setIndices(triangles);
return mesh;
} | [
"public",
"static",
"GVRMesh",
"createQuad",
"(",
"GVRContext",
"gvrContext",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"GVRMesh",
"mesh",
"=",
"new",
"GVRMesh",
"(",
"gvrContext",
")",
";",
"float",
"[",
"]",
"vertices",
"=",
"{",
"width",
... | Creates a quad consisting of two triangles, with the specified width and
height.
@param gvrContext current {@link GVRContext}
@param width
the quad's width
@param height
the quad's height
@return A 2D, rectangular mesh with four vertices and two triangles | [
"Creates",
"a",
"quad",
"consisting",
"of",
"two",
"triangles",
"with",
"the",
"specified",
"width",
"and",
"height",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/MeshUtils.java#L148-L168 | train |
Samsung/GearVRf | GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java | OvrViewManager.onSurfaceChanged | void onSurfaceChanged(int width, int height) {
Log.v(TAG, "onSurfaceChanged");
final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat();
mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferParams.DepthFormat.DEPTH_24_STENCIL_8 == depthFormat);
} | java | void onSurfaceChanged(int width, int height) {
Log.v(TAG, "onSurfaceChanged");
final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat();
mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferParams.DepthFormat.DEPTH_24_STENCIL_8 == depthFormat);
} | [
"void",
"onSurfaceChanged",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"Log",
".",
"v",
"(",
"TAG",
",",
"\"onSurfaceChanged\"",
")",
";",
"final",
"VrAppSettings",
".",
"EyeBufferParams",
".",
"DepthFormat",
"depthFormat",
"=",
"mApplication",
".",
... | Called when the surface is created or recreated. Avoided because this can
be called twice at the beginning. | [
"Called",
"when",
"the",
"surface",
"is",
"created",
"or",
"recreated",
".",
"Avoided",
"because",
"this",
"can",
"be",
"called",
"twice",
"at",
"the",
"beginning",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java#L145-L150 | train |
Samsung/GearVRf | GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java | OvrViewManager.onDrawEye | void onDrawEye(int eye, int swapChainIndex, boolean use_multiview) {
mCurrentEye = eye;
if (!(mSensoredScene == null || !mMainScene.equals(mSensoredScene))) {
GVRCameraRig mainCameraRig = mMainScene.getMainCameraRig();
if (use_multiview) {
if (DEBUG_STATS) {
mTracerDrawEyes1.enter(); // this eye is drawn first
mTracerDrawEyes2.enter();
}
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.MULTIVIEW, swapChainIndex);
GVRCamera camera = mMainScene.getMainCameraRig().getCenterCamera();
GVRCamera left_camera = mMainScene.getMainCameraRig().getLeftCamera();
renderTarget.cullFromCamera(mMainScene, camera,mRenderBundle.getShaderManager());
captureCenterEye(renderTarget, true);
capture3DScreenShot(renderTarget, true);
renderTarget.render(mMainScene, left_camera, mRenderBundle.getShaderManager(),mRenderBundle.getPostEffectRenderTextureA(),
mRenderBundle.getPostEffectRenderTextureB());
captureRightEye(renderTarget, true);
captureLeftEye(renderTarget, true);
captureFinish();
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes2.leave();
}
} else {
if (eye == 1) {
if (DEBUG_STATS) {
mTracerDrawEyes1.enter();
}
GVRCamera rightCamera = mainCameraRig.getRightCamera();
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.RIGHT, swapChainIndex);
renderTarget.render(mMainScene, rightCamera, mRenderBundle.getShaderManager(), mRenderBundle.getPostEffectRenderTextureA(),
mRenderBundle.getPostEffectRenderTextureB());
captureRightEye(renderTarget, false);
captureFinish();
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes.leave();
}
} else {
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes.leave();
}
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.LEFT, swapChainIndex);
GVRCamera leftCamera = mainCameraRig.getLeftCamera();
capture3DScreenShot(renderTarget, false);
renderTarget.cullFromCamera(mMainScene, mainCameraRig.getCenterCamera(), mRenderBundle.getShaderManager());
captureCenterEye(renderTarget, false);
renderTarget.render(mMainScene, leftCamera, mRenderBundle.getShaderManager(), mRenderBundle.getPostEffectRenderTextureA(), mRenderBundle.getPostEffectRenderTextureB());
captureLeftEye(renderTarget, false);
if (DEBUG_STATS) {
mTracerDrawEyes2.leave();
}
}
}
}
} | java | void onDrawEye(int eye, int swapChainIndex, boolean use_multiview) {
mCurrentEye = eye;
if (!(mSensoredScene == null || !mMainScene.equals(mSensoredScene))) {
GVRCameraRig mainCameraRig = mMainScene.getMainCameraRig();
if (use_multiview) {
if (DEBUG_STATS) {
mTracerDrawEyes1.enter(); // this eye is drawn first
mTracerDrawEyes2.enter();
}
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.MULTIVIEW, swapChainIndex);
GVRCamera camera = mMainScene.getMainCameraRig().getCenterCamera();
GVRCamera left_camera = mMainScene.getMainCameraRig().getLeftCamera();
renderTarget.cullFromCamera(mMainScene, camera,mRenderBundle.getShaderManager());
captureCenterEye(renderTarget, true);
capture3DScreenShot(renderTarget, true);
renderTarget.render(mMainScene, left_camera, mRenderBundle.getShaderManager(),mRenderBundle.getPostEffectRenderTextureA(),
mRenderBundle.getPostEffectRenderTextureB());
captureRightEye(renderTarget, true);
captureLeftEye(renderTarget, true);
captureFinish();
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes2.leave();
}
} else {
if (eye == 1) {
if (DEBUG_STATS) {
mTracerDrawEyes1.enter();
}
GVRCamera rightCamera = mainCameraRig.getRightCamera();
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.RIGHT, swapChainIndex);
renderTarget.render(mMainScene, rightCamera, mRenderBundle.getShaderManager(), mRenderBundle.getPostEffectRenderTextureA(),
mRenderBundle.getPostEffectRenderTextureB());
captureRightEye(renderTarget, false);
captureFinish();
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes.leave();
}
} else {
if (DEBUG_STATS) {
mTracerDrawEyes1.leave();
mTracerDrawEyes.leave();
}
GVRRenderTarget renderTarget = mRenderBundle.getRenderTarget(EYE.LEFT, swapChainIndex);
GVRCamera leftCamera = mainCameraRig.getLeftCamera();
capture3DScreenShot(renderTarget, false);
renderTarget.cullFromCamera(mMainScene, mainCameraRig.getCenterCamera(), mRenderBundle.getShaderManager());
captureCenterEye(renderTarget, false);
renderTarget.render(mMainScene, leftCamera, mRenderBundle.getShaderManager(), mRenderBundle.getPostEffectRenderTextureA(), mRenderBundle.getPostEffectRenderTextureB());
captureLeftEye(renderTarget, false);
if (DEBUG_STATS) {
mTracerDrawEyes2.leave();
}
}
}
}
} | [
"void",
"onDrawEye",
"(",
"int",
"eye",
",",
"int",
"swapChainIndex",
",",
"boolean",
"use_multiview",
")",
"{",
"mCurrentEye",
"=",
"eye",
";",
"if",
"(",
"!",
"(",
"mSensoredScene",
"==",
"null",
"||",
"!",
"mMainScene",
".",
"equals",
"(",
"mSensoredSce... | Called from the native side
@param eye | [
"Called",
"from",
"the",
"native",
"side"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/backend_oculus/src/main/java/org/gearvrf/OvrViewManager.java#L174-L249 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java | GVRResourceVolume.openResource | public GVRAndroidResource openResource(String filePath) throws IOException {
// Error tolerance: Remove initial '/' introduced by file::///filename
// In this case, the path is interpreted as relative to defaultPath,
// which is the root of the filesystem.
if (filePath.startsWith(File.separator)) {
filePath = filePath.substring(File.separator.length());
}
filePath = adaptFilePath(filePath);
String path;
int resourceId;
GVRAndroidResource resourceKey;
switch (volumeType) {
case ANDROID_ASSETS:
// Resolve '..' and '.'
path = getFullPath(defaultPath, filePath);
path = new File(path).getCanonicalPath();
if (path.startsWith(File.separator)) {
path = path.substring(1);
}
resourceKey = new GVRAndroidResource(gvrContext, path);
break;
case ANDROID_RESOURCE:
path = FileNameUtils.getBaseName(filePath);
resourceId = gvrContext.getContext().getResources().getIdentifier(path, "raw", gvrContext.getContext().getPackageName());
if (resourceId == 0) {
throw new FileNotFoundException(filePath + " resource not found");
}
resourceKey = new GVRAndroidResource(gvrContext, resourceId);
break;
case LINUX_FILESYSTEM:
resourceKey = new GVRAndroidResource(
getFullPath(defaultPath, filePath));
break;
case ANDROID_SDCARD:
String linuxPath = Environment.getExternalStorageDirectory()
.getAbsolutePath();
resourceKey = new GVRAndroidResource(
getFullPath(linuxPath, defaultPath, filePath));
break;
case INPUT_STREAM:
resourceKey = new GVRAndroidResource(getFullPath(defaultPath, filePath), volumeInputStream);
break;
case NETWORK:
resourceKey = new GVRAndroidResource(gvrContext,
getFullURL(defaultPath, filePath), enableUrlLocalCache);
break;
default:
throw new IOException(
String.format("Unrecognized volumeType %s", volumeType));
}
return addResource(resourceKey);
} | java | public GVRAndroidResource openResource(String filePath) throws IOException {
// Error tolerance: Remove initial '/' introduced by file::///filename
// In this case, the path is interpreted as relative to defaultPath,
// which is the root of the filesystem.
if (filePath.startsWith(File.separator)) {
filePath = filePath.substring(File.separator.length());
}
filePath = adaptFilePath(filePath);
String path;
int resourceId;
GVRAndroidResource resourceKey;
switch (volumeType) {
case ANDROID_ASSETS:
// Resolve '..' and '.'
path = getFullPath(defaultPath, filePath);
path = new File(path).getCanonicalPath();
if (path.startsWith(File.separator)) {
path = path.substring(1);
}
resourceKey = new GVRAndroidResource(gvrContext, path);
break;
case ANDROID_RESOURCE:
path = FileNameUtils.getBaseName(filePath);
resourceId = gvrContext.getContext().getResources().getIdentifier(path, "raw", gvrContext.getContext().getPackageName());
if (resourceId == 0) {
throw new FileNotFoundException(filePath + " resource not found");
}
resourceKey = new GVRAndroidResource(gvrContext, resourceId);
break;
case LINUX_FILESYSTEM:
resourceKey = new GVRAndroidResource(
getFullPath(defaultPath, filePath));
break;
case ANDROID_SDCARD:
String linuxPath = Environment.getExternalStorageDirectory()
.getAbsolutePath();
resourceKey = new GVRAndroidResource(
getFullPath(linuxPath, defaultPath, filePath));
break;
case INPUT_STREAM:
resourceKey = new GVRAndroidResource(getFullPath(defaultPath, filePath), volumeInputStream);
break;
case NETWORK:
resourceKey = new GVRAndroidResource(gvrContext,
getFullURL(defaultPath, filePath), enableUrlLocalCache);
break;
default:
throw new IOException(
String.format("Unrecognized volumeType %s", volumeType));
}
return addResource(resourceKey);
} | [
"public",
"GVRAndroidResource",
"openResource",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"// Error tolerance: Remove initial '/' introduced by file::///filename",
"// In this case, the path is interpreted as relative to defaultPath,",
"// which is the root of the filesys... | Opens a file from the volume. The filePath is relative to the
defaultPath.
@param filePath
File path of the resource to open.
@throws IOException | [
"Opens",
"a",
"file",
"from",
"the",
"volume",
".",
"The",
"filePath",
"is",
"relative",
"to",
"the",
"defaultPath",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java#L281-L340 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java | GVRResourceVolume.adaptFilePath | protected String adaptFilePath(String filePath) {
// Convert windows file path to target FS
String targetPath = filePath.replaceAll("\\\\", volumeType.getSeparator());
return targetPath;
} | java | protected String adaptFilePath(String filePath) {
// Convert windows file path to target FS
String targetPath = filePath.replaceAll("\\\\", volumeType.getSeparator());
return targetPath;
} | [
"protected",
"String",
"adaptFilePath",
"(",
"String",
"filePath",
")",
"{",
"// Convert windows file path to target FS",
"String",
"targetPath",
"=",
"filePath",
".",
"replaceAll",
"(",
"\"\\\\\\\\\"",
",",
"volumeType",
".",
"getSeparator",
"(",
")",
")",
";",
"re... | Adapt a file path to the current file system.
@param filePath The input file path string.
@return File path compatible with the file system of this {@link GVRResourceVolume}. | [
"Adapt",
"a",
"file",
"path",
"to",
"the",
"current",
"file",
"system",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRResourceVolume.java#L357-L362 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getFloatVec | public FloatBuffer getFloatVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
FloatBuffer data = buffer.asFloatBuffer();
if (!NativeVertexBuffer.getFloatVec(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return data;
} | java | public FloatBuffer getFloatVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
FloatBuffer data = buffer.asFloatBuffer();
if (!NativeVertexBuffer.getFloatVec(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return data;
} | [
"public",
"FloatBuffer",
"getFloatVec",
"(",
"String",
"attributeName",
")",
"{",
"int",
"size",
"=",
"getAttributeSize",
"(",
"attributeName",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"size",
"*=",
"4",
"*",
"getVert... | Retrieves a vertex attribute as a float buffer.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>
@see #setFloatArray(String, float[])
@see #getFloatVec(String) | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"a",
"float",
"buffer",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L152-L167 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getFloatArray | public float[] getFloatArray(String attributeName)
{
float[] array = NativeVertexBuffer.getFloatArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | java | public float[] getFloatArray(String attributeName)
{
float[] array = NativeVertexBuffer.getFloatArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | [
"public",
"float",
"[",
"]",
"getFloatArray",
"(",
"String",
"attributeName",
")",
"{",
"float",
"[",
"]",
"array",
"=",
"NativeVertexBuffer",
".",
"getFloatArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
")",
";",
"if",
"(",
"array",
"==",
"null... | Retrieves a vertex attribute as a float array.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>
@see #setFloatVec(String, FloatBuffer)
@see #getFloatArray(String) | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"a",
"float",
"array",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L178-L186 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getIntVec | public IntBuffer getIntVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
IntBuffer data = buffer.asIntBuffer();
if (!NativeVertexBuffer.getIntVec(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return data;
} | java | public IntBuffer getIntVec(String attributeName)
{
int size = getAttributeSize(attributeName);
if (size <= 0)
{
return null;
}
size *= 4 * getVertexCount();
ByteBuffer buffer = ByteBuffer.allocateDirect(size).order(ByteOrder.nativeOrder());
IntBuffer data = buffer.asIntBuffer();
if (!NativeVertexBuffer.getIntVec(getNative(), attributeName, data, 0, 0))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return data;
} | [
"public",
"IntBuffer",
"getIntVec",
"(",
"String",
"attributeName",
")",
"{",
"int",
"size",
"=",
"getAttributeSize",
"(",
"attributeName",
")",
";",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"size",
"*=",
"4",
"*",
"getVertexCo... | Retrieves a vertex attribute as an integer buffer.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>int</i>
@see #setIntArray(String, int[])
@see #getIntVec(String) | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"an",
"integer",
"buffer",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L197-L212 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getIntArray | public int[] getIntArray(String attributeName)
{
int[] array = NativeVertexBuffer.getIntArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | java | public int[] getIntArray(String attributeName)
{
int[] array = NativeVertexBuffer.getIntArray(getNative(), attributeName);
if (array == null)
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be accessed");
}
return array;
} | [
"public",
"int",
"[",
"]",
"getIntArray",
"(",
"String",
"attributeName",
")",
"{",
"int",
"[",
"]",
"array",
"=",
"NativeVertexBuffer",
".",
"getIntArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",
")",
";",
"if",
"(",
"array",
"==",
"null",
")"... | Retrieves a vertex attribute as an integer array.
The attribute name must be one of the
attributes named in the descriptor passed to the constructor.
@param attributeName name of the attribute to update
@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>int</i>
@see #setIntVec(String, IntBuffer)
@see #getIntArray(String) | [
"Retrieves",
"a",
"vertex",
"attribute",
"as",
"an",
"integer",
"array",
".",
"The",
"attribute",
"name",
"must",
"be",
"one",
"of",
"the",
"attributes",
"named",
"in",
"the",
"descriptor",
"passed",
"to",
"the",
"constructor",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L223-L231 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getSphereBound | public float getSphereBound(float[] sphere)
{
if ((sphere == null) || (sphere.length != 4) ||
((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0))
{
throw new IllegalArgumentException("Cannot copy sphere bound into array provided");
}
return sphere[0];
} | java | public float getSphereBound(float[] sphere)
{
if ((sphere == null) || (sphere.length != 4) ||
((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0))
{
throw new IllegalArgumentException("Cannot copy sphere bound into array provided");
}
return sphere[0];
} | [
"public",
"float",
"getSphereBound",
"(",
"float",
"[",
"]",
"sphere",
")",
"{",
"if",
"(",
"(",
"sphere",
"==",
"null",
")",
"||",
"(",
"sphere",
".",
"length",
"!=",
"4",
")",
"||",
"(",
"(",
"NativeVertexBuffer",
".",
"getBoundingVolume",
"(",
"getN... | Returns the bounding sphere of the vertices.
@param sphere destination array to get bounding sphere.
The first entry is the radius, the next
three are the center.
@return radius of bounding sphere or 0.0 if no vertices | [
"Returns",
"the",
"bounding",
"sphere",
"of",
"the",
"vertices",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L551-L559 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.getBoxBound | public boolean getBoxBound(float[] corners)
{
int rc;
if ((corners == null) || (corners.length != 6) ||
((rc = NativeVertexBuffer.getBoundingVolume(getNative(), corners)) < 0))
{
throw new IllegalArgumentException("Cannot copy box bound into array provided");
}
return rc != 0;
} | java | public boolean getBoxBound(float[] corners)
{
int rc;
if ((corners == null) || (corners.length != 6) ||
((rc = NativeVertexBuffer.getBoundingVolume(getNative(), corners)) < 0))
{
throw new IllegalArgumentException("Cannot copy box bound into array provided");
}
return rc != 0;
} | [
"public",
"boolean",
"getBoxBound",
"(",
"float",
"[",
"]",
"corners",
")",
"{",
"int",
"rc",
";",
"if",
"(",
"(",
"corners",
"==",
"null",
")",
"||",
"(",
"corners",
".",
"length",
"!=",
"6",
")",
"||",
"(",
"(",
"rc",
"=",
"NativeVertexBuffer",
"... | Returns the bounding box of the vertices.
@param corners destination array to get corners of bounding box.
The first three entries are the minimum X,Y,Z values
and the next three are the maximum X,Y,Z.
@return true if bounds are not empty, false if empty (no vertices) | [
"Returns",
"the",
"bounding",
"box",
"of",
"the",
"vertices",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L568-L577 | train |
Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.load | public void load(String soundFile)
{
if (mSoundFile != null)
{
unload();
}
mSoundFile = soundFile;
if (mAudioListener != null)
{
mAudioListener.getAudioEngine().preloadSoundFile(soundFile);
Log.d("SOUND", "loaded audio file %s", getSoundFile());
}
} | java | public void load(String soundFile)
{
if (mSoundFile != null)
{
unload();
}
mSoundFile = soundFile;
if (mAudioListener != null)
{
mAudioListener.getAudioEngine().preloadSoundFile(soundFile);
Log.d("SOUND", "loaded audio file %s", getSoundFile());
}
} | [
"public",
"void",
"load",
"(",
"String",
"soundFile",
")",
"{",
"if",
"(",
"mSoundFile",
"!=",
"null",
")",
"{",
"unload",
"(",
")",
";",
"}",
"mSoundFile",
"=",
"soundFile",
";",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"mAudioListener",
"... | Preloads a sound file.
@param soundFile path/name of the file to be played. | [
"Preloads",
"a",
"sound",
"file",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L85-L97 | train |
Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.unload | public void unload()
{
if (mAudioListener != null)
{
Log.d("SOUND", "unloading audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().unloadSoundFile(getSoundFile());
}
mSoundFile = null;
mSourceId = GvrAudioEngine.INVALID_ID;
} | java | public void unload()
{
if (mAudioListener != null)
{
Log.d("SOUND", "unloading audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().unloadSoundFile(getSoundFile());
}
mSoundFile = null;
mSourceId = GvrAudioEngine.INVALID_ID;
} | [
"public",
"void",
"unload",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"Log",
".",
"d",
"(",
"\"SOUND\"",
",",
"\"unloading audio source %d %s\"",
",",
"getSourceId",
"(",
")",
",",
"getSoundFile",
"(",
")",
")",
";",
"mAudioListen... | Unloads the sound file for this source, if any. | [
"Unloads",
"the",
"sound",
"file",
"for",
"this",
"source",
"if",
"any",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L102-L111 | train |
Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.pause | public void pause()
{
if (mAudioListener != null)
{
int sourceId = getSourceId();
if (sourceId != GvrAudioEngine.INVALID_ID)
{
mAudioListener.getAudioEngine().pauseSound(sourceId);
}
}
} | java | public void pause()
{
if (mAudioListener != null)
{
int sourceId = getSourceId();
if (sourceId != GvrAudioEngine.INVALID_ID)
{
mAudioListener.getAudioEngine().pauseSound(sourceId);
}
}
} | [
"public",
"void",
"pause",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"int",
"sourceId",
"=",
"getSourceId",
"(",
")",
";",
"if",
"(",
"sourceId",
"!=",
"GvrAudioEngine",
".",
"INVALID_ID",
")",
"{",
"mAudioListener",
".",
"getAu... | Pauses the playback of a sound. | [
"Pauses",
"the",
"playback",
"of",
"a",
"sound",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L225-L235 | train |
Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.stop | public void stop()
{
if (mAudioListener != null)
{
Log.d("SOUND", "stopping audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().stopSound(getSourceId());
}
} | java | public void stop()
{
if (mAudioListener != null)
{
Log.d("SOUND", "stopping audio source %d %s", getSourceId(), getSoundFile());
mAudioListener.getAudioEngine().stopSound(getSourceId());
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"mAudioListener",
"!=",
"null",
")",
"{",
"Log",
".",
"d",
"(",
"\"SOUND\"",
",",
"\"stopping audio source %d %s\"",
",",
"getSourceId",
"(",
")",
",",
"getSoundFile",
"(",
")",
")",
";",
"mAudioListener"... | Stops the playback of a sound and destroys the corresponding Sound Object or Soundfield. | [
"Stops",
"the",
"playback",
"of",
"a",
"sound",
"and",
"destroys",
"the",
"corresponding",
"Sound",
"Object",
"or",
"Soundfield",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L263-L270 | train |
Samsung/GearVRf | GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java | GVRAudioSource.setVolume | public void setVolume(float volume)
{
// Save this in case this audio source is not being played yet
mVolume = volume;
if (isPlaying() && (getSourceId() != GvrAudioEngine.INVALID_ID))
{
// This will actually work only if the sound file is being played
mAudioListener.getAudioEngine().setSoundVolume(getSourceId(), getVolume());
}
} | java | public void setVolume(float volume)
{
// Save this in case this audio source is not being played yet
mVolume = volume;
if (isPlaying() && (getSourceId() != GvrAudioEngine.INVALID_ID))
{
// This will actually work only if the sound file is being played
mAudioListener.getAudioEngine().setSoundVolume(getSourceId(), getVolume());
}
} | [
"public",
"void",
"setVolume",
"(",
"float",
"volume",
")",
"{",
"// Save this in case this audio source is not being played yet",
"mVolume",
"=",
"volume",
";",
"if",
"(",
"isPlaying",
"(",
")",
"&&",
"(",
"getSourceId",
"(",
")",
"!=",
"GvrAudioEngine",
".",
"IN... | Changes the volume of an existing sound.
@param volume volume value. Should range from 0 (mute) to 1 (max) | [
"Changes",
"the",
"volume",
"of",
"an",
"existing",
"sound",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/ResonanceAudio/resonanceaudio/src/main/java/org/gearvrf/resonanceaudio/GVRAudioSource.java#L276-L285 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.get | public float get(Layout.Axis axis) {
switch (axis) {
case X:
return x;
case Y:
return y;
case Z:
return z;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | java | public float get(Layout.Axis axis) {
switch (axis) {
case X:
return x;
case Y:
return y;
case Z:
return z;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | [
"public",
"float",
"get",
"(",
"Layout",
".",
"Axis",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"return",
"x",
";",
"case",
"Y",
":",
"return",
"y",
";",
"case",
"Z",
":",
"return",
"z",
";",
"default",
":",
"throw",
... | Gets axis dimension
@param axis Axis. It might be either {@link Layout.Axis#X X} or
{@link Layout.Axis#Y Y} or {@link Layout.Axis#Z Z}
@return axis dimension | [
"Gets",
"axis",
"dimension"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L45-L56 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.set | public void set(float val, Layout.Axis axis) {
switch (axis) {
case X:
x = val;
break;
case Y:
y = val;
break;
case Z:
z = val;
break;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | java | public void set(float val, Layout.Axis axis) {
switch (axis) {
case X:
x = val;
break;
case Y:
y = val;
break;
case Z:
z = val;
break;
default:
throw new RuntimeAssertion("Bad axis specified: %s", axis);
}
} | [
"public",
"void",
"set",
"(",
"float",
"val",
",",
"Layout",
".",
"Axis",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"X",
":",
"x",
"=",
"val",
";",
"break",
";",
"case",
"Y",
":",
"y",
"=",
"val",
";",
"break",
";",
"case",
"... | Sets axis dimension
@param val dimension
@param axis Axis. It might be either {@link Layout.Axis#X X} or
{@link Layout.Axis#Y Y} or {@link Layout.Axis#Z Z} | [
"Sets",
"axis",
"dimension"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L64-L78 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java | Vector3Axis.delta | public Vector3Axis delta(Vector3f v) {
Vector3Axis ret = new Vector3Axis(Float.NaN, Float.NaN, Float.NaN);
if (x != Float.NaN && v.x != Float.NaN && !equal(x, v.x)) {
ret.set(x - v.x, Layout.Axis.X);
}
if (y != Float.NaN && v.y != Float.NaN && !equal(y, v.y)) {
ret.set(y - v.y, Layout.Axis.Y);
}
if (z != Float.NaN && v.z != Float.NaN && !equal(z, v.z)) {
ret.set(z - v.z, Layout.Axis.Z);
}
return ret;
} | java | public Vector3Axis delta(Vector3f v) {
Vector3Axis ret = new Vector3Axis(Float.NaN, Float.NaN, Float.NaN);
if (x != Float.NaN && v.x != Float.NaN && !equal(x, v.x)) {
ret.set(x - v.x, Layout.Axis.X);
}
if (y != Float.NaN && v.y != Float.NaN && !equal(y, v.y)) {
ret.set(y - v.y, Layout.Axis.Y);
}
if (z != Float.NaN && v.z != Float.NaN && !equal(z, v.z)) {
ret.set(z - v.z, Layout.Axis.Z);
}
return ret;
} | [
"public",
"Vector3Axis",
"delta",
"(",
"Vector3f",
"v",
")",
"{",
"Vector3Axis",
"ret",
"=",
"new",
"Vector3Axis",
"(",
"Float",
".",
"NaN",
",",
"Float",
".",
"NaN",
",",
"Float",
".",
"NaN",
")",
";",
"if",
"(",
"x",
"!=",
"Float",
".",
"NaN",
"&... | Calculate delta with another vector
@param v another vector
@return delta vector | [
"Calculate",
"delta",
"with",
"another",
"vector"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Vector3Axis.java#L101-L113 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java | PageIndicatorWidget.setPageCount | public int setPageCount(final int num) {
int diff = num - getCheckableCount();
if (diff > 0) {
addIndicatorChildren(diff);
} else if (diff < 0) {
removeIndicatorChildren(-diff);
}
if (mCurrentPage >=num ) {
mCurrentPage = 0;
}
setCurrentPage(mCurrentPage);
return diff;
} | java | public int setPageCount(final int num) {
int diff = num - getCheckableCount();
if (diff > 0) {
addIndicatorChildren(diff);
} else if (diff < 0) {
removeIndicatorChildren(-diff);
}
if (mCurrentPage >=num ) {
mCurrentPage = 0;
}
setCurrentPage(mCurrentPage);
return diff;
} | [
"public",
"int",
"setPageCount",
"(",
"final",
"int",
"num",
")",
"{",
"int",
"diff",
"=",
"num",
"-",
"getCheckableCount",
"(",
")",
";",
"if",
"(",
"diff",
">",
"0",
")",
"{",
"addIndicatorChildren",
"(",
"diff",
")",
";",
"}",
"else",
"if",
"(",
... | Sets number of pages. If the index of currently selected page is bigger than the total number
of pages, first page will be selected instead.
@return difference between the previous number of pages and new one. Negative value is
returned if new number of pages is less then it was before. | [
"Sets",
"number",
"of",
"pages",
".",
"If",
"the",
"index",
"of",
"currently",
"selected",
"page",
"is",
"bigger",
"than",
"the",
"total",
"number",
"of",
"pages",
"first",
"page",
"will",
"be",
"selected",
"instead",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java#L122-L134 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java | PageIndicatorWidget.setCurrentPage | public boolean setCurrentPage(final int page) {
Log.d(TAG, "setPageId pageId = %d", page);
return (page >= 0 && page < getCheckableCount()) && check(page);
} | java | public boolean setCurrentPage(final int page) {
Log.d(TAG, "setPageId pageId = %d", page);
return (page >= 0 && page < getCheckableCount()) && check(page);
} | [
"public",
"boolean",
"setCurrentPage",
"(",
"final",
"int",
"page",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"setPageId pageId = %d\"",
",",
"page",
")",
";",
"return",
"(",
"page",
">=",
"0",
"&&",
"page",
"<",
"getCheckableCount",
"(",
")",
")",
... | Sets selected page implicitly
@param page new selected page
@return true if the page has been selected successfully | [
"Sets",
"selected",
"page",
"implicitly"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/custom/PageIndicatorWidget.java#L149-L152 | train |
Samsung/GearVRf | GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRPhysicsAvatar.java | GVRPhysicsAvatar.loadPhysics | public void loadPhysics(String filename, GVRScene scene) throws IOException
{
GVRPhysicsLoader.loadPhysicsFile(getGVRContext(), filename, true, scene);
} | java | public void loadPhysics(String filename, GVRScene scene) throws IOException
{
GVRPhysicsLoader.loadPhysicsFile(getGVRContext(), filename, true, scene);
} | [
"public",
"void",
"loadPhysics",
"(",
"String",
"filename",
",",
"GVRScene",
"scene",
")",
"throws",
"IOException",
"{",
"GVRPhysicsLoader",
".",
"loadPhysicsFile",
"(",
"getGVRContext",
"(",
")",
",",
"filename",
",",
"true",
",",
"scene",
")",
";",
"}"
] | Load physics information for the current avatar
@param filename name of physics file
@param scene scene the avatar is part of
@throws IOException if physics file cannot be parsed | [
"Load",
"physics",
"information",
"for",
"the",
"current",
"avatar"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-physics/src/main/java/org/gearvrf/physics/GVRPhysicsAvatar.java#L62-L65 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFaceCamera | public void rotateToFaceCamera(final GVRTransform transform) {
//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion
final GVRTransform t = getMainCameraRig().getHeadTransform();
final Quaternionf q = new Quaternionf(0, t.getRotationY(), 0, t.getRotationW()).normalize();
transform.rotateWithPivot(q.w, q.x, q.y, q.z, 0, 0, 0);
} | java | public void rotateToFaceCamera(final GVRTransform transform) {
//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion
final GVRTransform t = getMainCameraRig().getHeadTransform();
final Quaternionf q = new Quaternionf(0, t.getRotationY(), 0, t.getRotationW()).normalize();
transform.rotateWithPivot(q.w, q.x, q.y, q.z, 0, 0, 0);
} | [
"public",
"void",
"rotateToFaceCamera",
"(",
"final",
"GVRTransform",
"transform",
")",
"{",
"//see http://stackoverflow.com/questions/5782658/extracting-yaw-from-a-quaternion",
"final",
"GVRTransform",
"t",
"=",
"getMainCameraRig",
"(",
")",
".",
"getHeadTransform",
"(",
")"... | Apply the necessary rotation to the transform so that it is in front of
the camera.
@param transform The transform to modify. | [
"Apply",
"the",
"necessary",
"rotation",
"to",
"the",
"transform",
"so",
"that",
"it",
"is",
"in",
"front",
"of",
"the",
"camera",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L465-L471 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFaceCamera | public float rotateToFaceCamera(final Widget widget) {
final float yaw = getMainCameraRigYaw();
GVRTransform t = getMainCameraRig().getHeadTransform();
widget.rotateWithPivot(t.getRotationW(), 0, t.getRotationY(), 0, 0, 0, 0);
return yaw;
} | java | public float rotateToFaceCamera(final Widget widget) {
final float yaw = getMainCameraRigYaw();
GVRTransform t = getMainCameraRig().getHeadTransform();
widget.rotateWithPivot(t.getRotationW(), 0, t.getRotationY(), 0, 0, 0, 0);
return yaw;
} | [
"public",
"float",
"rotateToFaceCamera",
"(",
"final",
"Widget",
"widget",
")",
"{",
"final",
"float",
"yaw",
"=",
"getMainCameraRigYaw",
"(",
")",
";",
"GVRTransform",
"t",
"=",
"getMainCameraRig",
"(",
")",
".",
"getHeadTransform",
"(",
")",
";",
"widget",
... | Apply the necessary rotation to the transform so that it is in front of
the camera. The actual rotation is performed not using the yaw angle but
using equivalent quaternion values for better accuracy. But the yaw angle
is still returned for backward compatibility.
@param widget The transform to modify.
@return The camera's yaw in degrees. | [
"Apply",
"the",
"necessary",
"rotation",
"to",
"the",
"transform",
"so",
"that",
"it",
"is",
"in",
"front",
"of",
"the",
"camera",
".",
"The",
"actual",
"rotation",
"is",
"performed",
"not",
"using",
"the",
"yaw",
"angle",
"but",
"using",
"equivalent",
"qu... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L482-L487 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.updateFrontFacingRotation | public void updateFrontFacingRotation(float rotation) {
if (!Float.isNaN(rotation) && !equal(rotation, frontFacingRotation)) {
final float oldRotation = frontFacingRotation;
frontFacingRotation = rotation % 360;
for (OnFrontRotationChangedListener listener : mOnFrontRotationChangedListeners) {
try {
listener.onFrontRotationChanged(this, frontFacingRotation, oldRotation);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, e, "updateFrontFacingRotation()");
}
}
}
} | java | public void updateFrontFacingRotation(float rotation) {
if (!Float.isNaN(rotation) && !equal(rotation, frontFacingRotation)) {
final float oldRotation = frontFacingRotation;
frontFacingRotation = rotation % 360;
for (OnFrontRotationChangedListener listener : mOnFrontRotationChangedListeners) {
try {
listener.onFrontRotationChanged(this, frontFacingRotation, oldRotation);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, e, "updateFrontFacingRotation()");
}
}
}
} | [
"public",
"void",
"updateFrontFacingRotation",
"(",
"float",
"rotation",
")",
"{",
"if",
"(",
"!",
"Float",
".",
"isNaN",
"(",
"rotation",
")",
"&&",
"!",
"equal",
"(",
"rotation",
",",
"frontFacingRotation",
")",
")",
"{",
"final",
"float",
"oldRotation",
... | Set new front facing rotation
@param rotation | [
"Set",
"new",
"front",
"facing",
"rotation"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L503-L516 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.rotateToFront | public void rotateToFront() {
GVRTransform transform = mSceneRootObject.getTransform();
transform.setRotation(1, 0, 0, 0);
transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);
} | java | public void rotateToFront() {
GVRTransform transform = mSceneRootObject.getTransform();
transform.setRotation(1, 0, 0, 0);
transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);
} | [
"public",
"void",
"rotateToFront",
"(",
")",
"{",
"GVRTransform",
"transform",
"=",
"mSceneRootObject",
".",
"getTransform",
"(",
")",
";",
"transform",
".",
"setRotation",
"(",
"1",
",",
"0",
",",
"0",
",",
"0",
")",
";",
"transform",
".",
"rotateByAxisWi... | Rotate root widget to make it facing to the front of the scene | [
"Rotate",
"root",
"widget",
"to",
"make",
"it",
"facing",
"to",
"the",
"front",
"of",
"the",
"scene"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L537-L541 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java | MainScene.setScale | public void setScale(final float scale) {
if (equal(mScale, scale) != true) {
Log.d(TAG, "setScale(): old: %.2f, new: %.2f", mScale, scale);
mScale = scale;
setScale(mSceneRootObject, scale);
setScale(mMainCameraRootObject, scale);
setScale(mLeftCameraRootObject, scale);
setScale(mRightCameraRootObject, scale);
for (OnScaledListener listener : mOnScaledListeners) {
try {
listener.onScaled(scale);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, e, "setScale()");
}
}
}
} | java | public void setScale(final float scale) {
if (equal(mScale, scale) != true) {
Log.d(TAG, "setScale(): old: %.2f, new: %.2f", mScale, scale);
mScale = scale;
setScale(mSceneRootObject, scale);
setScale(mMainCameraRootObject, scale);
setScale(mLeftCameraRootObject, scale);
setScale(mRightCameraRootObject, scale);
for (OnScaledListener listener : mOnScaledListeners) {
try {
listener.onScaled(scale);
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, e, "setScale()");
}
}
}
} | [
"public",
"void",
"setScale",
"(",
"final",
"float",
"scale",
")",
"{",
"if",
"(",
"equal",
"(",
"mScale",
",",
"scale",
")",
"!=",
"true",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"setScale(): old: %.2f, new: %.2f\"",
",",
"mScale",
",",
"scale",
... | Scale all widgets in Main Scene hierarchy
@param scale | [
"Scale",
"all",
"widgets",
"in",
"Main",
"Scene",
"hierarchy"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/main/MainScene.java#L566-L583 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setRepeatMode | public GVRAnimation setRepeatMode(int repeatMode) {
if (GVRRepeatMode.invalidRepeatMode(repeatMode)) {
throw new IllegalArgumentException(repeatMode
+ " is not a valid repetition type");
}
mRepeatMode = repeatMode;
return this;
} | java | public GVRAnimation setRepeatMode(int repeatMode) {
if (GVRRepeatMode.invalidRepeatMode(repeatMode)) {
throw new IllegalArgumentException(repeatMode
+ " is not a valid repetition type");
}
mRepeatMode = repeatMode;
return this;
} | [
"public",
"GVRAnimation",
"setRepeatMode",
"(",
"int",
"repeatMode",
")",
"{",
"if",
"(",
"GVRRepeatMode",
".",
"invalidRepeatMode",
"(",
"repeatMode",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"repeatMode",
"+",
"\" is not a valid repetition typ... | Set the repeat type.
In the default {@linkplain GVRRepeatMode#ONCE run-once} mode, animations
run once, ignoring the {@linkplain #getRepeatCount() repeat count.} In
{@linkplain GVRRepeatMode#PINGPONG ping pong} and
{@linkplain GVRRepeatMode#REPEATED repeated} modes, animations do honor
the repeat count, which {@linkplain #DEFAULT_REPEAT_COUNT defaults} to 2.
@param repeatMode
One of the {@link GVRRepeatMode} constants
@return {@code this}, so you can chain setProperty() calls.
@throws IllegalArgumentException
If {@code repetitionType} is not one of the
{@link GVRRepeatMode} constants | [
"Set",
"the",
"repeat",
"type",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L211-L218 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setOffset | public GVRAnimation setOffset(float startOffset)
{
if(startOffset<0 || startOffset>mDuration){
throw new IllegalArgumentException("offset should not be either negative or greater than duration");
}
animationOffset = startOffset;
mDuration = mDuration-animationOffset;
return this;
} | java | public GVRAnimation setOffset(float startOffset)
{
if(startOffset<0 || startOffset>mDuration){
throw new IllegalArgumentException("offset should not be either negative or greater than duration");
}
animationOffset = startOffset;
mDuration = mDuration-animationOffset;
return this;
} | [
"public",
"GVRAnimation",
"setOffset",
"(",
"float",
"startOffset",
")",
"{",
"if",
"(",
"startOffset",
"<",
"0",
"||",
"startOffset",
">",
"mDuration",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"offset should not be either negative or greater than du... | Sets the offset for the animation.
@param startOffset animation will start at the specified offset value
@return {@code this}, so you can chain setProperty() calls.
@throws IllegalArgumentException
If {@code startOffset} is either negative or greater than
the animation duration | [
"Sets",
"the",
"offset",
"for",
"the",
"animation",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L263-L271 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setDuration | public GVRAnimation setDuration(float start, float end)
{
if(start>end || start<0 || end>mDuration){
throw new IllegalArgumentException("start and end values are wrong");
}
animationOffset = start;
mDuration = end-start;
return this;
} | java | public GVRAnimation setDuration(float start, float end)
{
if(start>end || start<0 || end>mDuration){
throw new IllegalArgumentException("start and end values are wrong");
}
animationOffset = start;
mDuration = end-start;
return this;
} | [
"public",
"GVRAnimation",
"setDuration",
"(",
"float",
"start",
",",
"float",
"end",
")",
"{",
"if",
"(",
"start",
">",
"end",
"||",
"start",
"<",
"0",
"||",
"end",
">",
"mDuration",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"start and e... | Sets the duration for the animation to be played.
@param start the animation will start playing from the specified time
@param end the animation will stop playing at the specified time
@return {@code this}, so you can chain setProperty() calls.
@throws IllegalArgumentException
If {@code start} is either negative value, greater than
{@code end} value or {@code end} is greater than duration | [
"Sets",
"the",
"duration",
"for",
"the",
"animation",
"to",
"be",
"played",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L301-L309 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java | GVRAnimation.setOnFinish | public GVRAnimation setOnFinish(GVROnFinish callback) {
mOnFinish = callback;
// Do the instance-of test at set-time, not at use-time
mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback
: null;
if (mOnRepeat != null) {
mRepeatCount = -1; // loop until iterate() returns false
}
return this;
} | java | public GVRAnimation setOnFinish(GVROnFinish callback) {
mOnFinish = callback;
// Do the instance-of test at set-time, not at use-time
mOnRepeat = callback instanceof GVROnRepeat ? (GVROnRepeat) callback
: null;
if (mOnRepeat != null) {
mRepeatCount = -1; // loop until iterate() returns false
}
return this;
} | [
"public",
"GVRAnimation",
"setOnFinish",
"(",
"GVROnFinish",
"callback",
")",
"{",
"mOnFinish",
"=",
"callback",
";",
"// Do the instance-of test at set-time, not at use-time",
"mOnRepeat",
"=",
"callback",
"instanceof",
"GVROnRepeat",
"?",
"(",
"GVROnRepeat",
")",
"callb... | Set the on-finish callback.
The basic {@link GVROnFinish} callback will notify you when the animation
runs to completion. This is a good time to do things like removing
now-invisible objects from the scene graph.
<p>
The extended {@link GVROnRepeat} callback will be called after every
iteration of an indefinite (repeat count less than 0) animation, giving
you a way to stop the animation when it's not longer appropriate.
@param callback
A {@link GVROnFinish} or {@link GVROnRepeat} implementation.
<p>
<em>Note</em>: Supplying a {@link GVROnRepeat} callback will
{@linkplain #setRepeatCount(int) set the repeat count} to a
negative number. Calling {@link #setRepeatCount(int)} with a
non-negative value after setting a {@link GVROnRepeat}
callback will effectively convert the callback to a
{@link GVROnFinish}.
@return {@code this}, so you can chain setProperty() calls. | [
"Set",
"the",
"on",
"-",
"finish",
"callback",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAnimation.java#L333-L343 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.bindShader | public synchronized void bindShader(GVRScene scene, boolean isMultiview)
{
GVRRenderPass pass = mRenderPassList.get(0);
GVRShaderId shader = pass.getMaterial().getShaderType();
GVRShader template = shader.getTemplate(getGVRContext());
if (template != null)
{
template.bindShader(getGVRContext(), this, scene, isMultiview);
}
for (int i = 1; i < mRenderPassList.size(); ++i)
{
pass = mRenderPassList.get(i);
shader = pass.getMaterial().getShaderType();
template = shader.getTemplate(getGVRContext());
if (template != null)
{
template.bindShader(getGVRContext(), pass, scene, isMultiview);
}
}
} | java | public synchronized void bindShader(GVRScene scene, boolean isMultiview)
{
GVRRenderPass pass = mRenderPassList.get(0);
GVRShaderId shader = pass.getMaterial().getShaderType();
GVRShader template = shader.getTemplate(getGVRContext());
if (template != null)
{
template.bindShader(getGVRContext(), this, scene, isMultiview);
}
for (int i = 1; i < mRenderPassList.size(); ++i)
{
pass = mRenderPassList.get(i);
shader = pass.getMaterial().getShaderType();
template = shader.getTemplate(getGVRContext());
if (template != null)
{
template.bindShader(getGVRContext(), pass, scene, isMultiview);
}
}
} | [
"public",
"synchronized",
"void",
"bindShader",
"(",
"GVRScene",
"scene",
",",
"boolean",
"isMultiview",
")",
"{",
"GVRRenderPass",
"pass",
"=",
"mRenderPassList",
".",
"get",
"(",
"0",
")",
";",
"GVRShaderId",
"shader",
"=",
"pass",
".",
"getMaterial",
"(",
... | Selects a specific vertex and fragment shader to use for rendering.
If a shader template has been specified, it is used to generate
a vertex and fragment shader based on mesh attributes, bound textures
and light sources. If the textures bound to the material are changed
or a new light source is added, this function must be called again
to select the appropriate shaders. This function may cause recompilation
of shaders which is quite slow.
@param scene scene being rendered
@see GVRShaderTemplate GVRMaterialShader.getShaderType | [
"Selects",
"a",
"specific",
"vertex",
"and",
"fragment",
"shader",
"to",
"use",
"for",
"rendering",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L264-L283 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.setCullFace | public GVRRenderData setCullFace(GVRCullFaceEnum cullFace, int passIndex) {
if (passIndex < mRenderPassList.size()) {
mRenderPassList.get(passIndex).setCullFace(cullFace);
} else {
Log.e(TAG, "Trying to set cull face to a invalid pass. Pass " + passIndex + " was not created.");
}
return this;
} | java | public GVRRenderData setCullFace(GVRCullFaceEnum cullFace, int passIndex) {
if (passIndex < mRenderPassList.size()) {
mRenderPassList.get(passIndex).setCullFace(cullFace);
} else {
Log.e(TAG, "Trying to set cull face to a invalid pass. Pass " + passIndex + " was not created.");
}
return this;
} | [
"public",
"GVRRenderData",
"setCullFace",
"(",
"GVRCullFaceEnum",
"cullFace",
",",
"int",
"passIndex",
")",
"{",
"if",
"(",
"passIndex",
"<",
"mRenderPassList",
".",
"size",
"(",
")",
")",
"{",
"mRenderPassList",
".",
"get",
"(",
"passIndex",
")",
".",
"setC... | Set the face to be culled
@param cullFace
{@code GVRCullFaceEnum.Back} Tells Graphics API to discard
back faces, {@code GVRCullFaceEnum.Front} Tells Graphics API
to discard front faces, {@code GVRCullFaceEnum.None} Tells
Graphics API to not discard any face
@param passIndex
The rendering pass to set cull face state | [
"Set",
"the",
"face",
"to",
"be",
"culled"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L494-L501 | train |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java | GVRRenderData.setDrawMode | public GVRRenderData setDrawMode(int drawMode) {
if (drawMode != GL_POINTS && drawMode != GL_LINES
&& drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP
&& drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP
&& drawMode != GL_TRIANGLE_FAN) {
throw new IllegalArgumentException(
"drawMode must be one of GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP.");
}
NativeRenderData.setDrawMode(getNative(), drawMode);
return this;
} | java | public GVRRenderData setDrawMode(int drawMode) {
if (drawMode != GL_POINTS && drawMode != GL_LINES
&& drawMode != GL_LINE_STRIP && drawMode != GL_LINE_LOOP
&& drawMode != GL_TRIANGLES && drawMode != GL_TRIANGLE_STRIP
&& drawMode != GL_TRIANGLE_FAN) {
throw new IllegalArgumentException(
"drawMode must be one of GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP.");
}
NativeRenderData.setDrawMode(getNative(), drawMode);
return this;
} | [
"public",
"GVRRenderData",
"setDrawMode",
"(",
"int",
"drawMode",
")",
"{",
"if",
"(",
"drawMode",
"!=",
"GL_POINTS",
"&&",
"drawMode",
"!=",
"GL_LINES",
"&&",
"drawMode",
"!=",
"GL_LINE_STRIP",
"&&",
"drawMode",
"!=",
"GL_LINE_LOOP",
"&&",
"drawMode",
"!=",
"... | Set the draw mode for this mesh. Default is GL_TRIANGLES.
@param drawMode | [
"Set",
"the",
"draw",
"mode",
"for",
"this",
"mesh",
".",
"Default",
"is",
"GL_TRIANGLES",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRRenderData.java#L749-L759 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.fling | public boolean fling(float velocityX, float velocityY, float velocityZ) {
boolean scrolled = true;
float viewportX = mScrollable.getViewPortWidth();
if (Float.isNaN(viewportX)) {
viewportX = 0;
}
float maxX = Math.min(MAX_SCROLLING_DISTANCE,
viewportX * MAX_VIEWPORT_LENGTHS);
float viewportY = mScrollable.getViewPortHeight();
if (Float.isNaN(viewportY)) {
viewportY = 0;
}
float maxY = Math.min(MAX_SCROLLING_DISTANCE,
viewportY * MAX_VIEWPORT_LENGTHS);
float xOffset = (maxX * velocityX)/VELOCITY_MAX;
float yOffset = (maxY * velocityY)/VELOCITY_MAX;
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "fling() velocity = [%f, %f, %f] offset = [%f, %f]",
velocityX, velocityY, velocityZ,
xOffset, yOffset);
if (equal(xOffset, 0)) {
xOffset = Float.NaN;
}
if (equal(yOffset, 0)) {
yOffset = Float.NaN;
}
// TODO: Think about Z-scrolling
mScrollable.scrollByOffset(xOffset, yOffset, Float.NaN, mInternalScrollListener);
return scrolled;
} | java | public boolean fling(float velocityX, float velocityY, float velocityZ) {
boolean scrolled = true;
float viewportX = mScrollable.getViewPortWidth();
if (Float.isNaN(viewportX)) {
viewportX = 0;
}
float maxX = Math.min(MAX_SCROLLING_DISTANCE,
viewportX * MAX_VIEWPORT_LENGTHS);
float viewportY = mScrollable.getViewPortHeight();
if (Float.isNaN(viewportY)) {
viewportY = 0;
}
float maxY = Math.min(MAX_SCROLLING_DISTANCE,
viewportY * MAX_VIEWPORT_LENGTHS);
float xOffset = (maxX * velocityX)/VELOCITY_MAX;
float yOffset = (maxY * velocityY)/VELOCITY_MAX;
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "fling() velocity = [%f, %f, %f] offset = [%f, %f]",
velocityX, velocityY, velocityZ,
xOffset, yOffset);
if (equal(xOffset, 0)) {
xOffset = Float.NaN;
}
if (equal(yOffset, 0)) {
yOffset = Float.NaN;
}
// TODO: Think about Z-scrolling
mScrollable.scrollByOffset(xOffset, yOffset, Float.NaN, mInternalScrollListener);
return scrolled;
} | [
"public",
"boolean",
"fling",
"(",
"float",
"velocityX",
",",
"float",
"velocityY",
",",
"float",
"velocityZ",
")",
"{",
"boolean",
"scrolled",
"=",
"true",
";",
"float",
"viewportX",
"=",
"mScrollable",
".",
"getViewPortWidth",
"(",
")",
";",
"if",
"(",
"... | Fling the content
@param velocityX The initial velocity in the X direction. Positive numbers mean that the
finger/cursor is moving to the left on the screen, which means we want to
scroll towards the beginning.
@param velocityY The initial velocity in the Y direction. Positive numbers mean that the
finger/cursor is moving down the screen, which means we want to scroll
towards the top.
@param velocityZ TODO: Z-scrolling is currently not supported
@return | [
"Fling",
"the",
"content"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L207-L242 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToNextPage | public int scrollToNextPage() {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToNextPage getCurrentPage() = %d currentIndex = %d",
getCurrentPage(), mCurrentItemIndex);
if (mSupportScrollByPage) {
scrollToPage(getCurrentPage() + 1);
} else {
Log.w(TAG, "Pagination is not enabled!");
}
return mCurrentItemIndex;
} | java | public int scrollToNextPage() {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToNextPage getCurrentPage() = %d currentIndex = %d",
getCurrentPage(), mCurrentItemIndex);
if (mSupportScrollByPage) {
scrollToPage(getCurrentPage() + 1);
} else {
Log.w(TAG, "Pagination is not enabled!");
}
return mCurrentItemIndex;
} | [
"public",
"int",
"scrollToNextPage",
"(",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToNextPage getCurrentPage() = %d currentIndex = %d\"",
",",
"getCurrentPage",
"(",
")",
",",
"mCurrentItemIndex",
")",
";",
... | Scroll to the next page. To process the scrolling by pages LayoutScroller must be constructed
with a pageSize greater than zero.
@return the new current item after the scrolling processed. | [
"Scroll",
"to",
"the",
"next",
"page",
".",
"To",
"process",
"the",
"scrolling",
"by",
"pages",
"LayoutScroller",
"must",
"be",
"constructed",
"with",
"a",
"pageSize",
"greater",
"than",
"zero",
"."
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L249-L260 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToPage | public int scrollToPage(int pageNumber) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToPage pageNumber = %d mPageCount = %d",
pageNumber, mPageCount);
if (mSupportScrollByPage &&
(mScrollOver || (pageNumber >= 0 && pageNumber <= mPageCount - 1))) {
scrollToItem(getFirstItemIndexOnPage(pageNumber));
} else {
Log.w(TAG, "Pagination is not enabled!");
}
return mCurrentItemIndex;
} | java | public int scrollToPage(int pageNumber) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToPage pageNumber = %d mPageCount = %d",
pageNumber, mPageCount);
if (mSupportScrollByPage &&
(mScrollOver || (pageNumber >= 0 && pageNumber <= mPageCount - 1))) {
scrollToItem(getFirstItemIndexOnPage(pageNumber));
} else {
Log.w(TAG, "Pagination is not enabled!");
}
return mCurrentItemIndex;
} | [
"public",
"int",
"scrollToPage",
"(",
"int",
"pageNumber",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToPage pageNumber = %d mPageCount = %d\"",
",",
"pageNumber",
",",
"mPageCount",
")",
";",
"if",
"(",
... | Scroll to specific page. The final page might be different from the requested one if the
requested page is larger than the last page. To process the scrolling by pages
LayoutScroller must be constructed with a pageSize greater than zero.
@param pageNumber page to scroll to
@return the new current item after the scrolling processed. | [
"Scroll",
"to",
"specific",
"page",
".",
"The",
"final",
"page",
"might",
"be",
"different",
"from",
"the",
"requested",
"one",
"if",
"the",
"requested",
"page",
"is",
"larger",
"than",
"the",
"last",
"page",
".",
"To",
"process",
"the",
"scrolling",
"by",... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L286-L297 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.scrollToItem | public int scrollToItem(int position) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToItem position = %d", position);
scrollToPosition(position);
return mCurrentItemIndex;
} | java | public int scrollToItem(int position) {
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollToItem position = %d", position);
scrollToPosition(position);
return mCurrentItemIndex;
} | [
"public",
"int",
"scrollToItem",
"(",
"int",
"position",
")",
"{",
"Log",
".",
"d",
"(",
"Log",
".",
"SUBSYSTEM",
".",
"LAYOUT",
",",
"TAG",
",",
"\"scrollToItem position = %d\"",
",",
"position",
")",
";",
"scrollToPosition",
"(",
"position",
")",
";",
"r... | Scroll to the specific position
@param position
@return the new current item after the scrolling processed. | [
"Scroll",
"to",
"the",
"specific",
"position"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L336-L340 | train |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java | LayoutScroller.getCurrentPage | public int getCurrentPage() {
int currentPage = 1;
int count = mScrollable.getScrollingItemsCount();
if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
mCurrentItemIndex < count) {
currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
}
return currentPage;
} | java | public int getCurrentPage() {
int currentPage = 1;
int count = mScrollable.getScrollingItemsCount();
if (mSupportScrollByPage && mCurrentItemIndex >= 0 &&
mCurrentItemIndex < count) {
currentPage = (Math.min(mCurrentItemIndex + mPageSize - 1, count - 1)/mPageSize);
}
return currentPage;
} | [
"public",
"int",
"getCurrentPage",
"(",
")",
"{",
"int",
"currentPage",
"=",
"1",
";",
"int",
"count",
"=",
"mScrollable",
".",
"getScrollingItemsCount",
"(",
")",
";",
"if",
"(",
"mSupportScrollByPage",
"&&",
"mCurrentItemIndex",
">=",
"0",
"&&",
"mCurrentIte... | Gets the current page
@return | [
"Gets",
"the",
"current",
"page"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/layout/LayoutScroller.java#L346-L354 | train |
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",
... | 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 | train |
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",
"(... | 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 | train |
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",
"(",
")",
")",
".",
"asFloatBuffe... | 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 | train |
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",
".",
"get... | 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 | train |
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"... | 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 | train |
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 | train |
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 | train |
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 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 | train |
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",
... | 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 | train |
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"... | 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 | train |
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",
".",
"setChecke... | 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 | train |
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",
... | 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 | train |
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",
">",
"ch... | 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",
"d... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/compound/CheckableGroup.java#L255-L271 | train |
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",
... | 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 | train |
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",
",",
"\"Cam... | 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 | train |
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",
"=",
"cent... | 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... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRShadowMap.java#L90-L105 | train |
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",
"(",
")",
")",
";",
... | 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 | train |
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",
"(",
")",
")",
";",
"fo... | 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 | train |
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",
"GVRScene... | 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 | train |
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",
"=",... | 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 | train |
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",
".",
"getN... | 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 | train |
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",
"=",
"mComponen... | 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 | train |
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",
... | 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 | train |
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",
"(",
")... | 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 | train |
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",
... | 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 | train |
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",
"... | 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 | train |
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 | train |
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 | train |
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",
"(",
")... | 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 | train |
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",
"=",
"control... | 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 | train |
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",
"(... | 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 | train |
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",
")",
";"... | 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 | train |
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 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 | train |
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",
"=",
... | 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",
... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/io/GVRCursorController.java#L1120-L1125 | train |
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",
... | 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 | train |
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 | train |
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",
">",
... | 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 | train |
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",
... | 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 | train |
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",
".",... | 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 | train |
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",
")",
"{... | 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 | train |
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 | train |
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",
"(",... | 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 | train |
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",
"... | 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"... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRCubemapImage.java#L76-L86 | train |
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",
")",
"sceneObje... | 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 | train |
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",
"(",
"mRig... | 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 | train |
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 | train |
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",
"(",
"GVRSceneObj... | 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",
"ref... | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSwitch.java#L94-L111 | train |
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",... | 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 | train |
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",
")",
"&&",
"... | 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 | train |
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",
"Me... | 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 | train |
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 lo... | 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 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.