Skip to content

Commit

Permalink
Fixing issue Samsung#1722, GVRCubeSceneObject with texture array thro…
Browse files Browse the repository at this point in the history
…w invocation exception
  • Loading branch information
liaxim committed Feb 1, 2018
1 parent 9fd0ae3 commit 77df2cc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public GVRCubeSceneObject(GVRContext gvrContext, boolean facingOut,
"The length of textureList is not 6.");
}

createSimpleCubeSixMeshes(gvrContext, facingOut, "float a_position float a_texcoord float a_normal", textureList);
createSimpleCubeSixMeshes(gvrContext, facingOut, "float3 a_position float2 a_texcoord float3 a_normal", textureList);
}

/**
Expand Down Expand Up @@ -555,12 +555,12 @@ private void createSimpleCubeSixMeshes(GVRContext gvrContext,
{
GVRSceneObject[] children = new GVRSceneObject[6];
GVRMesh[] meshes = new GVRMesh[6];
GVRVertexBuffer vbuf = new GVRVertexBuffer(gvrContext, vertexDesc, SIMPLE_VERTICES.length);
GVRVertexBuffer vbuf = new GVRVertexBuffer(gvrContext, vertexDesc, SIMPLE_VERTICES.length / 3);

if (facingOut)
{
vbuf.setFloatArray("a_normal", SIMPLE_OUTWARD_NORMALS);
vbuf.setFloatArray("a_texcoord", SIMPLE_OUTWARD_TEXCOORDS);
vbuf.setFloatArray("a_normal", SIMPLE_OUTWARD_NORMALS, 3, 0);
vbuf.setFloatArray("a_texcoord", SIMPLE_OUTWARD_TEXCOORDS, 2, 0);
meshes[0] = createMesh(vbuf, 0, SIMPLE_OUTWARD_FRONT_INDICES);
meshes[1] = createMesh(vbuf, 6, SIMPLE_OUTWARD_RIGHT_INDICES);
meshes[2] = createMesh(vbuf, 12, SIMPLE_OUTWARD_BACK_INDICES);
Expand Down

0 comments on commit 77df2cc

Please sign in to comment.