Skip to content

Commit

Permalink
fixed transform duplication issue (google#2390)
Browse files Browse the repository at this point in the history
* fixed transform duplication issue

* fix test
  • Loading branch information
elalish authored May 18, 2021
1 parent dad17a2 commit 1f51d86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ suite('ModelViewerGLTFInstance', () => {

suite('preparing the GLTF', () => {
test('duplicates a transparent, double-sided mesh', () => {
const meshThree = preparedGLTF.scene.children[2] as Mesh;
expect(meshThree.children[0]).to.be.ok;
expect((meshThree.children[0] as Mesh).isMesh).to.be.ok;
expect(preparedGLTF.scene.children.length).to.be.eq(4);
expect((preparedGLTF.scene.children[3] as Mesh).isMesh).to.be.ok;
});

test('sets meshes to cast shadows', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ModelViewerGLTFInstance extends GLTFInstance {
const meshBack = mesh.clone() as Mesh;
meshBack.material = duplicateMaterial;
meshBack.renderOrder = -1;
mesh.add(meshBack);
mesh.parent!.add(meshBack);
}

return prepared;
Expand Down

0 comments on commit 1f51d86

Please sign in to comment.