|
@@ -139,7 +139,7 @@ THREE.LOD.prototype.update=function(a,c,b){this.matrixAutoUpdate&&(c|=this.updat
|
|
|
!1;this.LODs[d].object3D.visible=!0}else break;for(;d<this.LODs.length;d++)this.LODs[d].object3D.visible=!1}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,c,b)};THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.fog=null;this.objects=[];this.lights=[];this.sounds=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;
|
|
|
THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)};THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else if(!(a instanceof THREE.Camera||a instanceof THREE.Bone)&&this.objects.indexOf(a)===-1){this.objects.push(a);this.__objectsAdded.push(a)}for(var c=0;c<a.children.length;c++)this.addChildRecurse(a.children[c])};
|
|
|
THREE.Scene.prototype.removeChild=function(a){this.supr.removeChild.call(this,a);this.removeChildRecurse(a)};THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light){var c=this.lights.indexOf(a);c!==-1&&this.lights.splice(c,1)}else if(a instanceof THREE.Sound){c=this.sounds.indexOf(a);c!==-1&&this.sounds.splice(c,1)}else if(!(a instanceof THREE.Camera)){c=this.objects.indexOf(a);if(c!==-1){this.objects.splice(c,1);this.__objectsRemoved.push(a)}}for(c=0;c<a.children.length;c++)this.removeChildRecurse(a.children[c])};
|
|
|
-THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,c,b){this.color=new THREE.Color(a);this.near=c||1;this.far=b||1E3};THREE.FogExp2=function(a,c){this.color=new THREE.Color(a);this.density=c||2.5E-4};
|
|
|
+THREE.Scene.prototype.addObject=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeObject=THREE.Scene.prototype.removeChild;THREE.Scene.prototype.addLight=THREE.Scene.prototype.addChild;THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,c,b){this.color=new THREE.Color(a);this.near=c||1;this.far=b||1E3};THREE.FogExp2=function(a,c){this.color=new THREE.Color(a);this.density=c!==undefined?c:2.5E-4};
|
|
|
THREE.Projector=function(){function a(M,f){return f.z-M.z}function c(M,f){var V=0,T=1,da=M.z+M.w,fa=f.z+f.w,I=-M.z+M.w,ca=-f.z+f.w;if(da>=0&&fa>=0&&I>=0&&ca>=0)return!0;else if(da<0&&fa<0||I<0&&ca<0)return!1;else{if(da<0)V=Math.max(V,da/(da-fa));else fa<0&&(T=Math.min(T,da/(da-fa)));if(I<0)V=Math.max(V,I/(I-ca));else ca<0&&(T=Math.min(T,I/(I-ca)));if(T<V)return!1;else{M.lerpSelf(f,V);f.lerpSelf(M,1-T);return!0}}}var b,d,e=[],g,h,j,k=[],n,q,x=[],u,t,y=[],A=new THREE.Vector4,E=new THREE.Vector4,v=new THREE.Matrix4,
|
|
|
F=new THREE.Matrix4,w=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],N=new THREE.Vector4,L=new THREE.Vector4,Z;this.projectObjects=function(M,f,V){f=[];var T,da,fa;d=0;da=M.objects;M=0;for(T=da.length;M<T;M++){fa=da[M];var I;if(!(I=!fa.visible))if(I=fa instanceof THREE.Mesh){a:{I=void 0;for(var ca=fa.matrixWorld,xa=-fa.geometry.boundingSphere.radius*Math.max(fa.scale.x,Math.max(fa.scale.y,fa.scale.z)),ea=0;ea<6;ea++){I=w[ea].x*ca.n14+
|
|
|
w[ea].y*ca.n24+w[ea].z*ca.n34+w[ea].w;if(I<=xa){I=!1;break a}}I=!0}I=!I}if(!I){b=e[d]=e[d]||new THREE.RenderableObject;A.copy(fa.position);v.multiplyVector3(A);b.object=fa;b.z=A.z;f.push(b);d++}}V&&f.sort(a);return f};this.projectScene=function(M,f,V){var T=[],da=f.near,fa=f.far,I,ca,xa,ea,va,ia,ga,ta,ya,ha,aa,ma,na,R,ja,qa;j=q=t=0;f.matrixAutoUpdate&&f.update();v.multiply(f.projectionMatrix,f.matrixWorldInverse);w[0].set(v.n41-v.n11,v.n42-v.n12,v.n43-v.n13,v.n44-v.n14);w[1].set(v.n41+v.n11,v.n42+
|