Преглед на файлове

This should avoid people adding stuff that it's not an Object3D to the Scene Graph.
Also, checking if the object is already a children is a bit redudant (the next lines code takes care of that indirectly).

Mr.doob преди 13 години
родител
ревизия
22a7f46460
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/core/Object3D.js

+ 1 - 1
src/core/Object3D.js

@@ -114,7 +114,7 @@ THREE.Object3D.prototype = {
 
 		}
 
-		if ( this.children.indexOf( object ) === - 1 ) {
+		if ( object instanceof THREE.Object3D ) { // && this.children.indexOf( object ) === - 1
 
 			if ( object.parent !== undefined ) {