Browse Source

Object3D remove() can take arbitrary arguments.

Now is possible to do:

    obj.remove( obj2, obj3 );

From discussion in #4958, see also #4977.
Manuel Quiñones 11 years ago
parent
commit
da9594e2df
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/core/Object3D.js

+ 10 - 0
src/core/Object3D.js

@@ -353,6 +353,16 @@ THREE.Object3D.prototype = {
 
 
 	remove: function ( object ) {
 	remove: function ( object ) {
 
 
+		if ( arguments.length > 1 ) {
+
+			for ( var i = 0; i < arguments.length; i++ ) {
+
+				this.remove( arguments[ i ] );
+
+			}
+
+		};
+
 		var index = this.children.indexOf( object );
 		var index = this.children.indexOf( object );
 
 
 		if ( index !== - 1 ) {
 		if ( index !== - 1 ) {