|
@@ -25,7 +25,7 @@ g-f*h*e,this.w=c*d*e+f*h*g):"ZXY"===b?(this.x=f*d*e-c*h*g,this.y=c*h*e+f*d*g,thi
|
|
|
return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0],a=b[4],d=b[8],e=b[1],f=b[5],h=b[9],g=b[2],i=b[6],b=b[10],j=c+f+b;0<j?(c=0.5/Math.sqrt(j+1),this.w=0.25/c,this.x=(i-h)*c,this.y=(d-g)*c,this.z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this.w=(i-h)/c,this.x=0.25*c,this.y=(a+e)/c,this.z=(d+g)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this.w=(d-g)/c,this.x=(a+e)/c,this.y=0.25*c,this.z=(h+i)/c):(c=2*Math.sqrt(1+b-c-f),this.w=(e-a)/c,this.x=(d+g)/c,this.y=(h+i)/c,this.z=0.25*c);return this},inverse:function(){this.conjugate().normalize();
|
|
|
return this},conjugate:function(){this.x*=-1;this.y*=-1;this.z*=-1;return this},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=this.length();0===a?(this.z=this.y=this.x=0,this.w=1):(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a);return this},multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Quaternion's .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
|
|
|
this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a.x,d=a.y,e=a.z,f=a.w,h=b.x,g=b.y,i=b.z,j=b.w;this.x=c*j+f*h+d*i-e*g;this.y=d*j+f*g+e*h-c*i;this.z=e*j+f*i+c*g-d*h;this.w=f*j-c*h-d*g-e*i;return this},multiplyVector3:function(a){console.warn("DEPRECATED: Quaternion's .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return a.applyQuaternion(this)},slerp:function(a,b){var c=this.x,d=this.y,e=this.z,
|
|
|
-f=this.w,h=f*a.w+c*a.x+d*a.y+e*a.z;0>h?(this.w=-a.w,this.x=-a.x,this.y=-a.y,this.z=-a.z,h=-h):this.copy(a);if(1<=h)return this.w=f,this.x=c,this.y=d,this.z=e,this;var g=Math.acos(h),i=Math.sqrt(1-h*h);if(0.0010>Math.abs(i))return this.w=0.5*(f+this.w),this.x=0.5*(c+this.x),this.y=0.5*(d+this.y),this.z=0.5*(e+this.z),this;h=Math.sin((1-b)*g)/i;g=Math.sin(b*g)/i;this.w=f*h+this.w*g;this.x=c*h+this.x*g;this.y=d*h+this.y*g;this.z=e*h+this.z*g;return this},equals:function(a){return a.x===this.x&&a.y===
|
|
|
+f=this.w,h=f*a.w+c*a.x+d*a.y+e*a.z;0>h?(this.w=-a.w,this.x=-a.x,this.y=-a.y,this.z=-a.z,h=-h):this.copy(a);if(1<=h)return this.w=f,this.x=c,this.y=d,this.z=e,this;var g=Math.acos(h),i=Math.sqrt(1-h*h);if(0.001>Math.abs(i))return this.w=0.5*(f+this.w),this.x=0.5*(c+this.x),this.y=0.5*(d+this.y),this.z=0.5*(e+this.z),this;h=Math.sin((1-b)*g)/i;g=Math.sin(b*g)/i;this.w=f*h+this.w*g;this.x=c*h+this.x*g;this.y=d*h+this.y*g;this.z=e*h+this.z*g;return this},equals:function(a){return a.x===this.x&&a.y===
|
|
|
this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
|
|
|
THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,
|
|
|
b){if(void 0!==b)return console.warn("DEPRECATED: Vector2's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("DEPRECATED: Vector2's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=
|
|
@@ -54,8 +54,8 @@ case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Err
|
|
|
addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("DEPRECATED: Vector4's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},
|
|
|
applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(this.x/=a,this.y/=a,this.z/=a,this.w/=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=
|
|
|
a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){var b,c,d,a=a.elements,e=a[0];d=a[4];var f=a[8],h=a[1],g=a[5],i=a[9];c=a[2];b=a[6];var j=a[10];if(0.01>Math.abs(d-h)&&0.01>Math.abs(f-c)&&0.01>Math.abs(i-b)){if(0.1>Math.abs(d+h)&&0.1>Math.abs(f+c)&&0.1>Math.abs(i+b)&&0.1>Math.abs(e+g+j-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;g=(g+1)/2;j=(j+1)/2;d=(d+h)/4;f=(f+c)/4;i=(i+b)/4;e>g&&e>j?0.01>e?(b=0,d=c=0.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):g>j?0.01>g?(b=0.707106781,
|
|
|
-c=0,d=0.707106781):(c=Math.sqrt(g),b=d/c,d=i/c):0.01>j?(c=b=0.707106781,d=0):(d=Math.sqrt(j),b=f/d,c=i/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-i)*(b-i)+(f-c)*(f-c)+(h-d)*(h-d));0.0010>Math.abs(a)&&(a=1);this.x=(b-i)/a;this.y=(f-c)/a;this.z=(h-d)/a;this.w=Math.acos((e+g+j-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<
|
|
|
-a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*
|
|
|
+c=0,d=0.707106781):(c=Math.sqrt(g),b=d/c,d=i/c):0.01>j?(c=b=0.707106781,d=0):(d=Math.sqrt(j),b=f/d,c=i/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-i)*(b-i)+(f-c)*(f-c)+(h-d)*(h-d));0.001>Math.abs(a)&&(a=1);this.x=(b-i)/a;this.y=(f-c)/a;this.z=(h-d)/a;this.w=Math.acos((e+g+j-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);this.z<a.z&&
|
|
|
+(this.z=a.z);this.w<a.w&&(this.w=a.w);return this},clamp:function(a,b){this.x<a.x?this.x=a.x:this.x>b.x&&(this.x=b.x);this.y<a.y?this.y=a.y:this.y>b.y&&(this.y=b.y);this.z<a.z?this.z=a.z:this.z>b.z&&(this.z=b.z);this.w<a.w?this.w=a.w:this.w>b.w&&(this.w=b.w);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*
|
|
|
this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&
|
|
|
a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3};
|
|
|
THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,
|
|
@@ -125,7 +125,7 @@ THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.
|
|
|
new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},
|
|
|
clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Vertex=function(a){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.");return a};THREE.UV=function(a,b){console.warn("THREE.UV has been DEPRECATED. Use THREE.Vector2 instead.");return new THREE.Vector2(a,b)};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1};
|
|
|
THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),
|
|
|
-a=0.0010*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
|
|
|
+a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){};
|
|
|
THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a].indexOf(b);-1!==d&&c[a].splice(d,1)}},dispatchEvent:function(a){if(void 0!==
|
|
|
this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);0<this.ray.direction.lengthSq()&&this.ray.direction.normalize();this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray,d=new a.Plane,e=new a.Vector3,f=new a.Vector3,h=new a.Matrix4,g=function(a,b){return a.distance-b.distance},i=function(g,j,m){if(g instanceof a.Particle){f.getPositionFromMatrix(g.matrixWorld);var q=j.ray.distanceToPoint(f);if(q>g.scale.x)return m;m.push({distance:q,point:g.position,face:null,object:g})}else if(g instanceof
|
|
|
a.LOD)f.getPositionFromMatrix(g.matrixWorld),q=j.ray.origin.distanceTo(f),i(g.getObjectForDistance(q),j,m);else if(g instanceof a.Mesh){f.getPositionFromMatrix(g.matrixWorld);b.set(f,g.geometry.boundingSphere.radius*g.matrixWorld.getMaxScaleOnAxis());if(!1===j.ray.isIntersectionSphere(b))return m;var q=g.geometry,t=q.vertices;if(q instanceof a.BufferGeometry){var n=g.material;if(void 0===n||!q.dynamic)return m;var r=g.material instanceof a.MeshFaceMaterial,s=!0===r?g.material.materials:null,v=g.material.side,
|
|
@@ -134,7 +134,7 @@ v+1],q.attributes.position.array[3*v+2]),s.set(q.attributes.position.array[3*z],
|
|
|
m.push({distance:F,point:j.ray.at(F),face:null,faceIndex:null,object:g}))}}else if(q instanceof a.Geometry){r=g.material instanceof a.MeshFaceMaterial;s=!0===r?g.material.materials:null;C=j.precision;h.getInverse(g.matrixWorld);c.copy(j.ray).applyMatrix4(h);I=0;for(H=q.faces.length;I<H;I++)if(A=q.faces[I],n=!0===r?s[A.materialIndex]:g.material,void 0!==n&&(d.setFromNormalAndCoplanarPoint(A.normal,t[A.a]),F=c.distanceToPlane(d),!(Math.abs(F)<C)&&!(0>F))){v=n.side;if(v!==a.DoubleSide&&(z=c.direction.dot(d.normal),
|
|
|
!(v===a.FrontSide?0>z:0<z)))continue;if(!(F<j.near||F>j.far)){e=c.at(F,e);if(A instanceof a.Face3){if(v=t[A.a],z=t[A.b],G=t[A.c],!a.Triangle.containsPoint(e,v,z,G))continue}else if(A instanceof a.Face4){if(v=t[A.a],z=t[A.b],G=t[A.c],n=t[A.d],!a.Triangle.containsPoint(e,v,z,n)&&!a.Triangle.containsPoint(e,z,G,n))continue}else throw Error("face type not supported");m.push({distance:F,point:j.ray.at(F),face:A,faceIndex:I,object:g})}}}}},j=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<
|
|
|
e;d++)i(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b);0<this.ray.direction.length()&&this.ray.direction.normalize()};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===b&&j(a,this,c);i(a,this,c);c.sort(g);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)i(a[d],this,c),!0===b&&j(a[d],this,c);c.sort(g);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Math.generateUUID();this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder=THREE.Object3D.defaultEulerOrder;this.scale=new THREE.Vector3(1,1,1);this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=
|
|
|
-!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
|
|
|
+!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.boundingBox=null;this.userData={}};
|
|
|
THREE.Object3D.prototype={constructor:THREE.Object3D,addEventListener:THREE.EventDispatcher.prototype.addEventListener,hasEventListener:THREE.EventDispatcher.prototype.hasEventListener,removeEventListener:THREE.EventDispatcher.prototype.removeEventListener,dispatchEvent:THREE.EventDispatcher.prototype.dispatchEvent,applyMatrix:function(){var a=new THREE.Matrix4;return function(b){this.matrix.multiplyMatrices(b,this.matrix);this.position.getPositionFromMatrix(this.matrix);this.scale.getScaleFromMatrix(this.matrix);
|
|
|
a.extractRotation(this.matrix);!0===this.useQuaternion?this.quaternion.setFromRotationMatrix(a):this.rotation.setEulerFromRotationMatrix(a,this.eulerOrder)}}(),rotateOnAxis:function(){var a=new THREE.Quaternion,b=new THREE.Quaternion;return function(c,d){a.setFromAxisAngle(c,d);!0===this.useQuaternion?this.quaternion.multiply(a):(b.setFromEuler(this.rotation,this.eulerOrder),b.multiply(a),this.rotation.setEulerFromQuaternion(b,this.eulerOrder));return this}}(),translateOnAxis:function(){var a=new THREE.Vector3;
|
|
|
return function(b,c){a.copy(b);!0===this.useQuaternion?a.applyQuaternion(this.quaternion):a.applyEuler(this.rotation,this.eulerOrder);this.position.add(a.multiplyScalar(c));return this}}(),translate:function(a,b){console.warn("DEPRECATED: Object3D's .translate() has been removed. Use .translateOnAxis( axis, distance ) instead. Note args have been changed.");return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),
|
|
@@ -143,8 +143,9 @@ translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return t
|
|
|
if(-1!==b){a.parent=void 0;this.children.splice(b,1);for(b=this;void 0!==b.parent;)b=b.parent;void 0!==b&&b instanceof THREE.Scene&&b.__removeObject(a)}},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},getObjectById:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.id===a||!0===b&&(e=e.getObjectById(a,b),void 0!==e))return e}},getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];
|
|
|
if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a,b)},getDescendants:function(a){void 0===a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},updateMatrix:function(){!1===this.useQuaternion?this.matrix.makeFromPositionEulerScale(this.position,
|
|
|
this.rotation,this.eulerOrder,this.scale):this.matrix.makeFromPositionQuaternionScale(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},
|
|
|
-clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.rotation instanceof THREE.Vector3&&a.rotation.copy(this.rotation);a.eulerOrder=this.eulerOrder;a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);
|
|
|
-a.useQuaternion=this.useQuaternion;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.Object3D.defaultEulerOrder="XYZ";THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;j.push(a);l++;i++;return a}return j[i++]}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=0,g,i,j=[],l=0,p,m,q=[],t=0,n,r=[],
|
|
|
+computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.makeEmpty();var b=this.boundingBox;this.updateMatrixWorld(!0);this.traverse(function(c){if(void 0!==c.geometry&&void 0!==c.geometry.vertices)for(var d=c.geometry.vertices,e=0,f=d.length;e<f;e++)a.copy(d[e]),a.applyMatrix4(c.matrixWorld),b.expandByPoint(a)});return this.boundingBox}}(),clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&
|
|
|
+(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.rotation instanceof THREE.Vector3&&a.rotation.copy(this.rotation);a.eulerOrder=this.eulerOrder;a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);a.useQuaternion=this.useQuaternion;a.visible=
|
|
|
+this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;this.boundingBox instanceof THREE.Box3&&(a.boundingBox=this.boundingBox.clone());a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.Object3D.defaultEulerOrder="XYZ";THREE.Projector=function(){function a(){if(i===l){var a=new THREE.RenderableVertex;j.push(a);l++;i++;return a}return j[i++]}function b(a,b){return b.z-a.z}function c(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,h=-a.z+a.w,g=-b.z+b.w;if(0<=e&&0<=f&&0<=h&&0<=g)return!0;if(0>e&&0>f||0>h&&0>g)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>h?c=Math.max(c,h/(h-g)):0>g&&(d=Math.min(d,h/(h-g)));if(d<c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var d,e,f=[],h=0,g,i,j=[],l=0,p,m,q=[],t=0,n,r=[],
|
|
|
s=0,v,z,G=[],C=0,H,I,F=[],A=0,K={objects:[],sprites:[],lights:[],elements:[]},B=new THREE.Vector3,J=new THREE.Vector4,N=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),y=new THREE.Box3,M=Array(3),w=Array(4),Z=new THREE.Matrix4,L=new THREE.Matrix4,oa,Pa=new THREE.Matrix4,Va=new THREE.Matrix3,O=new THREE.Matrix3,qa=new THREE.Vector3,Fa=new THREE.Frustum,wa=new THREE.Vector4,D=new THREE.Vector4;this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);L.multiplyMatrices(b.projectionMatrix,
|
|
|
b.matrixWorldInverse);return a.applyProjection(L)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);L.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection(L)};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.sub(a).normalize();return new THREE.Raycaster(a,c)};var V=function(a){if(e===h){var b=new THREE.RenderableObject;f.push(b);h++;e++;d=b}else d=f[e++];
|
|
|
d.object=a;null!==a.renderDepth?d.z=a.renderDepth:(B.getPositionFromMatrix(a.matrixWorld),B.applyProjection(L),d.z=B.z);return d},ea=function(a){if(!1!==a.visible){a instanceof THREE.Light?K.lights.push(a):a instanceof THREE.Mesh||a instanceof THREE.Line?(!1===a.frustumCulled||!0===Fa.intersectsObject(a))&&K.objects.push(V(a)):(a instanceof THREE.Sprite||a instanceof THREE.Particle)&&K.sprites.push(V(a));for(var b=0,c=a.children.length;b<c;b++)ea(a.children[b])}};this.projectScene=function(d,f,h,
|
|
@@ -366,16 +367,16 @@ THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,
|
|
|
THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,"#ifdef USE_SKINNING\nvNormal = normalize( normalMatrix * skinnedNormal.xyz );\nvec4 skinnedTangent = skinMatrix * vec4( tangent.xyz, 0.0 );\nvTangent = normalize( normalMatrix * skinnedTangent.xyz );\n#else\nvNormal = normalize( normalMatrix * normal );\nvTangent = normalize( normalMatrix * tangent.xyz );\n#endif\nvBinormal = normalize( cross( vNormal, vTangent ) * tangent.w );\nvUv = uv * uRepeat + uOffset;\nvec3 displacedPosition;\n#ifdef VERTEX_TEXTURES\nif ( enableDisplacement ) {\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\ndisplacedPosition = position + normalize( normal ) * df;\n} else {\n#ifdef USE_SKINNING\nvec4 skinVertex = vec4( position, 1.0 );\nvec4 skinned = boneMatX * skinVertex * skinWeight.x;\nskinned \t += boneMatY * skinVertex * skinWeight.y;\ndisplacedPosition = skinned.xyz;\n#else\ndisplacedPosition = position;\n#endif\n}\n#else\n#ifdef USE_SKINNING\nvec4 skinVertex = vec4( position, 1.0 );\nvec4 skinned = boneMatX * skinVertex * skinWeight.x;\nskinned \t += boneMatY * skinVertex * skinWeight.y;\ndisplacedPosition = skinned.xyz;\n#else\ndisplacedPosition = position;\n#endif\n#endif\nvec4 mvPosition = modelViewMatrix * vec4( displacedPosition, 1.0 );\nvec4 worldPosition = modelMatrix * vec4( displacedPosition, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\nvWorldPosition = worldPosition.xyz;\nvViewPosition = -mvPosition.xyz;\n#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n}\n#endif\n}"].join("\n")},
|
|
|
cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:"varying vec3 vWorldPosition;\nvoid main() {\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\nvWorldPosition = worldPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\nvoid main() {\ngl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n}"},
|
|
|
depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,"}"].join("\n"),fragmentShader:"vec4 pack_depth( const in float depth ) {\nconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\nconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\nvec4 res = fract( depth * bit_shift );\nres -= res.xxyz * bit_mask;\nreturn res;\n}\nvoid main() {\ngl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n}"}};THREE.WebGLRenderer=function(a){function b(a){if(a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)k.deleteBuffer(a.__webglCustomAttributesList[b].buffer)}function c(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var e in d.attributes){var f=d.attributes[e];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var h=1;"v2"===f.type?h=2:"v3"===f.type?h=3:"v4"===f.type?
|
|
|
-h=4:"c"===f.type&&(h=3);f.size=h;f.array=new Float32Array(c*h);f.buffer=k.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}function d(a,b){var c=b.geometry,d=a.faces3,g=a.faces4,i=3*d.length+4*g.length,j=1*d.length+2*g.length,g=3*d.length+4*g.length,d=e(b,a),p=h(d),m=f(d),l=d.vertexColors?d.vertexColors:!1;a.__vertexArray=new Float32Array(3*i);m&&(a.__normalArray=new Float32Array(3*i));c.hasTangents&&(a.__tangentArray=new Float32Array(4*i));l&&
|
|
|
+h=4:"c"===f.type&&(h=3);f.size=h;f.array=new Float32Array(c*h);f.buffer=k.createBuffer();f.buffer.belongsToAttribute=e;f.needsUpdate=!0}a.__webglCustomAttributesList.push(f)}}}function d(a,b){var c=b.geometry,d=a.faces3,g=a.faces4,i=3*d.length+4*g.length,j=1*d.length+2*g.length,g=3*d.length+4*g.length,d=e(b,a),p=h(d),l=f(d),m=d.vertexColors?d.vertexColors:!1;a.__vertexArray=new Float32Array(3*i);l&&(a.__normalArray=new Float32Array(3*i));c.hasTangents&&(a.__tangentArray=new Float32Array(4*i));m&&
|
|
|
(a.__colorArray=new Float32Array(3*i));if(p){if(0<c.faceUvs.length||0<c.faceVertexUvs.length)a.__uvArray=new Float32Array(2*i);if(1<c.faceUvs.length||1<c.faceVertexUvs.length)a.__uv2Array=new Float32Array(2*i)}b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*i),a.__skinWeightArray=new Float32Array(4*i));a.__faceArray=new Uint16Array(3*j);a.__lineArray=new Uint16Array(2*g);if(a.numMorphTargets){a.__morphTargetsArrays=[];c=0;for(p=a.numMorphTargets;c<
|
|
|
p;c++)a.__morphTargetsArrays.push(new Float32Array(3*i))}if(a.numMorphNormals){a.__morphNormalsArrays=[];c=0;for(p=a.numMorphNormals;c<p;c++)a.__morphNormalsArrays.push(new Float32Array(3*i))}a.__webglFaceCount=3*j;a.__webglLineCount=2*g;if(d.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var n in d.attributes){var j=d.attributes[n],c={},q;for(q in j)c[q]=j[q];if(!c.__webglInitialized||c.createUniqueBuffers)c.__webglInitialized=!0,g=1,"v2"===c.type?g=2:
|
|
|
"v3"===c.type?g=3:"v4"===c.type?g=4:"c"===c.type&&(g=3),c.size=g,c.array=new Float32Array(i*g),c.buffer=k.createBuffer(),c.buffer.belongsToAttribute=n,j.needsUpdate=!0,c.__original=j;a.__webglCustomAttributesList.push(c)}}a.__inittedArrays=!0}function e(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function f(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?!1:a&&void 0!==a.shading&&a.shading===
|
|
|
THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function h(a){return a.map||a.lightMap||a.bumpMap||a.normalMap||a.specularMap||a instanceof THREE.ShaderMaterial?!0:!1}function g(a){Ab[a]||(k.enableVertexAttribArray(a),Ab[a]=!0)}function i(){for(var a in Ab)Ab[a]&&(k.disableVertexAttribArray(a),Ab[a]=!1)}function j(a,b){return a.z!==b.z?b.z-a.z:a.id-b.id}function l(a,b){return b[0]-a[0]}function p(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++)ya=pa=null,pb=ub=T=da=bb=xa=aa=-1,yb=!0,a[d].render(b,
|
|
|
-c,Xb,Jb),ya=pa=null,pb=ub=T=da=bb=xa=aa=-1,yb=!0}function m(a,b,c,d,e,f,h,g){var k,i,j,p;b?(i=a.length-1,p=b=-1):(i=0,b=a.length,p=1);for(var m=i;m!==b;m+=p)if(k=a[m],k.render){i=k.object;j=k.buffer;if(g)k=g;else{k=k[c];if(!k)continue;h&&D.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst);D.setDepthTest(k.depthTest);D.setDepthWrite(k.depthWrite);K(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}D.setMaterialFaces(k);j instanceof THREE.BufferGeometry?D.renderBufferDirect(d,
|
|
|
+c,Xb,Jb),ya=pa=null,pb=ub=T=da=bb=xa=aa=-1,yb=!0}function m(a,b,c,d,e,f,h,g){var k,i,j,p;b?(i=a.length-1,p=b=-1):(i=0,b=a.length,p=1);for(var l=i;l!==b;l+=p)if(k=a[l],k.render){i=k.object;j=k.buffer;if(g)k=g;else{k=k[c];if(!k)continue;h&&D.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst);D.setDepthTest(k.depthTest);D.setDepthWrite(k.depthWrite);K(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits)}D.setMaterialFaces(k);j instanceof THREE.BufferGeometry?D.renderBufferDirect(d,
|
|
|
e,f,k,j,i):D.renderBuffer(d,e,f,k,j,i)}}function q(a,b,c,d,e,f,h){for(var g,k,i=0,j=a.length;i<j;i++)if(g=a[i],k=g.object,k.visible){if(h)g=h;else{g=g[b];if(!g)continue;f&&D.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);D.setDepthTest(g.depthTest);D.setDepthWrite(g.depthWrite);K(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}D.renderImmediateObject(c,d,e,g,k)}}function t(a,b){var e,f,h,g;if(void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,
|
|
|
a._normalMatrix=new THREE.Matrix3,void 0!==a.geometry&&void 0===a.geometry.__webglInit&&(a.geometry.__webglInit=!0,a.geometry.addEventListener("dispose",kc)),f=a.geometry,void 0!==f))if(f instanceof THREE.BufferGeometry){var i,j;for(i in f.attributes)j="index"===i?k.ELEMENT_ARRAY_BUFFER:k.ARRAY_BUFFER,g=f.attributes[i],void 0===g.numItems&&(g.numItems=g.array.length),g.buffer=k.createBuffer(),k.bindBuffer(j,g.buffer),k.bufferData(j,g.array,k.STATIC_DRAW)}else if(a instanceof THREE.Mesh){h=a.material;
|
|
|
-if(void 0===f.geometryGroups){i=f;var p,m,l,q,r;j={};var s=i.morphTargets.length,t=i.morphNormals.length,v=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(p=i.faces.length;h<p;h++)m=i.faces[h],l=v?m.materialIndex:0,void 0===j[l]&&(j[l]={hash:l,counter:0}),r=j[l].hash+"_"+j[l].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:l,vertices:0,numMorphTargets:s,numMorphNormals:t}),q=m instanceof THREE.Face3?3:4,65535<i.geometryGroups[r].vertices+
|
|
|
-q&&(j[l].counter+=1,r=j[l].hash+"_"+j[l].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:l,vertices:0,numMorphTargets:s,numMorphNormals:t})),m instanceof THREE.Face3?i.geometryGroups[r].faces3.push(h):i.geometryGroups[r].faces4.push(h),i.geometryGroups[r].vertices+=q;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=Ha++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=f.geometryGroups[e],!g.__webglVertexBuffer){i=
|
|
|
+if(void 0===f.geometryGroups){i=f;var p,l,m,q,r;j={};var s=i.morphTargets.length,t=i.morphNormals.length,v=h instanceof THREE.MeshFaceMaterial;i.geometryGroups={};h=0;for(p=i.faces.length;h<p;h++)l=i.faces[h],m=v?l.materialIndex:0,void 0===j[m]&&(j[m]={hash:m,counter:0}),r=j[m].hash+"_"+j[m].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:m,vertices:0,numMorphTargets:s,numMorphNormals:t}),q=l instanceof THREE.Face3?3:4,65535<i.geometryGroups[r].vertices+
|
|
|
+q&&(j[m].counter+=1,r=j[m].hash+"_"+j[m].counter,void 0===i.geometryGroups[r]&&(i.geometryGroups[r]={faces3:[],faces4:[],materialIndex:m,vertices:0,numMorphTargets:s,numMorphNormals:t})),l instanceof THREE.Face3?i.geometryGroups[r].faces3.push(h):i.geometryGroups[r].faces4.push(h),i.geometryGroups[r].vertices+=q;i.geometryGroupsList=[];for(g in i.geometryGroups)i.geometryGroups[g].id=Ha++,i.geometryGroupsList.push(i.geometryGroups[g])}for(e in f.geometryGroups)if(g=f.geometryGroups[e],!g.__webglVertexBuffer){i=
|
|
|
g;i.__webglVertexBuffer=k.createBuffer();i.__webglNormalBuffer=k.createBuffer();i.__webglTangentBuffer=k.createBuffer();i.__webglColorBuffer=k.createBuffer();i.__webglUVBuffer=k.createBuffer();i.__webglUV2Buffer=k.createBuffer();i.__webglSkinIndicesBuffer=k.createBuffer();i.__webglSkinWeightsBuffer=k.createBuffer();i.__webglFaceBuffer=k.createBuffer();i.__webglLineBuffer=k.createBuffer();s=j=void 0;if(i.numMorphTargets){i.__webglMorphTargetsBuffers=[];j=0;for(s=i.numMorphTargets;j<s;j++)i.__webglMorphTargetsBuffers.push(k.createBuffer())}if(i.numMorphNormals){i.__webglMorphNormalsBuffers=
|
|
|
[];j=0;for(s=i.numMorphNormals;j<s;j++)i.__webglMorphNormalsBuffers.push(k.createBuffer())}D.info.memory.geometries++;d(g,a);f.verticesNeedUpdate=!0;f.morphTargetsNeedUpdate=!0;f.elementsNeedUpdate=!0;f.uvsNeedUpdate=!0;f.normalsNeedUpdate=!0;f.tangentsNeedUpdate=!0;f.colorsNeedUpdate=!0}}else a instanceof THREE.Ribbon?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglNormalBuffer=k.createBuffer(),D.info.memory.geometries++,g=f,i=g.vertices.length,
|
|
|
g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*i),g.__normalArray=new Float32Array(3*i),g.__webglVertexCount=i,c(g,a),f.verticesNeedUpdate=!0,f.colorsNeedUpdate=!0,f.normalsNeedUpdate=!0):a instanceof THREE.Line?f.__webglVertexBuffer||(g=f,g.__webglVertexBuffer=k.createBuffer(),g.__webglColorBuffer=k.createBuffer(),g.__webglLineDistanceBuffer=k.createBuffer(),D.info.memory.geometries++,g=f,i=g.vertices.length,g.__vertexArray=new Float32Array(3*i),g.__colorArray=new Float32Array(3*
|
|
@@ -431,13 +432,13 @@ b){a.program=void 0;var c,d,e=!1,a=0;for(c=V.length;a<c;a++)if(d=V[a],d.program=
|
|
|
k.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=k.createBuffer());a.hasPositions&&(k.bindBuffer(k.ARRAY_BUFFER,a.__webglVertexBuffer),k.bufferData(k.ARRAY_BUFFER,a.positionArray,k.DYNAMIC_DRAW),k.enableVertexAttribArray(b.attributes.position),k.vertexAttribPointer(b.attributes.position,3,k.FLOAT,!1,0,0));if(a.hasNormals){k.bindBuffer(k.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,e,f,h,g,i,j,l,p,m,n,q=3*a.count;for(n=0;n<q;n+=9)m=a.normalArray,
|
|
|
d=m[n],e=m[n+1],f=m[n+2],h=m[n+3],i=m[n+4],l=m[n+5],g=m[n+6],j=m[n+7],p=m[n+8],d=(d+h+g)/3,e=(e+i+j)/3,f=(f+l+p)/3,m[n]=d,m[n+1]=e,m[n+2]=f,m[n+3]=d,m[n+4]=e,m[n+5]=f,m[n+6]=d,m[n+7]=e,m[n+8]=f}k.bufferData(k.ARRAY_BUFFER,a.normalArray,k.DYNAMIC_DRAW);k.enableVertexAttribArray(b.attributes.normal);k.vertexAttribPointer(b.attributes.normal,3,k.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(k.bindBuffer(k.ARRAY_BUFFER,a.__webglUvBuffer),k.bufferData(k.ARRAY_BUFFER,a.uvArray,k.DYNAMIC_DRAW),k.enableVertexAttribArray(b.attributes.uv),
|
|
|
k.vertexAttribPointer(b.attributes.uv,2,k.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(k.bindBuffer(k.ARRAY_BUFFER,a.__webglColorBuffer),k.bufferData(k.ARRAY_BUFFER,a.colorArray,k.DYNAMIC_DRAW),k.enableVertexAttribArray(b.attributes.color),k.vertexAttribPointer(b.attributes.color,3,k.FLOAT,!1,0,0));k.drawArrays(k.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){if(!1!==d.visible){var h,j,l;h=C(a,b,c,d,f);a=h.attributes;b=e.attributes;c=!1;h=16777215*e.id+
|
|
|
-2*h.id+(d.wireframe?1:0);h!==ub&&(ub=h,c=!0);c&&i();if(f instanceof THREE.Mesh)if(d=b.index){e=e.offsets;1<e.length&&(c=!0);for(var p=0,m=e.length;p<m;p++){var n=e[p].index;if(c){for(j in b)"index"!==j&&(h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,l,k.FLOAT,!1,0,4*n*l)));k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,d.buffer)}k.drawElements(k.TRIANGLES,e[p].count,k.UNSIGNED_SHORT,2*e[p].start);D.info.render.calls++;D.info.render.vertices+=e[p].count;
|
|
|
-D.info.render.faces+=e[p].count/3}}else{if(c)for(j in b)"index"!==j&&(h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,l,k.FLOAT,!1,0,0)));j=e.attributes.position;k.drawArrays(k.TRIANGLES,0,j.numItems/3);D.info.render.calls++;D.info.render.vertices+=j.numItems/3;D.info.render.faces+=j.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(j in b)h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,
|
|
|
+2*h.id+(d.wireframe?1:0);h!==ub&&(ub=h,c=!0);c&&i();if(f instanceof THREE.Mesh)if(d=b.index){e=e.offsets;1<e.length&&(c=!0);for(var m=0,p=e.length;m<p;m++){var n=e[m].index;if(c){for(j in b)"index"!==j&&(h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,l,k.FLOAT,!1,0,4*n*l)));k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,d.buffer)}k.drawElements(k.TRIANGLES,e[m].count,k.UNSIGNED_SHORT,2*e[m].start);D.info.render.calls++;D.info.render.vertices+=e[m].count;
|
|
|
+D.info.render.faces+=e[m].count/3}}else{if(c)for(j in b)"index"!==j&&(h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,l,k.FLOAT,!1,0,0)));j=e.attributes.position;k.drawArrays(k.TRIANGLES,0,j.numItems/3);D.info.render.calls++;D.info.render.vertices+=j.numItems/3;D.info.render.faces+=j.numItems/3/3}else if(f instanceof THREE.ParticleSystem){if(c){for(j in b)h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,
|
|
|
l,k.FLOAT,!1,0,0));j=b.position;k.drawArrays(k.POINTS,0,j.numItems/3);D.info.render.calls++;D.info.render.points+=j.numItems/3}}else if(f instanceof THREE.Line&&c){for(j in b)h=a[j],f=b[j],l=f.itemSize,0<=h&&(k.bindBuffer(k.ARRAY_BUFFER,f.buffer),g(h),k.vertexAttribPointer(h,l,k.FLOAT,!1,0,0));A(d.linewidth);j=b.position;k.drawArrays(k.LINE_STRIP,0,j.numItems/3);D.info.render.calls++;D.info.render.points+=j.numItems}}};this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){var h,j,c=C(a,b,c,d,
|
|
|
f),a=c.attributes,b=!1,c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==ub&&(ub=c,b=!0);b&&i();if(!d.morphTargets&&0<=a.position)b&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglVertexBuffer),g(a.position),k.vertexAttribPointer(a.position,3,k.FLOAT,!1,0,0));else if(f.morphTargetBase){c=d.program.attributes;-1!==f.morphTargetBase&&0<=c.position?(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),g(c.position),k.vertexAttribPointer(c.position,3,k.FLOAT,!1,0,0)):0<=c.position&&(k.bindBuffer(k.ARRAY_BUFFER,
|
|
|
-e.__webglVertexBuffer),g(c.position),k.vertexAttribPointer(c.position,3,k.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var p=0;j=f.morphTargetForcedOrder;for(h=f.morphTargetInfluences;p<d.numSupportedMorphTargets&&p<j.length;)0<=c["morphTarget"+p]&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[j[p]]),g(c["morphTarget"+p]),k.vertexAttribPointer(c["morphTarget"+p],3,k.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[j[p]]),
|
|
|
-g(c["morphNormal"+p]),k.vertexAttribPointer(c["morphNormal"+p],3,k.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=h[j[p]],p++}else{j=[];h=f.morphTargetInfluences;var m,n=h.length;for(m=0;m<n;m++)p=h[m],0<p&&j.push([p,m]);j.length>d.numSupportedMorphTargets?(j.sort(l),j.length=d.numSupportedMorphTargets):j.length>d.numSupportedMorphNormals?j.sort(l):0===j.length&&j.push([0,0]);for(p=0;p<d.numSupportedMorphTargets;)j[p]?(m=j[p][1],0<=c["morphTarget"+p]&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[m]),
|
|
|
-g(c["morphTarget"+p]),k.vertexAttribPointer(c["morphTarget"+p],3,k.FLOAT,!1,0,0)),0<=c["morphNormal"+p]&&d.morphNormals&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[m]),g(c["morphNormal"+p]),k.vertexAttribPointer(c["morphNormal"+p],3,k.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[p]=h[m]):f.__webglMorphTargetInfluences[p]=0,p++}null!==d.program.uniforms.morphTargetInfluences&&k.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){h=
|
|
|
+e.__webglVertexBuffer),g(c.position),k.vertexAttribPointer(c.position,3,k.FLOAT,!1,0,0));if(f.morphTargetForcedOrder.length){var m=0;j=f.morphTargetForcedOrder;for(h=f.morphTargetInfluences;m<d.numSupportedMorphTargets&&m<j.length;)0<=c["morphTarget"+m]&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[j[m]]),g(c["morphTarget"+m]),k.vertexAttribPointer(c["morphTarget"+m],3,k.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[j[m]]),
|
|
|
+g(c["morphNormal"+m]),k.vertexAttribPointer(c["morphNormal"+m],3,k.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=h[j[m]],m++}else{j=[];h=f.morphTargetInfluences;var p,n=h.length;for(p=0;p<n;p++)m=h[p],0<m&&j.push([m,p]);j.length>d.numSupportedMorphTargets?(j.sort(l),j.length=d.numSupportedMorphTargets):j.length>d.numSupportedMorphNormals?j.sort(l):0===j.length&&j.push([0,0]);for(m=0;m<d.numSupportedMorphTargets;)j[m]?(p=j[m][1],0<=c["morphTarget"+m]&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p]),
|
|
|
+g(c["morphTarget"+m]),k.vertexAttribPointer(c["morphTarget"+m],3,k.FLOAT,!1,0,0)),0<=c["morphNormal"+m]&&d.morphNormals&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p]),g(c["morphNormal"+m]),k.vertexAttribPointer(c["morphNormal"+m],3,k.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[m]=h[p]):f.__webglMorphTargetInfluences[m]=0,m++}null!==d.program.uniforms.morphTargetInfluences&&k.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(b){if(e.__webglCustomAttributesList){h=
|
|
|
0;for(j=e.__webglCustomAttributesList.length;h<j;h++)c=e.__webglCustomAttributesList[h],0<=a[c.buffer.belongsToAttribute]&&(k.bindBuffer(k.ARRAY_BUFFER,c.buffer),g(a[c.buffer.belongsToAttribute]),k.vertexAttribPointer(a[c.buffer.belongsToAttribute],c.size,k.FLOAT,!1,0,0))}0<=a.color&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglColorBuffer),g(a.color),k.vertexAttribPointer(a.color,3,k.FLOAT,!1,0,0));0<=a.normal&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglNormalBuffer),g(a.normal),k.vertexAttribPointer(a.normal,
|
|
|
3,k.FLOAT,!1,0,0));0<=a.tangent&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglTangentBuffer),g(a.tangent),k.vertexAttribPointer(a.tangent,4,k.FLOAT,!1,0,0));0<=a.uv&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglUVBuffer),g(a.uv),k.vertexAttribPointer(a.uv,2,k.FLOAT,!1,0,0));0<=a.uv2&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglUV2Buffer),g(a.uv2),k.vertexAttribPointer(a.uv2,2,k.FLOAT,!1,0,0));d.skinning&&(0<=a.skinIndex&&0<=a.skinWeight)&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),g(a.skinIndex),k.vertexAttribPointer(a.skinIndex,
|
|
|
4,k.FLOAT,!1,0,0),k.bindBuffer(k.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),g(a.skinWeight),k.vertexAttribPointer(a.skinWeight,4,k.FLOAT,!1,0,0));0<=a.lineDistance&&(k.bindBuffer(k.ARRAY_BUFFER,e.__webglLineDistanceBuffer),g(a.lineDistance),k.vertexAttribPointer(a.lineDistance,1,k.FLOAT,!1,0,0))}f instanceof THREE.Mesh?(d.wireframe?(A(d.wireframeLinewidth),b&&k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),k.drawElements(k.LINES,e.__webglLineCount,k.UNSIGNED_SHORT,0)):(b&&k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,
|
|
@@ -449,8 +450,8 @@ Ga.applyProjection(xb),f.z=Ga.z))}this.sortObjects&&g.sort(j);g=a.__webglObjects
|
|
|
this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),m(a.__webglObjects,!1,"",b,i,l,!0,d),q(a.__webglObjectsImmediate,"",b,i,l,!1,d)):(d=null,this.setBlending(THREE.NoBlending),m(a.__webglObjects,!0,"opaque",b,i,l,!1,d),q(a.__webglObjectsImmediate,"opaque",b,i,l,!1,d),m(a.__webglObjects,!1,"transparent",b,i,l,!0,d),q(a.__webglObjectsImmediate,"transparent",b,i,l,!0,d));p(this.renderPluginsPost,a,b);c&&(c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&
|
|
|
c.minFilter!==THREE.LinearFilter)&&(c instanceof THREE.WebGLRenderTargetCube?(k.bindTexture(k.TEXTURE_CUBE_MAP,c.__webglTexture),k.generateMipmap(k.TEXTURE_CUBE_MAP),k.bindTexture(k.TEXTURE_CUBE_MAP,null)):(k.bindTexture(k.TEXTURE_2D,c.__webglTexture),k.generateMipmap(k.TEXTURE_2D),k.bindTexture(k.TEXTURE_2D,null)));this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=C(a,b,c,d,e);ub=-1;D.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,
|
|
|
k,Sa):e.render(function(a){D.renderBufferImmediate(a,f,d)})};this.initWebGLObjects=function(a){a.__webglObjects||(a.__webglObjects=[],a.__webglObjectsImmediate=[],a.__webglSprites=[],a.__webglFlares=[]);for(;a.__objectsAdded.length;)t(a.__objectsAdded[0],a),a.__objectsAdded.splice(0,1);for(;a.__objectsRemoved.length;)v(a.__objectsRemoved[0],a),a.__objectsRemoved.splice(0,1);for(var b=0,c=a.__webglObjects.length;b<c;b++){var g=a.__webglObjects[b].object;void 0===g.__webglInit&&(void 0!==g.__webglActive&&
|
|
|
-v(g,a),t(g,a));var i=g,j=i.geometry,p=void 0,m=void 0,n=void 0;if(j instanceof THREE.BufferGeometry){var q=k.DYNAMIC_DRAW,w=!j.dynamic,z=j.attributes,y=void 0,A=void 0;for(y in z)A=z[y],A.needsUpdate&&("index"===y?(k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,A.array,q)):(k.bindBuffer(k.ARRAY_BUFFER,A.buffer),k.bufferData(k.ARRAY_BUFFER,A.array,q)),A.needsUpdate=!1),w&&!A.dynamic&&delete A.array}else if(i instanceof THREE.Mesh){for(var B=0,G=j.geometryGroupsList.length;B<
|
|
|
-G;B++)if(p=j.geometryGroupsList[B],n=e(i,p),j.buffersNeedUpdate&&d(p,i),m=n.attributes&&r(n),j.verticesNeedUpdate||j.morphTargetsNeedUpdate||j.elementsNeedUpdate||j.uvsNeedUpdate||j.normalsNeedUpdate||j.colorsNeedUpdate||j.tangentsNeedUpdate||m){var C=p,F=i,H=k.DYNAMIC_DRAW,I=!j.dynamic,J=n;if(C.__inittedArrays){var V=f(J),K=J.vertexColors?J.vertexColors:!1,L=h(J),M=V===THREE.SmoothShading,E=void 0,D=void 0,N=void 0,Q=void 0,O=void 0,ea=void 0,T=void 0,Y=void 0,pa=void 0,fa=void 0,aa=void 0,R=void 0,
|
|
|
+v(g,a),t(g,a));var i=g,j=i.geometry,m=void 0,p=void 0,n=void 0;if(j instanceof THREE.BufferGeometry){var q=k.DYNAMIC_DRAW,w=!j.dynamic,z=j.attributes,y=void 0,A=void 0;for(y in z)A=z[y],A.needsUpdate&&("index"===y?(k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A.buffer),k.bufferData(k.ELEMENT_ARRAY_BUFFER,A.array,q)):(k.bindBuffer(k.ARRAY_BUFFER,A.buffer),k.bufferData(k.ARRAY_BUFFER,A.array,q)),A.needsUpdate=!1),w&&!A.dynamic&&delete A.array}else if(i instanceof THREE.Mesh){for(var B=0,G=j.geometryGroupsList.length;B<
|
|
|
+G;B++)if(m=j.geometryGroupsList[B],n=e(i,m),j.buffersNeedUpdate&&d(m,i),p=n.attributes&&r(n),j.verticesNeedUpdate||j.morphTargetsNeedUpdate||j.elementsNeedUpdate||j.uvsNeedUpdate||j.normalsNeedUpdate||j.colorsNeedUpdate||j.tangentsNeedUpdate||p){var C=m,F=i,H=k.DYNAMIC_DRAW,I=!j.dynamic,J=n;if(C.__inittedArrays){var V=f(J),K=J.vertexColors?J.vertexColors:!1,L=h(J),M=V===THREE.SmoothShading,E=void 0,D=void 0,N=void 0,Q=void 0,O=void 0,ea=void 0,T=void 0,Y=void 0,pa=void 0,fa=void 0,aa=void 0,R=void 0,
|
|
|
S=void 0,P=void 0,ba=void 0,Z=void 0,da=void 0,ya=void 0,ma=void 0,Ha=void 0,ha=void 0,Ua=void 0,qa=void 0,la=void 0,ia=void 0,ka=void 0,ua=void 0,na=void 0,oa=void 0,ra=void 0,Ca=void 0,va=void 0,wa=void 0,xa=void 0,pb=void 0,za=void 0,ub=void 0,Fa=void 0,Pa=void 0,Ra=void 0,cb=void 0,bb=void 0,$a=void 0,ab=void 0,Va=void 0,Qa=void 0,Ta=0,Za=0,Xa=0,Ya=0,Ka=0,jb=0,Da=0,ob=0,Wa=0,X=0,ga=0,x=0,Aa=void 0,db=C.__vertexArray,fb=C.__uvArray,ib=C.__uv2Array,Sa=C.__normalArray,La=C.__tangentArray,eb=C.__colorArray,
|
|
|
Ma=C.__skinIndexArray,Na=C.__skinWeightArray,yb=C.__morphTargetsArrays,Ab=C.__morphNormalsArrays,Bb=C.__webglCustomAttributesList,u=void 0,Mb=C.__faceArray,wb=C.__lineArray,qb=F.geometry,Gb=qb.elementsNeedUpdate,Hb=qb.uvsNeedUpdate,Rb=qb.normalsNeedUpdate,Sb=qb.tangentsNeedUpdate,Xb=qb.colorsNeedUpdate,Yb=qb.morphTargetsNeedUpdate,cc=qb.vertices,sa=C.faces3,ta=C.faces4,kb=qb.faces,Jb=qb.faceVertexUvs[0],Lb=qb.faceVertexUvs[1],dc=qb.skinIndices,$b=qb.skinWeights,ac=qb.morphTargets,Ib=qb.morphNormals;
|
|
|
if(qb.verticesNeedUpdate){E=0;for(D=sa.length;E<D;E++)Q=kb[sa[E]],R=cc[Q.a],S=cc[Q.b],P=cc[Q.c],db[Za]=R.x,db[Za+1]=R.y,db[Za+2]=R.z,db[Za+3]=S.x,db[Za+4]=S.y,db[Za+5]=S.z,db[Za+6]=P.x,db[Za+7]=P.y,db[Za+8]=P.z,Za+=9;E=0;for(D=ta.length;E<D;E++)Q=kb[ta[E]],R=cc[Q.a],S=cc[Q.b],P=cc[Q.c],ba=cc[Q.d],db[Za]=R.x,db[Za+1]=R.y,db[Za+2]=R.z,db[Za+3]=S.x,db[Za+4]=S.y,db[Za+5]=S.z,db[Za+6]=P.x,db[Za+7]=P.y,db[Za+8]=P.z,db[Za+9]=ba.x,db[Za+10]=ba.y,db[Za+11]=ba.z,Za+=12;k.bindBuffer(k.ARRAY_BUFFER,C.__webglVertexBuffer);
|
|
@@ -477,25 +478,25 @@ S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[
|
|
|
15]=ba.w,x+=16}else if("faces"===u.boundTo){E=0;for(D=sa.length;E<D;E++)P=S=R=Aa=u.value[sa[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)ba=P=S=R=Aa=u.value[ta[E]],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+
|
|
|
8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,u.array[x+12]=ba.x,u.array[x+13]=ba.y,u.array[x+14]=ba.z,u.array[x+15]=ba.w,x+=16}else if("faceVertices"===u.boundTo){E=0;for(D=sa.length;E<D;E++)Aa=u.value[sa[E]],R=Aa[0],S=Aa[1],P=Aa[2],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,x+=12;E=0;for(D=ta.length;E<D;E++)Aa=u.value[ta[E]],
|
|
|
R=Aa[0],S=Aa[1],P=Aa[2],ba=Aa[3],u.array[x]=R.x,u.array[x+1]=R.y,u.array[x+2]=R.z,u.array[x+3]=R.w,u.array[x+4]=S.x,u.array[x+5]=S.y,u.array[x+6]=S.z,u.array[x+7]=S.w,u.array[x+8]=P.x,u.array[x+9]=P.y,u.array[x+10]=P.z,u.array[x+11]=P.w,u.array[x+12]=ba.x,u.array[x+13]=ba.y,u.array[x+14]=ba.z,u.array[x+15]=ba.w,x+=16}k.bindBuffer(k.ARRAY_BUFFER,u.buffer);k.bufferData(k.ARRAY_BUFFER,u.array,H)}}I&&(delete C.__inittedArrays,delete C.__colorArray,delete C.__normalArray,delete C.__tangentArray,delete C.__uvArray,
|
|
|
-delete C.__uv2Array,delete C.__faceArray,delete C.__vertexArray,delete C.__lineArray,delete C.__skinIndexArray,delete C.__skinWeightArray)}}j.verticesNeedUpdate=!1;j.morphTargetsNeedUpdate=!1;j.elementsNeedUpdate=!1;j.uvsNeedUpdate=!1;j.normalsNeedUpdate=!1;j.colorsNeedUpdate=!1;j.tangentsNeedUpdate=!1;j.buffersNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.Ribbon){n=e(i,j);m=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||j.normalsNeedUpdate||m){var Cb=j,Kb=k.DYNAMIC_DRAW,
|
|
|
+delete C.__uv2Array,delete C.__faceArray,delete C.__vertexArray,delete C.__lineArray,delete C.__skinIndexArray,delete C.__skinWeightArray)}}j.verticesNeedUpdate=!1;j.morphTargetsNeedUpdate=!1;j.elementsNeedUpdate=!1;j.uvsNeedUpdate=!1;j.normalsNeedUpdate=!1;j.colorsNeedUpdate=!1;j.tangentsNeedUpdate=!1;j.buffersNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.Ribbon){n=e(i,j);p=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||j.normalsNeedUpdate||p){var Cb=j,Kb=k.DYNAMIC_DRAW,
|
|
|
nc=void 0,oc=void 0,pc=void 0,Tb=void 0,Ba=void 0,Ub=void 0,xc=void 0,yc=void 0,jc=void 0,gb=void 0,gc=void 0,Ia=void 0,rb=void 0,kc=Cb.vertices,lc=Cb.colors,mc=Cb.normals,uc=kc.length,vc=lc.length,Yc=mc.length,zc=Cb.__vertexArray,Ac=Cb.__colorArray,Bc=Cb.__normalArray,Zc=Cb.colorsNeedUpdate,$c=Cb.normalsNeedUpdate,Lc=Cb.__webglCustomAttributesList;if(Cb.verticesNeedUpdate){for(nc=0;nc<uc;nc++)Tb=kc[nc],Ba=3*nc,zc[Ba]=Tb.x,zc[Ba+1]=Tb.y,zc[Ba+2]=Tb.z;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglVertexBuffer);
|
|
|
k.bufferData(k.ARRAY_BUFFER,zc,Kb)}if(Zc){for(oc=0;oc<vc;oc++)Ub=lc[oc],Ba=3*oc,Ac[Ba]=Ub.r,Ac[Ba+1]=Ub.g,Ac[Ba+2]=Ub.b;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglColorBuffer);k.bufferData(k.ARRAY_BUFFER,Ac,Kb)}if($c){for(pc=0;pc<Yc;pc++)xc=mc[pc],Ba=3*pc,Bc[Ba]=xc.x,Bc[Ba+1]=xc.y,Bc[Ba+2]=xc.z;k.bindBuffer(k.ARRAY_BUFFER,Cb.__webglNormalBuffer);k.bufferData(k.ARRAY_BUFFER,Bc,Kb)}if(Lc){yc=0;for(jc=Lc.length;yc<jc;yc++)if(Ia=Lc[yc],Ia.needsUpdate&&(void 0===Ia.boundTo||"vertices"===Ia.boundTo)){Ba=0;gc=
|
|
|
Ia.value.length;if(1===Ia.size)for(gb=0;gb<gc;gb++)Ia.array[gb]=Ia.value[gb];else if(2===Ia.size)for(gb=0;gb<gc;gb++)rb=Ia.value[gb],Ia.array[Ba]=rb.x,Ia.array[Ba+1]=rb.y,Ba+=2;else if(3===Ia.size)if("c"===Ia.type)for(gb=0;gb<gc;gb++)rb=Ia.value[gb],Ia.array[Ba]=rb.r,Ia.array[Ba+1]=rb.g,Ia.array[Ba+2]=rb.b,Ba+=3;else for(gb=0;gb<gc;gb++)rb=Ia.value[gb],Ia.array[Ba]=rb.x,Ia.array[Ba+1]=rb.y,Ia.array[Ba+2]=rb.z,Ba+=3;else if(4===Ia.size)for(gb=0;gb<gc;gb++)rb=Ia.value[gb],Ia.array[Ba]=rb.x,Ia.array[Ba+
|
|
|
-1]=rb.y,Ia.array[Ba+2]=rb.z,Ia.array[Ba+3]=rb.w,Ba+=4;k.bindBuffer(k.ARRAY_BUFFER,Ia.buffer);k.bufferData(k.ARRAY_BUFFER,Ia.array,Kb)}}}j.verticesNeedUpdate=!1;j.colorsNeedUpdate=!1;j.normalsNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.Line){n=e(i,j);m=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||j.lineDistancesNeedUpdate||m){var Db=j,Cc=k.DYNAMIC_DRAW,qc=void 0,rc=void 0,sc=void 0,Dc=void 0,Oa=void 0,Ec=void 0,Qc=Db.vertices,Rc=Db.colors,Sc=Db.lineDistances,ad=Qc.length,
|
|
|
+1]=rb.y,Ia.array[Ba+2]=rb.z,Ia.array[Ba+3]=rb.w,Ba+=4;k.bindBuffer(k.ARRAY_BUFFER,Ia.buffer);k.bufferData(k.ARRAY_BUFFER,Ia.array,Kb)}}}j.verticesNeedUpdate=!1;j.colorsNeedUpdate=!1;j.normalsNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.Line){n=e(i,j);p=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||j.lineDistancesNeedUpdate||p){var Db=j,Cc=k.DYNAMIC_DRAW,qc=void 0,rc=void 0,sc=void 0,Dc=void 0,Oa=void 0,Ec=void 0,Qc=Db.vertices,Rc=Db.colors,Sc=Db.lineDistances,ad=Qc.length,
|
|
|
bd=Rc.length,cd=Sc.length,Fc=Db.__vertexArray,Gc=Db.__colorArray,Tc=Db.__lineDistanceArray,dd=Db.colorsNeedUpdate,ed=Db.lineDistancesNeedUpdate,Mc=Db.__webglCustomAttributesList,Hc=void 0,Uc=void 0,hb=void 0,hc=void 0,sb=void 0,Ja=void 0;if(Db.verticesNeedUpdate){for(qc=0;qc<ad;qc++)Dc=Qc[qc],Oa=3*qc,Fc[Oa]=Dc.x,Fc[Oa+1]=Dc.y,Fc[Oa+2]=Dc.z;k.bindBuffer(k.ARRAY_BUFFER,Db.__webglVertexBuffer);k.bufferData(k.ARRAY_BUFFER,Fc,Cc)}if(dd){for(rc=0;rc<bd;rc++)Ec=Rc[rc],Oa=3*rc,Gc[Oa]=Ec.r,Gc[Oa+1]=Ec.g,Gc[Oa+
|
|
|
2]=Ec.b;k.bindBuffer(k.ARRAY_BUFFER,Db.__webglColorBuffer);k.bufferData(k.ARRAY_BUFFER,Gc,Cc)}if(ed){for(sc=0;sc<cd;sc++)Tc[sc]=Sc[sc];k.bindBuffer(k.ARRAY_BUFFER,Db.__webglLineDistanceBuffer);k.bufferData(k.ARRAY_BUFFER,Tc,Cc)}if(Mc){Hc=0;for(Uc=Mc.length;Hc<Uc;Hc++)if(Ja=Mc[Hc],Ja.needsUpdate&&(void 0===Ja.boundTo||"vertices"===Ja.boundTo)){Oa=0;hc=Ja.value.length;if(1===Ja.size)for(hb=0;hb<hc;hb++)Ja.array[hb]=Ja.value[hb];else if(2===Ja.size)for(hb=0;hb<hc;hb++)sb=Ja.value[hb],Ja.array[Oa]=sb.x,
|
|
|
Ja.array[Oa+1]=sb.y,Oa+=2;else if(3===Ja.size)if("c"===Ja.type)for(hb=0;hb<hc;hb++)sb=Ja.value[hb],Ja.array[Oa]=sb.r,Ja.array[Oa+1]=sb.g,Ja.array[Oa+2]=sb.b,Oa+=3;else for(hb=0;hb<hc;hb++)sb=Ja.value[hb],Ja.array[Oa]=sb.x,Ja.array[Oa+1]=sb.y,Ja.array[Oa+2]=sb.z,Oa+=3;else if(4===Ja.size)for(hb=0;hb<hc;hb++)sb=Ja.value[hb],Ja.array[Oa]=sb.x,Ja.array[Oa+1]=sb.y,Ja.array[Oa+2]=sb.z,Ja.array[Oa+3]=sb.w,Oa+=4;k.bindBuffer(k.ARRAY_BUFFER,Ja.buffer);k.bufferData(k.ARRAY_BUFFER,Ja.array,Cc)}}}j.verticesNeedUpdate=
|
|
|
-!1;j.colorsNeedUpdate=!1;j.lineDistancesNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.ParticleSystem){n=e(i,j);m=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||i.sortParticles||m){var Nb=j,Nc=k.DYNAMIC_DRAW,tc=i,tb=void 0,Ob=void 0,Pb=void 0,ca=void 0,Qb=void 0,bc=void 0,Ic=Nb.vertices,Oc=Ic.length,Pc=Nb.colors,Vc=Pc.length,ec=Nb.__vertexArray,fc=Nb.__colorArray,Vb=Nb.__sortArray,Wc=Nb.verticesNeedUpdate,Xc=Nb.colorsNeedUpdate,Wb=Nb.__webglCustomAttributesList,Eb=void 0,
|
|
|
+!1;j.colorsNeedUpdate=!1;j.lineDistancesNeedUpdate=!1;n.attributes&&s(n)}else if(i instanceof THREE.ParticleSystem){n=e(i,j);p=n.attributes&&r(n);if(j.verticesNeedUpdate||j.colorsNeedUpdate||i.sortParticles||p){var Nb=j,Nc=k.DYNAMIC_DRAW,tc=i,tb=void 0,Ob=void 0,Pb=void 0,ca=void 0,Qb=void 0,bc=void 0,Ic=Nb.vertices,Oc=Ic.length,Pc=Nb.colors,Vc=Pc.length,ec=Nb.__vertexArray,fc=Nb.__colorArray,Vb=Nb.__sortArray,Wc=Nb.verticesNeedUpdate,Xc=Nb.colorsNeedUpdate,Wb=Nb.__webglCustomAttributesList,Eb=void 0,
|
|
|
ic=void 0,ja=void 0,Fb=void 0,Ea=void 0,$=void 0;if(tc.sortParticles){lb.copy(xb);lb.multiply(tc.matrixWorld);for(tb=0;tb<Oc;tb++)Pb=Ic[tb],Ga.copy(Pb),Ga.applyProjection(lb),Vb[tb]=[Ga.z,tb];Vb.sort(l);for(tb=0;tb<Oc;tb++)Pb=Ic[Vb[tb][1]],ca=3*tb,ec[ca]=Pb.x,ec[ca+1]=Pb.y,ec[ca+2]=Pb.z;for(Ob=0;Ob<Vc;Ob++)ca=3*Ob,bc=Pc[Vb[Ob][1]],fc[ca]=bc.r,fc[ca+1]=bc.g,fc[ca+2]=bc.b;if(Wb){Eb=0;for(ic=Wb.length;Eb<ic;Eb++)if($=Wb[Eb],void 0===$.boundTo||"vertices"===$.boundTo)if(ca=0,Fb=$.value.length,1===$.size)for(ja=
|
|
|
0;ja<Fb;ja++)Qb=Vb[ja][1],$.array[ja]=$.value[Qb];else if(2===$.size)for(ja=0;ja<Fb;ja++)Qb=Vb[ja][1],Ea=$.value[Qb],$.array[ca]=Ea.x,$.array[ca+1]=Ea.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ja=0;ja<Fb;ja++)Qb=Vb[ja][1],Ea=$.value[Qb],$.array[ca]=Ea.r,$.array[ca+1]=Ea.g,$.array[ca+2]=Ea.b,ca+=3;else for(ja=0;ja<Fb;ja++)Qb=Vb[ja][1],Ea=$.value[Qb],$.array[ca]=Ea.x,$.array[ca+1]=Ea.y,$.array[ca+2]=Ea.z,ca+=3;else if(4===$.size)for(ja=0;ja<Fb;ja++)Qb=Vb[ja][1],Ea=$.value[Qb],$.array[ca]=Ea.x,
|
|
|
$.array[ca+1]=Ea.y,$.array[ca+2]=Ea.z,$.array[ca+3]=Ea.w,ca+=4}}else{if(Wc)for(tb=0;tb<Oc;tb++)Pb=Ic[tb],ca=3*tb,ec[ca]=Pb.x,ec[ca+1]=Pb.y,ec[ca+2]=Pb.z;if(Xc)for(Ob=0;Ob<Vc;Ob++)bc=Pc[Ob],ca=3*Ob,fc[ca]=bc.r,fc[ca+1]=bc.g,fc[ca+2]=bc.b;if(Wb){Eb=0;for(ic=Wb.length;Eb<ic;Eb++)if($=Wb[Eb],$.needsUpdate&&(void 0===$.boundTo||"vertices"===$.boundTo))if(Fb=$.value.length,ca=0,1===$.size)for(ja=0;ja<Fb;ja++)$.array[ja]=$.value[ja];else if(2===$.size)for(ja=0;ja<Fb;ja++)Ea=$.value[ja],$.array[ca]=Ea.x,
|
|
|
$.array[ca+1]=Ea.y,ca+=2;else if(3===$.size)if("c"===$.type)for(ja=0;ja<Fb;ja++)Ea=$.value[ja],$.array[ca]=Ea.r,$.array[ca+1]=Ea.g,$.array[ca+2]=Ea.b,ca+=3;else for(ja=0;ja<Fb;ja++)Ea=$.value[ja],$.array[ca]=Ea.x,$.array[ca+1]=Ea.y,$.array[ca+2]=Ea.z,ca+=3;else if(4===$.size)for(ja=0;ja<Fb;ja++)Ea=$.value[ja],$.array[ca]=Ea.x,$.array[ca+1]=Ea.y,$.array[ca+2]=Ea.z,$.array[ca+3]=Ea.w,ca+=4}}if(Wc||tc.sortParticles)k.bindBuffer(k.ARRAY_BUFFER,Nb.__webglVertexBuffer),k.bufferData(k.ARRAY_BUFFER,ec,Nc);
|
|
|
-if(Xc||tc.sortParticles)k.bindBuffer(k.ARRAY_BUFFER,Nb.__webglColorBuffer),k.bufferData(k.ARRAY_BUFFER,fc,Nc);if(Wb){Eb=0;for(ic=Wb.length;Eb<ic;Eb++)if($=Wb[Eb],$.needsUpdate||tc.sortParticles)k.bindBuffer(k.ARRAY_BUFFER,$.buffer),k.bufferData(k.ARRAY_BUFFER,$.array,Nc)}}j.verticesNeedUpdate=!1;j.colorsNeedUpdate=!1;n.attributes&&s(n)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",uc);var i,j,l,p,m;a instanceof THREE.MeshDepthMaterial?m="depth":a instanceof THREE.MeshNormalMaterial?
|
|
|
-m="normal":a instanceof THREE.MeshBasicMaterial?m="basic":a instanceof THREE.MeshLambertMaterial?m="lambert":a instanceof THREE.MeshPhongMaterial?m="phong":a instanceof THREE.LineBasicMaterial?m="basic":a instanceof THREE.LineDashedMaterial?m="dashed":a instanceof THREE.ParticleBasicMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var q,r,s;e=h=r=s=n=0;for(f=b.length;e<f;e++)q=
|
|
|
-b[e],q.onlyShadow||(q instanceof THREE.DirectionalLight&&h++,q instanceof THREE.PointLight&&r++,q instanceof THREE.SpotLight&&s++,q instanceof THREE.HemisphereLight&&n++);e=h;f=r;h=s;g=n;n=q=0;for(s=b.length;n<s;n++)r=b[n],r.castShadow&&(r instanceof THREE.SpotLight&&q++,r instanceof THREE.DirectionalLight&&!r.shadowCascade&&q++);p=q;Bb&&d&&d.useVertexTexture?l=1024:(b=k.getParameter(k.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,
|
|
|
+if(Xc||tc.sortParticles)k.bindBuffer(k.ARRAY_BUFFER,Nb.__webglColorBuffer),k.bufferData(k.ARRAY_BUFFER,fc,Nc);if(Wb){Eb=0;for(ic=Wb.length;Eb<ic;Eb++)if($=Wb[Eb],$.needsUpdate||tc.sortParticles)k.bindBuffer(k.ARRAY_BUFFER,$.buffer),k.bufferData(k.ARRAY_BUFFER,$.array,Nc)}}j.verticesNeedUpdate=!1;j.colorsNeedUpdate=!1;n.attributes&&s(n)}}};this.initMaterial=function(a,b,c,d){var e,f,h,g;a.addEventListener("dispose",uc);var i,j,l,m,p;a instanceof THREE.MeshDepthMaterial?p="depth":a instanceof THREE.MeshNormalMaterial?
|
|
|
+p="normal":a instanceof THREE.MeshBasicMaterial?p="basic":a instanceof THREE.MeshLambertMaterial?p="lambert":a instanceof THREE.MeshPhongMaterial?p="phong":a instanceof THREE.LineBasicMaterial?p="basic":a instanceof THREE.LineDashedMaterial?p="dashed":a instanceof THREE.ParticleBasicMaterial&&(p="particle_basic");if(p){var n=THREE.ShaderLib[p];a.uniforms=THREE.UniformsUtils.clone(n.uniforms);a.vertexShader=n.vertexShader;a.fragmentShader=n.fragmentShader}var q,r,s;e=h=r=s=n=0;for(f=b.length;e<f;e++)q=
|
|
|
+b[e],q.onlyShadow||(q instanceof THREE.DirectionalLight&&h++,q instanceof THREE.PointLight&&r++,q instanceof THREE.SpotLight&&s++,q instanceof THREE.HemisphereLight&&n++);e=h;f=r;h=s;g=n;n=q=0;for(s=b.length;n<s;n++)r=b[n],r.castShadow&&(r instanceof THREE.SpotLight&&q++,r instanceof THREE.DirectionalLight&&!r.shadowCascade&&q++);m=q;Bb&&d&&d.useVertexTexture?l=1024:(b=k.getParameter(k.MAX_VERTEX_UNIFORM_VECTORS),b=Math.floor((b-20)/4),void 0!==d&&d instanceof THREE.SkinnedMesh&&(b=Math.min(d.bones.length,
|
|
|
b),b<d.bones.length&&console.warn("WebGLRenderer: too many bones - "+d.bones.length+", this GPU supports just "+b+" (try OpenGL instead of ANGLE)")),l=b);a:{s=a.fragmentShader;r=a.vertexShader;n=a.uniforms;b=a.attributes;q=a.defines;var c={map:!!a.map,envMap:!!a.envMap,lightMap:!!a.lightMap,bumpMap:!!a.bumpMap,normalMap:!!a.normalMap,specularMap:!!a.specularMap,vertexColors:a.vertexColors,fog:c,useFog:a.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:a.sizeAttenuation,skinning:a.skinning,maxBones:l,
|
|
|
-useVertexTexture:Bb&&d&&d.useVertexTexture,boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:p,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,
|
|
|
-metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},t,v,w,d=[];m?d.push(m):(d.push(s),d.push(r));for(v in q)d.push(v),d.push(q[v]);for(t in c)d.push(t),d.push(c[t]);m=d.join();t=0;for(v=V.length;t<v;t++)if(d=V[t],d.code===m){d.usedTimes++;j=d.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");v=[];for(w in q)d=
|
|
|
+useVertexTexture:Bb&&d&&d.useVertexTexture,boneTextureWidth:d&&d.boneTextureWidth,boneTextureHeight:d&&d.boneTextureHeight,morphTargets:a.morphTargets,morphNormals:a.morphNormals,maxMorphTargets:this.maxMorphTargets,maxMorphNormals:this.maxMorphNormals,maxDirLights:e,maxPointLights:f,maxSpotLights:h,maxHemiLights:g,maxShadows:m,shadowMapEnabled:this.shadowMapEnabled&&d.receiveShadow,shadowMapType:this.shadowMapType,shadowMapDebug:this.shadowMapDebug,shadowMapCascade:this.shadowMapCascade,alphaTest:a.alphaTest,
|
|
|
+metal:a.metal,perPixel:a.perPixel,wrapAround:a.wrapAround,doubleSided:a.side===THREE.DoubleSide,flipSided:a.side===THREE.BackSide},t,v,w,d=[];p?d.push(p):(d.push(s),d.push(r));for(v in q)d.push(v),d.push(q[v]);for(t in c)d.push(t),d.push(c[t]);p=d.join();t=0;for(v=V.length;t<v;t++)if(d=V[t],d.code===p){d.usedTimes++;j=d.program;break a}t="SHADOWMAP_TYPE_BASIC";c.shadowMapType===THREE.PCFShadowMap?t="SHADOWMAP_TYPE_PCF":c.shadowMapType===THREE.PCFSoftShadowMap&&(t="SHADOWMAP_TYPE_PCF_SOFT");v=[];for(w in q)d=
|
|
|
q[w],!1!==d&&(d="#define "+w+" "+d,v.push(d));d=v.join("\n");w=k.createProgram();v=["precision "+L+" float;",d,Gb?"#define VERTEX_TEXTURES":"",D.gammaInput?"#define GAMMA_INPUT":"",D.gammaOutput?"#define GAMMA_OUTPUT":"",D.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_HEMI_LIGHTS "+c.maxHemiLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+
|
|
|
c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.boneTextureWidth?"#define N_BONE_PIXEL_X "+c.boneTextureWidth.toFixed(1):"",c.boneTextureHeight?"#define N_BONE_PIXEL_Y "+c.boneTextureHeight.toFixed(1):"",
|
|
|
c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n");
|
|
@@ -503,7 +504,7 @@ t=["precision "+L+" float;",c.bumpMap||c.normalMap?"#extension GL_OES_standard_d
|
|
|
c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":
|
|
|
"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+t:"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n");v=J("vertex",v+r);t=J("fragment",t+s);k.attachShader(w,v);k.attachShader(w,t);k.linkProgram(w);k.getProgramParameter(w,k.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+k.getProgramParameter(w,k.VALIDATE_STATUS)+", gl error ["+
|
|
|
k.getError()+"]");k.deleteShader(t);k.deleteShader(v);w.uniforms={};w.attributes={};var z;t="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences".split(" ");c.useVertexTexture?t.push("boneTexture"):t.push("boneGlobalMatrices");for(z in n)t.push(z);z=t;t=0;for(v=z.length;t<v;t++)n=z[t],w.uniforms[n]=k.getUniformLocation(w,n);t="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(z=0;z<c.maxMorphTargets;z++)t.push("morphTarget"+
|
|
|
-z);for(z=0;z<c.maxMorphNormals;z++)t.push("morphNormal"+z);for(j in b)t.push(j);j=t;z=0;for(b=j.length;z<b;z++)t=j[z],w.attributes[t]=k.getAttribLocation(w,t);w.id=ea++;V.push({program:w,code:m,usedTimes:1});D.info.memory.programs=V.length;j=w}a.program=j;z=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(j=0;j<this.maxMorphTargets;j++)w=b+j,0<=z[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(j=0;j<this.maxMorphNormals;j++)w=
|
|
|
+z);for(z=0;z<c.maxMorphNormals;z++)t.push("morphNormal"+z);for(j in b)t.push(j);j=t;z=0;for(b=j.length;z<b;z++)t=j[z],w.attributes[t]=k.getAttribLocation(w,t);w.id=ea++;V.push({program:w,code:p,usedTimes:1});D.info.memory.programs=V.length;j=w}a.program=j;z=a.program.attributes;if(a.morphTargets){a.numSupportedMorphTargets=0;b="morphTarget";for(j=0;j<this.maxMorphTargets;j++)w=b+j,0<=z[w]&&a.numSupportedMorphTargets++}if(a.morphNormals){a.numSupportedMorphNormals=0;b="morphNormal";for(j=0;j<this.maxMorphNormals;j++)w=
|
|
|
b+j,0<=z[w]&&a.numSupportedMorphNormals++}a.uniformsList=[];for(i in a.uniforms)a.uniformsList.push([a.uniforms[i],i])};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?k.disable(k.CULL_FACE):(b===THREE.FrontFaceDirectionCW?k.frontFace(k.CW):k.frontFace(k.CCW),a===THREE.CullFaceBack?k.cullFace(k.BACK):a===THREE.CullFaceFront?k.cullFace(k.FRONT):k.cullFace(k.FRONT_AND_BACK),k.enable(k.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide,a=a.side===THREE.BackSide;da!==
|
|
|
b&&(b?k.disable(k.CULL_FACE):k.enable(k.CULL_FACE),da=b);T!==a&&(a?k.frontFace(k.CW):k.frontFace(k.CCW),T=a)};this.setDepthTest=function(a){xa!==a&&(a?k.enable(k.DEPTH_TEST):k.disable(k.DEPTH_TEST),xa=a)};this.setDepthWrite=function(a){bb!==a&&(k.depthMask(a),bb=a)};this.setBlending=function(a,b,c,d){a!==aa&&(a===THREE.NoBlending?k.disable(k.BLEND):a===THREE.AdditiveBlending?(k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.SRC_ALPHA,k.ONE)):a===THREE.SubtractiveBlending?(k.enable(k.BLEND),
|
|
|
k.blendEquation(k.FUNC_ADD),k.blendFunc(k.ZERO,k.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(k.enable(k.BLEND),k.blendEquation(k.FUNC_ADD),k.blendFunc(k.ZERO,k.SRC_COLOR)):a===THREE.CustomBlending?k.enable(k.BLEND):(k.enable(k.BLEND),k.blendEquationSeparate(k.FUNC_ADD,k.FUNC_ADD),k.blendFuncSeparate(k.SRC_ALPHA,k.ONE_MINUS_SRC_ALPHA,k.ONE,k.ONE_MINUS_SRC_ALPHA)),aa=a);if(a===THREE.CustomBlending){if(b!==la&&(k.blendEquation(w(b)),la=b),c!==Y||d!==ma)k.blendFunc(w(c),w(d)),Y=c,ma=d}else ma=Y=
|
|
@@ -590,7 +591,7 @@ j;)h=g,g=this.getNextKeyWith(c,p,g.index+1)}else{this.stop();return}else{do h=g,
|
|
|
this.target.set(d[0],d[1],d[2]),this.target.sub(c),this.target.y=0,this.target.normalize(),d=Math.atan2(this.target.x,this.target.z),a.rotation.set(0,d,0))}else"rot"===c?THREE.Quaternion.slerp(e,f,a.quaternion,d):"scl"===c&&(c=a.scale,c.x=e[0]+(f[0]-e[0])*d,c.y=e[1]+(f[1]-e[1])*d,c.z=e[2]+(f[2]-e[2])*d)}}}};
|
|
|
THREE.Animation.prototype.interpolateCatmullRom=function(a,b){var c=[],d=[],e,f,h,g,i,j;e=(a.length-1)*b;f=Math.floor(e);e-=f;c[0]=0===f?f:f-1;c[1]=f;c[2]=f>a.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];g=a[c[1]];i=a[c[2]];j=a[c[3]];c=e*e;h=e*c;d[0]=this.interpolate(f[0],g[0],i[0],j[0],e,c,h);d[1]=this.interpolate(f[1],g[1],i[1],j[1],e,c,h);d[2]=this.interpolate(f[2],g[2],i[2],j[2],e,c,h);return d};
|
|
|
THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,h){a=0.5*(c-a);d=0.5*(d-b);return(2*(b-c)+a+d)*h+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c<d.length-1?c:d.length-1:c%d.length;c<d.length;c++)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[0]};
|
|
|
-THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.0010;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],h=this.getNextKeyWith(f,a,0);h&&h.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
|
|
|
+THREE.Animation.prototype.getPrevKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<c?c:0:0<=c?c:c+d.length;0<=c;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]};THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=!1;this.loop=this.isPaused=!0;this.JITCompile=void 0!==c?c:!0;a=0;for(b=this.hierarchy.length;a<b;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;e<c.length;e++){var f=c[e],h=this.getNextKeyWith(f,a,0);h&&h.apply(f)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
|
|
|
d.matrixWorldNeedsUpdate=!0}}};
|
|
|
THREE.KeyFrameAnimation.prototype.play=function(a,b){if(!this.isPlaying){this.isPlaying=!0;this.loop=void 0!==a?a:!0;this.currentTime=void 0!==b?b:0;this.startTimeMs=b;this.startTime=1E7;this.endTime=-this.startTime;var c,d=this.hierarchy.length,e,f;for(c=0;c<d;c++)e=this.hierarchy[c],f=this.data.hierarchy[c],e.useQuaternion=!0,void 0===f.animationCache&&(f.animationCache={},f.animationCache.prevKey=null,f.animationCache.nextKey=null,f.animationCache.originalMatrix=e instanceof THREE.Bone?e.skinMatrix:
|
|
|
e.matrix),e=this.data.hierarchy[c].keys,e.length&&(f.animationCache.prevKey=e[0],f.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime));this.update(0)}this.isPaused=!1;THREE.AnimationHandler.addToUpdate(this)};THREE.KeyFrameAnimation.prototype.pause=function(){this.isPaused?THREE.AnimationHandler.addToUpdate(this):THREE.AnimationHandler.removeFromUpdate(this);this.isPaused=!this.isPaused};
|
|
@@ -615,7 +616,7 @@ t,n,r,[s,v,z,G]));this.faceVertexUvs[0].push([C,H,I,F])}}if(!1===f&&0<a){this.ve
|
|
|
t=j[i][g],n=this.vertices.length-1,s=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),C=l[i][g+1].clone(),H=l[i][g].clone(),I=new THREE.Vector2(H.u,1),this.faces.push(new THREE.Face3(q,t,n,[s,v,z])),this.faceVertexUvs[0].push([C,H,I])}this.computeCentroids();this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),a=a instanceof Array?a:[a],this.shapebb=a[a.length-1].getBoundingBox(),this.addShapeList(a,b),this.computeCentroids(),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
|
|
|
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeometry.__v2,f=THREE.ExtrudeGeometry.__v3,g=THREE.ExtrudeGeometry.__v4,h=THREE.ExtrudeGeometry.__v5,i=THREE.ExtrudeGeometry.__v6;d.set(a.x-b.x,a.y-b.y);e.set(a.x-c.x,a.y-c.y);d=d.normalize();e=e.normalize();f.set(-d.y,d.x);g.set(e.y,-e.x);h.copy(a).add(f);i.copy(a).add(g);if(h.equals(i))return g.clone();
|
|
|
h.copy(b).add(f);i.copy(c).add(g);f=d.dot(g);g=i.sub(h).dot(g);0===f&&(console.log("Either infinite or no solutions!"),0===g?console.log("Its finite solutions."):console.log("Too bad, no solutions."));g/=f;return 0>g?(b=Math.atan2(b.y-a.y,b.x-a.x),a=Math.atan2(c.y-a.y,c.x-a.x),b>a&&(a+=2*Math.PI),c=(b+a)/2,a=-Math.cos(c),c=-Math.sin(c),new THREE.Vector2(a,c)):d.multiplyScalar(g).add(h).sub(a).clone()}function e(c,d){var e,f;for(O=c.length;0<=--O;){e=O;f=O-1;0>f&&(f=c.length-1);for(var g=0,h=q+2*l,
|
|
|
-g=0;g<h;g++){var i=oa*g,j=oa*(g+1),p=d+e+i,i=d+f+i,m=d+f+j,j=d+e+j,n=c,r=g,s=h,t=e,w=f,p=p+J,i=i+J,m=m+J,j=j+J;B.faces.push(new THREE.Face4(p,i,m,j,null,null,v));p=z.generateSideWallUV(B,a,n,b,p,i,m,j,r,s,t,w);B.faceVertexUvs[0].push(p)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=J;d+=J;e+=J;B.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?z.generateBottomUV(B,a,b,c,d,e):z.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
|
|
|
+g=0;g<h;g++){var i=oa*g,j=oa*(g+1),m=d+e+i,i=d+f+i,p=d+f+j,j=d+e+j,n=c,r=g,s=h,t=e,w=f,m=m+J,i=i+J,p=p+J,j=j+J;B.faces.push(new THREE.Face4(m,i,p,j,null,null,v));m=z.generateSideWallUV(B,a,n,b,m,i,p,j,r,s,t,w);B.faceVertexUvs[0].push(m)}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function h(c,d,e,f){c+=J;d+=J;e+=J;B.faces.push(new THREE.Face3(c,d,e,null,null,s));c=f?z.generateBottomUV(B,a,b,c,d,e):z.generateTopUV(B,a,b,c,d,e);B.faceVertexUvs[0].push(c)}var g=void 0!==b.amount?b.amount:
|
|
|
100,i=void 0!==b.bevelThickness?b.bevelThickness:6,j=void 0!==b.bevelSize?b.bevelSize:i-2,l=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,n,r=!1,s=b.material,v=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,G,C,H,I;t&&(n=t.getSpacedPoints(q),r=!0,p=!1,G=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,
|
|
|
!1),C=new THREE.Vector3,H=new THREE.Vector3,I=new THREE.Vector3);p||(j=i=l=0);var F,A,K,B=this,J=this.vertices.length,m=a.extractPoints(m),N=m.shape,m=m.holes;if(t=!THREE.Shape.Utils.isClockWise(N)){N=N.reverse();A=0;for(K=m.length;A<K;A++)F=m[A],THREE.Shape.Utils.isClockWise(F)&&(m[A]=F.reverse());t=!1}var y=THREE.Shape.Utils.triangulateShape(N,m),t=N;A=0;for(K=m.length;A<K;A++)F=m[A],N=N.concat(F);var M,w,Z,L,oa=N.length,Pa=y.length,Va=[],O=0,qa=t.length;M=qa-1;for(w=O+1;O<qa;O++,M++,w++)M===qa&&
|
|
|
(M=0),w===qa&&(w=0),Va[O]=d(t[O],t[M],t[w]);var Fa=[],wa,D=Va.concat();A=0;for(K=m.length;A<K;A++){F=m[A];wa=[];O=0;qa=F.length;M=qa-1;for(w=O+1;O<qa;O++,M++,w++)M===qa&&(M=0),w===qa&&(w=0),wa[O]=d(F[O],F[M],F[w]);Fa.push(wa);D=D.concat(wa)}for(M=0;M<l;M++){F=M/l;Z=i*(1-F);w=j*Math.sin(F*Math.PI/2);O=0;for(qa=t.length;O<qa;O++)L=c(t[O],Va[O],w),f(L.x,L.y,-Z);A=0;for(K=m.length;A<K;A++){F=m[A];wa=Fa[A];O=0;for(qa=F.length;O<qa;O++)L=c(F[O],wa[O],w),f(L.x,L.y,-Z)}}w=j;for(O=0;O<oa;O++)L=p?c(N[O],D[O],
|
|
@@ -651,20 +652,22 @@ THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);THREE.ArrowHelper
|
|
|
this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(a);this.setLength(c)};THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){0.999<c.y?this.quaternion.set(0,0,0,1):-0.999>c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();THREE.ArrowHelper.prototype.setLength=function(a){this.scale.set(a,a,a)};
|
|
|
THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.setHex(a);this.cone.material.color.setHex(a)};THREE.BoxHelper=function(a){var b=[new THREE.Vector3(1,1,1),new THREE.Vector3(-1,1,1),new THREE.Vector3(-1,-1,1),new THREE.Vector3(1,-1,1),new THREE.Vector3(1,1,-1),new THREE.Vector3(-1,1,-1),new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,-1,-1)];this.vertices=b;var c=new THREE.Geometry;c.vertices.push(b[0],b[1],b[1],b[2],b[2],b[3],b[3],b[0],b[4],b[5],b[5],b[6],b[6],b[7],b[7],b[4],b[0],b[4],b[1],b[5],b[2],b[6],b[3],b[7]);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);
|
|
|
void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
-THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.vertices;d[0].set(b.x,b.y,b.z);d[1].set(c.x,b.y,b.z);d[2].set(c.x,c.y,b.z);d[3].set(b.x,c.y,b.z);d[4].set(b.x,b.y,c.z);d[5].set(c.x,b.y,c.z);d[6].set(c.x,c.y,c.z);d[7].set(b.x,c.y,c.z);this.geometry.computeBoundingSphere();this.geometry.verticesNeedUpdate=!0;this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}THREE.Line.call(this);var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);
|
|
|
+THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.vertices;d[0].set(b.x,b.y,b.z);d[1].set(c.x,b.y,b.z);d[2].set(c.x,c.y,b.z);d[3].set(b.x,c.y,b.z);d[4].set(b.x,b.y,c.z);d[5].set(c.x,b.y,c.z);d[6].set(c.x,c.y,c.z);d[7].set(b.x,c.y,c.z);this.geometry.computeBoundingSphere();this.geometry.verticesNeedUpdate=!0;this.matrixAutoUpdate=!1;this.matrixWorld=a.matrixWorld};THREE.BoundingBoxHelper=function(a,b){var c=b||8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.CubeGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.update=function(){this.object.computeBoundingBox();this.object.boundingBox.size(this.scale);this.object.boundingBox.center(this.position)};THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}THREE.Line.call(this);var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);
|
|
|
b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};
|
|
|
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;h<g;h++)e.geometry.vertices[d[h]].copy(a)}}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d("c",0,0,-1);d("t",0,0,1);d("n1",-1,-1,-1);d("n2",1,-1,-1);d("n3",-1,1,-1);d("n4",1,1,-1);d("f1",-1,-1,1);d("f2",1,-1,1);d("f3",-1,1,1);d("f4",1,1,1);d("u1",
|
|
|
0.7,1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.light=a;var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightSphere=new THREE.Mesh(c,d);this.lightSphere.matrixWorld=this.light.matrixWorld;this.lightSphere.matrixAutoUpdate=!1;this.add(this.lightSphere);c=new THREE.Geometry;c.vertices.push(this.light.position);c.vertices.push(this.light.target.position);
|
|
|
c.computeLineDistances();d=new THREE.LineDashedMaterial({dashSize:4,gapSize:4,opacity:0.75,transparent:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine)};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
-THREE.DirectionalLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.computeLineDistances();this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.FaceNormalsHelper=function(a,b,c){this.object=a;this.size=b||1;for(var a=c||255,b=new THREE.Geometry,c=0,d=this.object.geometry.faces.length;c<d;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
-THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var b=this.geometry.vertices,c=this.object.geometry.faces,d=0,e=c.length;d<e;d++){var f=c[d];a.copy(f.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var h=2*d;b[h].copy(f.centroid).applyMatrix4(this.object.matrixWorld);b[h+1].addVectors(b[h],a)}this.geometry.verticesNeedUpdate=!0;
|
|
|
-return this}}();THREE.GridHelper=function(a,b){for(var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),e=new THREE.Color(4473924),f=new THREE.Color(8947848),h=-a;h<=a;h+=b){c.vertices.push(new THREE.Vector3(-a,0,h),new THREE.Vector3(a,0,h),new THREE.Vector3(h,0,-a),new THREE.Vector3(h,0,a));var g=0===h?e:f;c.colors.push(g,g,g,g)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].materialIndex=4>d?0:1;d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(a.color).multiplyScalar(a.intensity);var e=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});e.color.copy(a.groundColor).multiplyScalar(a.intensity);this.lightSphere=new THREE.Mesh(c,new THREE.MeshFaceMaterial([d,
|
|
|
+THREE.DirectionalLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.computeLineDistances();this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var a=c||16776960,d=d||1,b=new THREE.Geometry,c=0,e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
+THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var b=this.geometry.vertices,c=this.object.geometry.faces,d=this.object.matrixWorld,e=0,f=c.length;e<f;e++){var h=c[e];a.copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var g=2*e;b[g].copy(h.centroid).applyMatrix4(d);b[g+1].addVectors(b[g],a)}this.geometry.verticesNeedUpdate=
|
|
|
+!0;return this}}();THREE.GridHelper=function(a,b){for(var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),e=new THREE.Color(4473924),f=new THREE.Color(8947848),h=-a;h<=a;h+=b){c.vertices.push(new THREE.Vector3(-a,0,h),new THREE.Vector3(a,0,h),new THREE.Vector3(h,0,-a),new THREE.Vector3(h,0,a));var g=0===h?e:f;c.colors.push(g,g,g,g)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].materialIndex=4>d?0:1;d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(a.color).multiplyScalar(a.intensity);var e=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});e.color.copy(a.groundColor).multiplyScalar(a.intensity);this.lightSphere=new THREE.Mesh(c,new THREE.MeshFaceMaterial([d,
|
|
|
e]));this.lightSphere.position=a.position;this.lightSphere.lookAt(new THREE.Vector3);this.add(this.lightSphere)};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.update=function(){this.lightSphere.lookAt(new THREE.Vector3);this.lightSphere.material.materials[0].color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightSphere.material.materials[1].color.copy(this.light.groundColor).multiplyScalar(this.light.intensity)};THREE.PointLightHelper=function(a,b){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.light=a;var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({fog:!1,wireframe:!0});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightSphere=new THREE.Mesh(c,d);this.lightSphere.matrixWorld=this.light.matrixWorld;this.lightSphere.matrixAutoUpdate=!1;this.add(this.lightSphere)};THREE.PointLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.PointLightHelper.prototype.update=function(){this.lightSphere.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};THREE.SpotLightHelper=function(a){this.light=a;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,opacity:0.3,transparent:!0});THREE.Mesh.call(this,a,b);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Mesh.prototype);
|
|
|
-THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=this.light.distance?this.light.distance:1E4,c=b*Math.tan(this.light.angle);this.scale.set(c,c,b);this.light.updateMatrixWorld(!0);this.position.getPositionFromMatrix(this.light.matrixWorld);this.light.target.updateMatrixWorld(!0);a.getPositionFromMatrix(this.light.target.matrixWorld);this.lookAt(a);this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();THREE.VertexNormalsHelper=function(a,b,c){this.object=a;this.size=b||1;for(var b=c||16711680,c=new THREE.Geometry,a=a.geometry.faces,d=0,e=a.length;d<e;d++)for(var f=0,h=a[d].vertexNormals.length;f<h;f++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
-THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=0,h=0,g=e.length;h<g;h++)for(var i=e[h],j=0,l=i.vertexNormals.length;j<l;j++){var p=i.vertexNormals[j];c[f].copy(d[i[b[j]]]).applyMatrix4(this.object.matrixWorld);a.copy(p).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
|
|
|
-a.add(c[f]);f+=1;c[f].copy(a);f+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a){for(var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c","d"],f=new THREE.Geometry,h=a.geometry.vertices,g=a.geometry.faces,i=0,j=g.length;i<j;i++)for(var l=g[i],p=l instanceof THREE.Face4?4:3,m=0;m<p;m++){b[0]=l[e[m]];b[1]=l[e[(m+1)%p]];b.sort(d);var q=b.toString();void 0===c[q]&&(f.vertices.push(h[b[0]]),f.vertices.push(h[b[1]]),c[q]=!0)}THREE.Line.call(this,f,new THREE.LineBasicMaterial({color:16777215}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=
|
|
|
+THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=this.light.distance?this.light.distance:1E4,c=b*Math.tan(this.light.angle);this.scale.set(c,c,b);this.light.updateMatrixWorld(!0);this.position.getPositionFromMatrix(this.light.matrixWorld);this.light.target.updateMatrixWorld(!0);a.getPositionFromMatrix(this.light.target.matrixWorld);this.lookAt(a);this.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<f;e++)for(var h=0,g=a[e].vertexNormals.length;h<g;h++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
+THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var j=e[g],l=0,p=j.vertexNormals.length;l<p;l++){var m=j.vertexNormals[l];c[h].copy(d[j[b[l]]]).applyMatrix4(f);a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
|
|
|
+a.add(c[h]);h+=1;c[h].copy(a);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var b=c||255,d=d||1,c=new THREE.Geometry,a=a.geometry.faces,e=0,f=a.length;e<f;e++)for(var h=0,g=a[e].vertexTangents.length;h<g;h++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
+THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){var b=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,h=0,g=0,i=e.length;g<i;g++)for(var j=e[g],l=0,p=j.vertexTangents.length;l<p;l++){var m=j.vertexTangents[l];c[h].copy(d[j[b[l]]]).applyMatrix4(f);a.copy(m).transformDirection(f).multiplyScalar(this.size);a.add(c[h]);h+=1;c[h].copy(a);
|
|
|
+h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();THREE.WireframeHelper=function(a){for(var b=[0,0],c={},d=function(a,b){return a-b},e=["a","b","c","d"],f=new THREE.Geometry,h=a.geometry.vertices,g=a.geometry.faces,i=0,j=g.length;i<j;i++)for(var l=g[i],p=l instanceof THREE.Face4?4:3,m=0;m<p;m++){b[0]=l[e[m]];b[1]=l[e[(m+1)%p]];b.sort(d);var q=b.toString();void 0===c[q]&&(f.vertices.push(h[b[0]]),f.vertices.push(h[b[1]]),c[q]=!0)}THREE.Line.call(this,f,new THREE.LineBasicMaterial({color:16777215}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.matrixWorld=
|
|
|
a.matrixWorld};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})};
|
|
|
THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a<b;a++)c=this.lensFlares[a],c.x=this.positionScreen.x+d*c.distance,c.y=this.positionScreen.y+e*c.distance,c.wantedRotation=0.25*c.x*Math.PI,c.rotation+=0.25*(c.wantedRotation-c.rotation)};THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);
|
|
@@ -681,8 +684,8 @@ b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.T
|
|
|
b.getUniformLocation(p,"opacity");q.color=b.getUniformLocation(p,"color");q.scale=b.getUniformLocation(p,"scale");q.rotation=b.getUniformLocation(p,"rotation");q.screenPosition=b.getUniformLocation(p,"screenPosition")};this.render=function(a,d,e,f){var a=a.__webglFlares,v=a.length;if(v){var z=new THREE.Vector3,G=f/e,C=0.5*e,H=0.5*f,I=16/f,F=new THREE.Vector2(I*G,I),A=new THREE.Vector3(1,1,0),K=new THREE.Vector2(1,1),B=q,I=m;b.useProgram(p);b.enableVertexAttribArray(m.vertex);b.enableVertexAttribArray(m.uv);
|
|
|
b.uniform1i(B.occlusionMap,0);b.uniform1i(B.map,1);b.bindBuffer(b.ARRAY_BUFFER,h);b.vertexAttribPointer(I.vertex,2,b.FLOAT,!1,16,0);b.vertexAttribPointer(I.uv,2,b.FLOAT,!1,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(!1);var J,N,y,M,w;for(J=0;J<v;J++)if(I=16/f,F.set(I*G,I),M=a[J],z.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),z.applyMatrix4(d.matrixWorldInverse),z.applyProjection(d.projectionMatrix),A.copy(z),K.x=A.x*C+C,
|
|
|
K.y=A.y*H+H,l||0<K.x&&K.x<e&&0<K.y&&K.y<f){b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGB,K.x-8,K.y-8,16,16,0);b.uniform1i(B.renderType,0);b.uniform2f(B.scale,F.x,F.y);b.uniform3f(B.screenPosition,A.x,A.y,A.z);b.disable(b.BLEND);b.enable(b.DEPTH_TEST);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,j);b.copyTexImage2D(b.TEXTURE_2D,0,b.RGBA,K.x-8,K.y-8,16,16,0);b.uniform1i(B.renderType,1);b.disable(b.DEPTH_TEST);
|
|
|
-b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);M.positionScreen.copy(A);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();b.uniform1i(B.renderType,2);b.enable(b.BLEND);N=0;for(y=M.lensFlares.length;N<y;N++)w=M.lensFlares[N],0.0010<w.opacity&&0.0010<w.scale&&(A.x=w.x,A.y=w.y,A.z=w.z,I=w.size*w.scale/f,F.x=I*G,F.y=I,b.uniform3f(B.screenPosition,A.x,A.y,A.z),b.uniform2f(B.scale,F.x,F.y),b.uniform1f(B.rotation,w.rotation),
|
|
|
-b.uniform1f(B.opacity,w.opacity),b.uniform3f(B.color,w.color.r,w.color.g,w.color.b),c.setBlending(w.blending,w.blendEquation,w.blendSrc,w.blendDst),c.setTexture(w.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,j=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
+b.activeTexture(b.TEXTURE1);b.bindTexture(b.TEXTURE_2D,i);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0);M.positionScreen.copy(A);M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares();b.uniform1i(B.renderType,2);b.enable(b.BLEND);N=0;for(y=M.lensFlares.length;N<y;N++)w=M.lensFlares[N],0.001<w.opacity&&0.001<w.scale&&(A.x=w.x,A.y=w.y,A.z=w.z,I=w.size*w.scale/f,F.x=I*G,F.y=I,b.uniform3f(B.screenPosition,A.x,A.y,A.z),b.uniform2f(B.scale,F.x,F.y),b.uniform1f(B.rotation,w.rotation),b.uniform1f(B.opacity,
|
|
|
+w.opacity),b.uniform3f(B.color,w.color.r,w.color.g,w.color.b),c.setBlending(w.blending,w.blendEquation,w.blendSrc,w.blendDst),c.setTexture(w.texture,1),b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0))}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(!0)}}};THREE.ShadowMapPlugin=function(){var a,b,c,d,e,f,h=new THREE.Frustum,g=new THREE.Matrix4,i=new THREE.Vector3,j=new THREE.Vector3,l=new THREE.Vector3;this.init=function(g){a=g.context;b=g;var g=THREE.ShaderLib.depthRGBA,h=THREE.UniformsUtils.clone(g.uniforms);c=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h});d=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0});e=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,
|
|
|
vertexShader:g.vertexShader,uniforms:h,skinning:!0});f=new THREE.ShaderMaterial({fragmentShader:g.fragmentShader,vertexShader:g.vertexShader,uniforms:h,morphTargets:!0,skinning:!0});c._shadowPass=!0;d._shadowPass=!0;e._shadowPass=!0;f._shadowPass=!0};this.render=function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(p,m){var q,t,n,r,s,v,z,G,C,H=[];r=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);a.frontFace(a.CCW);b.shadowMapCullFace===THREE.CullFaceFront?
|
|
|
a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(!0);q=0;for(t=p.__lights.length;q<t;q++)if(n=p.__lights[q],n.castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(s=0;s<n.shadowCascadeCount;s++){var I;if(n.shadowCascadeArray[s])I=n.shadowCascadeArray[s];else{C=n;z=s;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=C.shadowCameraNear;I.shadowCameraFar=C.shadowCameraFar;I.shadowCameraLeft=C.shadowCameraLeft;I.shadowCameraRight=C.shadowCameraRight;
|
|
|
I.shadowCameraBottom=C.shadowCameraBottom;I.shadowCameraTop=C.shadowCameraTop;I.shadowCameraVisible=C.shadowCameraVisible;I.shadowDarkness=C.shadowDarkness;I.shadowBias=C.shadowCascadeBias[z];I.shadowMapWidth=C.shadowCascadeWidth[z];I.shadowMapHeight=C.shadowCascadeHeight[z];I.pointsWorld=[];I.pointsFrustum=[];G=I.pointsWorld;v=I.pointsFrustum;for(var F=0;8>F;F++)G[F]=new THREE.Vector3,v[F]=new THREE.Vector3;G=C.shadowCascadeNearZ[z];C=C.shadowCascadeFarZ[z];v[0].set(-1,-1,G);v[1].set(1,-1,G);v[2].set(-1,
|