diff --git a/build/three.js b/build/three.js index f3e382ca42679b45e31b2582bcecaf9da8f88fe4..685a8f30927c6ceeacce2877bdcf7e83824f1b64 100644 --- a/build/three.js +++ b/build/three.js @@ -15134,11 +15134,21 @@ 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 ); - if( i !== -1 ) { + if ( i !== -1 ) { this.__objects.splice( i, 1 ); this.__objectsRemoved.push( object ); @@ -34572,6 +34582,14 @@ THREE.DirectionalLightHelper = function ( light, size ) { THREE.DirectionalLightHelper.prototype = Object.create( THREE.Object3D.prototype ); +THREE.DirectionalLightHelper.prototype.dispose = function () { + + this.lightPlane.geometry.dispose(); + this.lightPlane.material.dispose(); + this.targetLine.geometry.dispose(); + this.targetLine.material.dispose(); +}; + THREE.DirectionalLightHelper.prototype.update = function () { var vector = new THREE.Vector3(); @@ -34746,6 +34764,11 @@ THREE.HemisphereLightHelper = function ( light, sphereSize, arrowLength, domeSiz THREE.HemisphereLightHelper.prototype = Object.create( THREE.Object3D.prototype ); +THREE.HemisphereLightHelper.prototype.dispose = function () { + this.lightSphere.geometry.dispose(); + this.lightSphere.material.dispose(); +}; + THREE.HemisphereLightHelper.prototype.update = function () { var vector = new THREE.Vector3(); @@ -34808,6 +34831,12 @@ THREE.PointLightHelper = function ( light, sphereSize ) { THREE.PointLightHelper.prototype = Object.create( THREE.Mesh.prototype ); +THREE.PointLightHelper.prototype.dispose = function () { + + this.geometry.dispose(); + this.material.dispose(); +}; + THREE.PointLightHelper.prototype.update = function () { this.material.color.copy( this.light.color ).multiplyScalar( this.light.intensity ); @@ -34862,6 +34891,11 @@ THREE.SpotLightHelper = function ( light ) { THREE.SpotLightHelper.prototype = Object.create( THREE.Object3D.prototype ); +THREE.SpotLightHelper.prototype.dispose = function () { + this.cone.geometry.dispose(); + this.cone.material.dispose(); +}; + THREE.SpotLightHelper.prototype.update = function () { var vector = new THREE.Vector3(); diff --git a/build/three.min.js b/build/three.min.js index 81fe136425c6ecc82c79b23182127931786ccdc8..09bfbfcc4abadedb33d938b2110e5d13c8d239a4 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -295,7 +295,7 @@ THREE.MorphAnimMesh.prototype.clone=function(a){void 0===a&&(a=new THREE.MorphAn THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){if(1=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;d=g||(g*=f.intensity,c.add(Pa.multiplyScalar(g)))}else f instanceof THREE.PointLight&&(h=wa.getPositionFromMatrix(f.matrixWorld),g=b.dot(wa.subVectors(h,a).normalize()),0>=g||(g*=0==f.distance?1:1-Math.min(a.distanceTo(h)/f.distance,1),0!=g&&(g*=f.intensity,c.add(Pa.multiplyScalar(g)))))}} function c(a,b,c,d){m(b);l(c);n(d);s(a.getStyle());B.stroke();ta.expandByScalar(2*b)}function d(a){t(a.getStyle());B.fill()}function e(a,b,c,e,f,h,g,j,i,k,m,l,n){if(!(n instanceof THREE.DataTexture||void 0===n.image||0==n.image.width)){if(!0===n.needsUpdate){var p=n.wrapS==THREE.RepeatWrapping,r=n.wrapT==THREE.RepeatWrapping;Ja[n.id]=B.createPattern(n.image,!0===p&&!0===r?"repeat":!0===p&&!1===r?"repeat-x":!1===p&&!0===r?"repeat-y":"no-repeat");n.needsUpdate=!1}void 0===Ja[n.id]?t("rgba(0,0,0,1)"): t(Ja[n.id]);var p=n.offset.x/n.repeat.x,r=n.offset.y/n.repeat.y,s=n.image.width*n.repeat.x,q=n.image.height*n.repeat.y,g=(g+p)*s,j=(1-j+r)*q,c=c-a,e=e-b,f=f-a,h=h-b,i=(i+p)*s-g,k=(1-k+r)*q-j,m=(m+p)*s-g,l=(1-l+r)*q-j,p=i*l-m*k;0===p?(void 0===ga[n.id]&&(b=document.createElement("canvas"),b.width=n.image.width,b.height=n.image.height,b=b.getContext("2d"),b.drawImage(n.image,0,0),ga[n.id]=b.getImageData(0,0,n.image.width,n.image.height).data),b=ga[n.id],g=4*(Math.floor(g)+Math.floor(j)*n.image.width), @@ -651,13 +651,15 @@ b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",167 THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype); THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,h,g,i){a.set(h,g,i);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d){h=0;for(g=d.length;hd;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere); -this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.getPositionFromMatrix(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}();THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrixWorld=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-0.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype); -THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.getPositionFromMatrix(this.light.matrixWorld);b.getPositionFromMatrix(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||16711680,d=d||1,c=new THREE.Geometry,a=a.geometry.faces,e=0,f=a.length;e