2
0
Mr.doob 12 жил өмнө
parent
commit
79dfcfe14d
2 өөрчлөгдсөн 2 нэмэгдсэн , 4 устгасан
  1. 1 3
      build/three.js
  2. 1 1
      build/three.min.js

+ 1 - 3
build/three.js

@@ -6015,11 +6015,9 @@ THREE.Projector = function() {
 
 	this.pickingRay = function ( vector, camera ) {
 
-		var end, ray, t;
-
 		// set two vectors with opposing z values
 		vector.z = -1.0;
-		end = new THREE.Vector3( vector.x, vector.y, 1.0 );
+		var end = new THREE.Vector3( vector.x, vector.y, 1.0 );
 
 		this.unprojectVector( vector, camera );
 		this.unprojectVector( end, camera );

+ 1 - 1
build/three.min.js

@@ -122,7 +122,7 @@ this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix),this.matrixWorldN
 a.matrixWorld.copy(this.matrixWorld);a.matrixRotationWorld.copy(this.matrixRotationWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);a.useQuaternion=this.useQuaternion;a.boundRadius=this.boundRadius;a.boundRadiusScale=this.boundRadiusScale;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;for(var b=0;b<this.children.length;b++)a.add(this.children[b].clone());
 return a}};THREE.Object3D.__m1=new THREE.Matrix4;THREE.Object3D.defaultEulerOrder="XYZ";THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(f===h){var a=new THREE.RenderableObject;g.push(a);h++;f++;return a}return g[f++]}function b(){if(j===p){var a=new THREE.RenderableVertex;n.push(a);p++;j++;return a}return n[j++]}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<
 c)return!1;a.lerpSelf(b,c);b.lerpSelf(a,1-d);return!0}var e,f,g=[],h=0,i,j,n=[],p=0,m,q,s=[],l=0,t,u=[],E=0,z,r,F=[],B=0,x,v,I=[],C=0,H={objects:[],sprites:[],lights:[],elements:[]},M=new THREE.Vector3,A=new THREE.Vector4,J=new THREE.Matrix4,D=new THREE.Matrix4,L=new THREE.Matrix3,K=new THREE.Frustum,T=new THREE.Vector4,Q=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);J.multiply(b.projectionMatrix,b.matrixWorldInverse);J.multiplyVector3(a);return a};
-this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);J.multiply(b.matrixWorld,b.projectionMatrixInverse);J.multiplyVector3(a);return a};this.pickingRay=function(a,b){var c;a.z=-1;c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Raycaster(a,c)};this.projectScene=function(g,h,p,na){var ka=h.near,Ma=h.far,P=!1,R,ba,ca,N,ja,Y,fa,Ea,Va,ta,Oa,da,Ha,Cb,tb;v=r=t=q=0;H.elements.length=0;g.updateMatrixWorld();
+this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);J.multiply(b.matrixWorld,b.projectionMatrixInverse);J.multiplyVector3(a);return a};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.subSelf(a).normalize();return new THREE.Raycaster(a,c)};this.projectScene=function(g,h,p,na){var ka=h.near,Ma=h.far,P=!1,R,ba,ca,N,ja,Y,fa,Ea,Va,ta,Oa,da,Ha,Cb,tb;v=r=t=q=0;H.elements.length=0;g.updateMatrixWorld();
 void 0===h.parent&&h.updateMatrixWorld();h.matrixWorldInverse.getInverse(h.matrixWorld);J.multiply(h.projectionMatrix,h.matrixWorldInverse);K.setFromMatrix(J);f=0;H.objects.length=0;H.sprites.length=0;H.lights.length=0;var pb=function(b){for(var c=0,d=b.children.length;c<d;c++){var f=b.children[c];if(!1!==f.visible){if(f instanceof THREE.Light)H.lights.push(f);else if(f instanceof THREE.Mesh||f instanceof THREE.Line){if(!1===f.frustumCulled||!0===K.contains(f))e=a(),e.object=f,null!==f.renderDepth?
 e.z=f.renderDepth:(M.copy(f.matrixWorld.getPosition()),J.multiplyVector3(M),e.z=M.z),H.objects.push(e)}else f instanceof THREE.Sprite||f instanceof THREE.Particle?(e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(M.copy(f.matrixWorld.getPosition()),J.multiplyVector3(M),e.z=M.z),H.sprites.push(e)):(e=a(),e.object=f,null!==f.renderDepth?e.z=f.renderDepth:(M.copy(f.matrixWorld.getPosition()),J.multiplyVector3(M),e.z=M.z),H.objects.push(e));pb(f)}}};pb(g);!0===p&&H.objects.sort(c);g=0;for(p=H.objects.length;g<
 p;g++)if(Ea=H.objects[g].object,Va=Ea.matrixWorld,j=0,Ea instanceof THREE.Mesh){ta=Ea.geometry;ca=ta.vertices;Oa=ta.faces;ta=ta.faceVertexUvs;L.getInverse(Va);L.transpose();Ha=Ea.material instanceof THREE.MeshFaceMaterial;Cb=!0===Ha?Ea.material:null;R=0;for(ba=ca.length;R<ba;R++)i=b(),i.positionWorld.copy(ca[R]),Va.multiplyVector3(i.positionWorld),i.positionScreen.copy(i.positionWorld),J.multiplyVector4(i.positionScreen),i.positionScreen.x/=i.positionScreen.w,i.positionScreen.y/=i.positionScreen.w,