Skip to content

Commit 3a19f7d

Browse files
committed
Raycaster: Simplify code.
1 parent 31eede4 commit 3a19f7d

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/core/Raycaster.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ Object.assign( Raycaster.prototype, {
9292

9393
},
9494

95-
intersectObject: function ( object, recursive, optionalTarget ) {
96-
97-
const intersects = optionalTarget || [];
95+
intersectObject: function ( object, recursive = false, intersects = [] ) {
9896

9997
intersectObject( object, this, intersects, recursive );
10098

@@ -104,16 +102,7 @@ Object.assign( Raycaster.prototype, {
104102

105103
},
106104

107-
intersectObjects: function ( objects, recursive, optionalTarget ) {
108-
109-
const intersects = optionalTarget || [];
110-
111-
if ( Array.isArray( objects ) === false ) {
112-
113-
console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' );
114-
return intersects;
115-
116-
}
105+
intersectObjects: function ( objects, recursive = false, intersects = [] ) {
117106

118107
for ( let i = 0, l = objects.length; i < l; i ++ ) {
119108

0 commit comments

Comments
 (0)