Skip to content

Commit

Permalink
Merge pull request #18775 from Mugen87/dev39
Browse files Browse the repository at this point in the history
Examples: Clean up.
  • Loading branch information
mrdoob authored Feb 28, 2020
2 parents 7715d96 + 77f04ba commit d4d21a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/webgl_decals.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
normal: new THREE.Vector3()
};
var mouse = new THREE.Vector2();
var intersects = [];

var textureLoader = new THREE.TextureLoader();
var decalDiffuse = textureLoader.load( 'textures/decal/decal-diffuse.png' );
Expand Down Expand Up @@ -174,8 +175,7 @@
if ( ! mesh ) return;

raycaster.setFromCamera( mouse, camera );

var intersects = raycaster.intersectObjects( [ mesh ] );
raycaster.intersectObject( mesh, false, intersects );

if ( intersects.length > 0 ) {

Expand All @@ -198,6 +198,8 @@

intersection.intersects = true;

intersects.length = 0;

} else {

intersection.intersects = false;
Expand Down

0 comments on commit d4d21a2

Please sign in to comment.