Преглед изворни кода

Making Object3D.remove() also remove virtual lights when removing cascade light

MiiBond пре 12 година
родитељ
комит
3766a77c5f
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      src/scenes/Scene.js

+ 6 - 0
src/scenes/Scene.js

@@ -79,6 +79,12 @@ THREE.Scene.prototype.__removeObject = function ( object ) {
 
 		}
 
+		if ( object.shadowCascadeArray ) {
+			for ( var x = 0; x < object.shadowCascadeArray.length; x++ ) {
+				this.__removeObject( object.shadowCascadeArray[ x ] );
+			}
+		}
+
 	} else if ( !( object instanceof THREE.Camera ) ) {
 
 		var i = this.__objects.indexOf( object );