|
@@ -21,10 +21,10 @@ tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,
|
|
|
THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;
|
|
|
this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!1===a instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),g=Math.sin(a._x/2),f=Math.sin(a._y/2),h=Math.sin(a._z/2);"XYZ"===a.order?(this._x=g*d*e+c*f*h,this._y=c*f*e-g*d*h,this._z=c*d*h+g*f*e,this._w=c*d*e-g*f*h):"YXZ"===a.order?(this._x=g*d*e+c*f*h,this._y=c*f*e-g*d*h,this._z=
|
|
|
c*d*h-g*f*e,this._w=c*d*e+g*f*h):"ZXY"===a.order?(this._x=g*d*e-c*f*h,this._y=c*f*e+g*d*h,this._z=c*d*h+g*f*e,this._w=c*d*e-g*f*h):"ZYX"===a.order?(this._x=g*d*e-c*f*h,this._y=c*f*e+g*d*h,this._z=c*d*h-g*f*e,this._w=c*d*e+g*f*h):"YZX"===a.order?(this._x=g*d*e+c*f*h,this._y=c*f*e+g*d*h,this._z=c*d*h-g*f*e,this._w=c*d*e-g*f*h):"XZY"===a.order&&(this._x=g*d*e-c*f*h,this._y=c*f*e-g*d*h,this._z=c*d*h+g*f*e,this._w=c*d*e+g*f*h);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,
|
|
|
-b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],g=b[5],f=b[9],h=b[2],k=b[6],b=b[10],m=c+g+b;0<m?(c=.5/Math.sqrt(m+1),this._w=.25/c,this._x=(k-f)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>g&&c>b?(c=2*Math.sqrt(1+c-g-b),this._w=(k-f)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):g>b?(c=2*Math.sqrt(1+g-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=
|
|
|
+b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],g=b[5],f=b[9],h=b[2],k=b[6],b=b[10],n=c+g+b;0<n?(c=.5/Math.sqrt(n+1),this._w=.25/c,this._x=(k-f)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>g&&c>b?(c=2*Math.sqrt(1+c-g-b),this._w=(k-f)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):g>b?(c=2*Math.sqrt(1+g-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=
|
|
|
.25*c,this._z=(f+k)/c):(c=2*Math.sqrt(1+b-c-g),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(f+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=
|
|
|
-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},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)},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);this.onChangeCallback();return this},
|
|
|
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .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,g=a._w,f=b._x,h=b._y,k=b._z,m=b._w;this._x=c*m+g*f+d*k-e*h;this._y=d*m+g*h+e*f-c*k;this._z=e*m+g*k+c*h-d*f;this._w=g*m-c*f-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
|
|
|
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .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,g=a._w,f=b._x,h=b._y,k=b._z,n=b._w;this._x=c*n+g*f+d*k-e*h;this._y=d*n+g*h+e*f-c*k;this._z=e*n+g*k+c*h-d*f;this._w=g*n-c*f-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
|
|
|
return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,g=this._w,f=g*a._w+c*a._x+d*a._y+e*a._z;0>f?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,f=-f):this.copy(a);if(1<=f)return this._w=g,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(f),k=Math.sqrt(1-f*f);if(.001>Math.abs(k))return this._w=.5*(g+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;f=Math.sin((1-b)*h)/k;h=
|
|
|
Math.sin(b*h)/k;this._w=g*f+this._w*h;this._x=c*f+this._x*h;this._y=d*f+this._y*h;this._z=e*f+this._z*h;this.onChangeCallback();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];this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},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};
|
|
@@ -39,7 +39,7 @@ a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:functio
|
|
|
this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=
|
|
|
a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x,
|
|
|
c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);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;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,g=a.y,f=a.z;a=a.w;var h=a*b+g*d-f*c,k=a*c+f*b-e*d,m=a*d+e*c-g*b,b=-e*b-g*c-f*d;this.x=h*a+b*-e+k*-f-m*-g;this.y=k*a+b*-g+m*-e-h*-f;this.z=m*a+b*-f+h*-g-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===
|
|
|
+(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,g=a.y,f=a.z;a=a.w;var h=a*b+g*d-f*c,k=a*c+f*b-e*d,n=a*d+e*c-g*b,b=-e*b-g*c-f*d;this.x=h*a+b*-e+k*-f-n*-g;this.y=k*a+b*-g+n*-e-h*-f;this.z=n*a+b*-f+h*-g-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0===
|
|
|
a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;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);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);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);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a,
|
|
|
b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);
|
|
@@ -54,17 +54,17 @@ THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=
|
|
|
case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},
|
|
|
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("THREE.Vector4: .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?(a=1/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;var e=a[0];d=a[4];var g=a[8],f=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var m=a[10];if(.01>Math.abs(d-f)&&.01>Math.abs(g-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+f)&&.1>Math.abs(g+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+m-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;m=(m+1)/2;d=(d+f)/4;g=(g+c)/4;k=(k+b)/4;e>h&&e>m?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=g/b):h>m?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),
|
|
|
-b=d/c,d=k/c):.01>m?(c=b=.707106781,d=0):(d=Math.sqrt(m),b=g/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(g-c)*(g-c)+(f-d)*(f-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(g-c)/a;this.z=(f-d)/a;this.w=Math.acos((e+h+m-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);
|
|
|
+setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var g=a[8],f=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var n=a[10];if(.01>Math.abs(d-f)&&.01>Math.abs(g-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+f)&&.1>Math.abs(g+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+n-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;n=(n+1)/2;d=(d+f)/4;g=(g+c)/4;k=(k+b)/4;e>h&&e>n?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=g/b):h>n?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),
|
|
|
+b=d/c,d=k/c):.01>n?(c=b=.707106781,d=0):(d=Math.sqrt(n),b=g/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(g-c)*(g-c)+(f-d)*(f-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(g-c)/a;this.z=(f-d)/a;this.w=Math.acos((e+h+n-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},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);
|
|
|
return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);
|
|
|
return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},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.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
|
|
|
THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x=
|
|
|
-a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[1],k=d[5],m=d[9],n=d[2],q=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(-m,d),this._z=Math.atan2(-g,e)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(f,d),this._z=Math.atan2(h,k)):(this._y=
|
|
|
-Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),.99999>Math.abs(n)?(this._x=Math.atan2(q,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-g,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-n,e)):(this._x=0,this._y=Math.atan2(f,d))):"XZY"===b?(this._z=Math.asin(-c(g,
|
|
|
--1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(q,k),this._y=Math.atan2(f,e)):(this._x=Math.atan2(-m,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,g=a.y*a.y,f=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-g+f),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*(a.z*a.w-a.x*
|
|
|
+a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[1],k=d[5],n=d[9],p=d[2],m=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(-n,d),this._z=Math.atan2(-g,e)):(this._x=Math.atan2(m,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(n,-1,1)),.99999>Math.abs(n)?(this._y=Math.atan2(f,d),this._z=Math.atan2(h,k)):(this._y=
|
|
|
+Math.atan2(-p,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(-p,d),this._z=Math.atan2(-g,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(p,-1,1)),.99999>Math.abs(p)?(this._x=Math.atan2(m,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-g,k))):"YZX"===b?(this._z=Math.asin(c(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-n,k),this._y=Math.atan2(-p,e)):(this._x=0,this._y=Math.atan2(f,d))):"XZY"===b?(this._z=Math.asin(-c(g,
|
|
|
+-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(m,k),this._y=Math.atan2(f,e)):(this._x=Math.atan2(-n,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;this.onChangeCallback();return this},setFromQuaternion:function(a,b,c){var d=THREE.Math.clamp,e=a.x*a.x,g=a.y*a.y,f=a.z*a.z,h=a.w*a.w;b=b||this._order;"XYZ"===b?(this._x=Math.atan2(2*(a.x*a.w-a.y*a.z),h-e-g+f),this._y=Math.asin(d(2*(a.x*a.z+a.y*a.w),-1,1)),this._z=Math.atan2(2*(a.z*a.w-a.x*
|
|
|
a.y),h+e-g-f)):"YXZ"===b?(this._x=Math.asin(d(2*(a.x*a.w-a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h-e-g+f),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h-e+g-f)):"ZXY"===b?(this._x=Math.asin(d(2*(a.x*a.w+a.y*a.z),-1,1)),this._y=Math.atan2(2*(a.y*a.w-a.z*a.x),h-e-g+f),this._z=Math.atan2(2*(a.z*a.w-a.x*a.y),h-e+g-f)):"ZYX"===b?(this._x=Math.atan2(2*(a.x*a.w+a.z*a.y),h-e-g+f),this._y=Math.asin(d(2*(a.y*a.w-a.x*a.z),-1,1)),this._z=Math.atan2(2*(a.x*a.y+a.z*a.w),h+e-g-f)):"YZX"===b?(this._x=Math.atan2(2*
|
|
|
(a.x*a.w-a.z*a.y),h-e+g-f),this._y=Math.atan2(2*(a.y*a.w-a.x*a.z),h+e-g-f),this._z=Math.asin(d(2*(a.x*a.y+a.z*a.w),-1,1))):"XZY"===b?(this._x=Math.atan2(2*(a.x*a.w+a.y*a.z),h-e+g-f),this._y=Math.atan2(2*(a.x*a.z+a.y*a.w),h+e-g-f),this._z=Math.asin(d(2*(a.z*a.w-a.x*a.y),-1,1))):console.warn("THREE.Euler: .setFromQuaternion() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);
|
|
|
this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};
|
|
@@ -85,38 +85,38 @@ this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.
|
|
|
new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y,
|
|
|
this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);
|
|
|
this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")};
|
|
|
-THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,g,f,h,k){var m=this.elements;m[0]=a;m[3]=b;m[6]=c;m[1]=d;m[4]=e;m[7]=g;m[2]=f;m[5]=h;m[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
|
|
|
+THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(a,b,c,d,e,g,f,h,k){var n=this.elements;n[0]=a;n[3]=b;n[6]=c;n[1]=d;n[4]=e;n[7]=g;n[2]=f;n[5]=h;n[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[3],a[6],a[1],a[4],a[7],a[2],a[5],a[8]);return this},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},
|
|
|
multiplyVector3Array:function(a){console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=
|
|
|
a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],g=a[4],f=a[5],h=a[6],k=a[7],a=a[8];return b*g*a-b*f*k-c*e*a+c*f*h+d*e*k-d*g*h},getInverse:function(a,b){var c=a.elements,d=this.elements;d[0]=c[10]*c[5]-c[6]*c[9];d[1]=-c[10]*c[1]+c[2]*c[9];d[2]=c[6]*c[1]-c[2]*c[5];d[3]=-c[10]*c[4]+c[6]*c[8];d[4]=c[10]*c[0]-c[2]*c[8];d[5]=-c[6]*c[0]+c[2]*c[4];d[6]=c[9]*c[4]-c[5]*c[8];d[7]=-c[9]*c[0]+c[1]*c[8];d[8]=c[5]*c[0]-c[1]*c[4];
|
|
|
c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6];if(0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");console.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];
|
|
|
a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a},getNormalMatrix:function(a){this.getInverse(a).transpose();return this},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}};
|
|
|
THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")};
|
|
|
-THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,m,n,q,r,t,p,s){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=g;v[9]=f;v[13]=h;v[2]=k;v[6]=m;v[10]=n;v[14]=q;v[3]=r;v[7]=t;v[11]=p;v[15]=s;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
|
|
|
+THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,g,f,h,k,n,p,m,q,t,s,r){var v=this.elements;v[0]=a;v[4]=b;v[8]=c;v[12]=d;v[1]=e;v[5]=g;v[9]=f;v[13]=h;v[2]=k;v[6]=n;v[10]=p;v[14]=m;v[3]=q;v[7]=t;v[11]=s;v[15]=r;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){this.elements.set(a.elements);return this},extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},
|
|
|
copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(){var a=new THREE.Vector3;return function(b){var c=this.elements;b=b.elements;var d=1/a.set(b[0],b[1],b[2]).length(),e=1/a.set(b[4],b[5],b[6]).length(),g=1/a.set(b[8],b[9],b[10]).length();c[0]=b[0]*d;c[1]=b[1]*d;c[2]=b[2]*d;c[4]=b[4]*e;c[5]=b[5]*e;c[6]=b[6]*e;c[8]=b[8]*g;c[9]=b[9]*g;c[10]=b[10]*g;return this}}(),makeRotationFromEuler:function(a){!1===a instanceof THREE.Euler&&
|
|
|
-console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=g*h;var k=g*e,m=c*h,n=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+m*d;b[5]=a-n*d;b[9]=-c*f;b[2]=n-a*d;b[6]=m+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a+n*c,b[4]=m*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-m,b[6]=n+a*c,
|
|
|
-b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,m=d*h,n=d*e,b[0]=a-n*c,b[4]=-g*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=g*h,b[9]=n-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,m=c*h,n=c*e,b[0]=f*h,b[4]=m*d-k,b[8]=a*d+n,b[1]=f*e,b[5]=n*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=m*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,m=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*
|
|
|
-e-m,b[2]=m*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var m=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=m-g;b[8]=c+h;b[1]=m+g;b[5]=1-
|
|
|
-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g){var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),
|
|
|
-multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],m=c[1],n=c[5],q=c[9],r=c[13],t=c[2],p=c[6],s=c[10],v=c[14],w=c[3],u=c[7],z=c[11],c=c[15],x=d[0],F=d[4],C=d[8],B=d[12],y=d[1],D=d[5],J=d[9],K=d[13],S=d[2],Q=d[6],da=d[10],V=d[14],R=d[3],
|
|
|
-G=d[7],N=d[11],d=d[15];e[0]=g*x+f*y+h*S+k*R;e[4]=g*F+f*D+h*Q+k*G;e[8]=g*C+f*J+h*da+k*N;e[12]=g*B+f*K+h*V+k*d;e[1]=m*x+n*y+q*S+r*R;e[5]=m*F+n*D+q*Q+r*G;e[9]=m*C+n*J+q*da+r*N;e[13]=m*B+n*K+q*V+r*d;e[2]=t*x+p*y+s*S+v*R;e[6]=t*F+p*D+s*Q+v*G;e[10]=t*C+p*J+s*da+v*N;e[14]=t*B+p*K+s*V+v*d;e[3]=w*x+u*y+z*S+c*R;e[7]=w*F+u*D+z*Q+c*G;e[11]=w*C+u*J+z*da+c*N;e[15]=w*B+u*K+z*V+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];
|
|
|
-c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
|
+console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,g=Math.cos(c),c=Math.sin(c),f=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e);if("XYZ"===a.order){a=g*h;var k=g*e,n=c*h,p=c*e;b[0]=f*h;b[4]=-f*e;b[8]=d;b[1]=k+n*d;b[5]=a-p*d;b[9]=-c*f;b[2]=p-a*d;b[6]=n+k*d;b[10]=g*f}else"YXZ"===a.order?(a=f*h,k=f*e,n=d*h,p=d*e,b[0]=a+p*c,b[4]=n*c-k,b[8]=g*d,b[1]=g*e,b[5]=g*h,b[9]=-c,b[2]=k*c-n,b[6]=p+a*c,
|
|
|
+b[10]=g*f):"ZXY"===a.order?(a=f*h,k=f*e,n=d*h,p=d*e,b[0]=a-p*c,b[4]=-g*e,b[8]=n+k*c,b[1]=k+n*c,b[5]=g*h,b[9]=p-a*c,b[2]=-g*d,b[6]=c,b[10]=g*f):"ZYX"===a.order?(a=g*h,k=g*e,n=c*h,p=c*e,b[0]=f*h,b[4]=n*d-k,b[8]=a*d+p,b[1]=f*e,b[5]=p*d+a,b[9]=k*d-n,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,n=c*f,p=c*d,b[0]=f*h,b[4]=p-a*e,b[8]=n*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+n,b[10]=a-p*e):"XZY"===a.order&&(a=g*f,k=g*d,n=c*f,p=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=g*h,b[9]=k*
|
|
|
+e-n,b[2]=n*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var n=c*h,c=c*k,p=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(p+e);b[4]=n-g;b[8]=c+h;b[1]=n+g;b[5]=1-
|
|
|
+(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+p);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g){var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),
|
|
|
+multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],n=c[1],p=c[5],m=c[9],q=c[13],t=c[2],s=c[6],r=c[10],v=c[14],w=c[3],u=c[7],z=c[11],c=c[15],x=d[0],G=d[4],F=d[8],B=d[12],y=d[1],E=d[5],R=d[9],I=d[13],O=d[2],C=d[6],W=d[10],U=d[14],Q=d[3],
|
|
|
+V=d[7],P=d[11],d=d[15];e[0]=g*x+f*y+h*O+k*Q;e[4]=g*G+f*E+h*C+k*V;e[8]=g*F+f*R+h*W+k*P;e[12]=g*B+f*I+h*U+k*d;e[1]=n*x+p*y+m*O+q*Q;e[5]=n*G+p*E+m*C+q*V;e[9]=n*F+p*R+m*W+q*P;e[13]=n*B+p*I+m*U+q*d;e[2]=t*x+s*y+r*O+v*Q;e[6]=t*G+s*E+r*C+v*V;e[10]=t*F+s*R+r*W+v*P;e[14]=t*B+s*I+r*U+v*d;e[3]=w*x+u*y+z*O+c*Q;e[7]=w*G+u*E+z*C+c*V;e[11]=w*F+u*R+z*W+c*P;e[15]=w*B+u*I+z*U+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=
|
|
|
+d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");
|
|
|
return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");return this.applyToVector3Array(a)},applyToVector3Array:function(){var a=new THREE.Vector3;return function(b,c,d){void 0===c&&(c=0);void 0===d&&(d=
|
|
|
b.length);for(var e=0;e<d;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=
|
|
|
-a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],m=a[2],n=a[6],q=a[10],r=a[14];return a[3]*(+e*h*n-d*k*n-e*f*q+c*k*q+d*f*r-c*h*r)+a[7]*(+b*h*r-b*k*q+e*g*q-d*g*r+d*k*m-e*h*m)+a[11]*(+b*k*n-b*f*r-e*g*n+c*g*r+e*f*m-c*k*m)+a[15]*(-d*f*m-b*h*n+b*f*q+d*g*n-c*g*q+c*h*m)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
|
|
|
+a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],n=a[2],p=a[6],m=a[10],q=a[14];return a[3]*(+e*h*p-d*k*p-e*f*m+c*k*m+d*f*q-c*h*q)+a[7]*(+b*h*q-b*k*m+e*g*m-d*g*q+d*k*n-e*h*n)+a[11]*(+b*k*p-b*f*q-e*g*p+c*g*q+e*f*n-c*k*n)+a[15]*(-d*f*n-b*h*p+b*f*m+d*g*p-c*g*m+c*h*n)},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArrayOffset:function(a,
|
|
|
b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=new THREE.Vector3;return function(){console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=
|
|
|
-this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],m=d[5],n=d[9],q=d[13],r=d[2],t=d[6],p=d[10],s=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=n*s*w-q*p*w+q*t*u-m*s*u-n*t*d+m*p*d;c[4]=h*p*w-f*s*w-h*t*u+g*s*u+f*t*d-g*p*d;c[8]=f*q*w-h*n*w+h*m*u-g*q*u-f*m*d+g*n*d;c[12]=h*n*t-f*q*t-h*m*p+g*q*p+f*m*s-g*n*s;c[1]=q*p*v-n*s*v-q*r*u+k*s*u+n*r*d-k*p*d;c[5]=f*s*v-h*p*v+h*r*u-e*s*u-f*r*d+e*p*d;c[9]=h*n*v-f*q*v-h*k*
|
|
|
-u+e*q*u+f*k*d-e*n*d;c[13]=f*q*r-h*n*r+h*k*p-e*q*p-f*k*s+e*n*s;c[2]=m*s*v-q*t*v+q*r*w-k*s*w-m*r*d+k*t*d;c[6]=h*t*v-g*s*v-h*r*w+e*s*w+g*r*d-e*t*d;c[10]=g*q*v-h*m*v+h*k*w-e*q*w-g*k*d+e*m*d;c[14]=h*m*r-g*q*r-h*k*t+e*q*t+g*k*s-e*m*s;c[3]=n*t*v-m*p*v-n*r*w+k*p*w+m*r*u-k*t*u;c[7]=g*p*v-f*t*v+f*r*w-e*p*w-g*r*u+e*t*u;c[11]=f*m*v-g*n*v-f*k*w+e*n*w+g*k*u-e*m*u;c[15]=g*n*r-f*m*r+f*k*t-e*n*t-g*k*p+e*m*p;c=e*c[0]+k*c[4]+r*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
|
|
|
+this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],g=d[4],f=d[8],h=d[12],k=d[1],n=d[5],p=d[9],m=d[13],q=d[2],t=d[6],s=d[10],r=d[14],v=d[3],w=d[7],u=d[11],d=d[15];c[0]=p*r*w-m*s*w+m*t*u-n*r*u-p*t*d+n*s*d;c[4]=h*s*w-f*r*w-h*t*u+g*r*u+f*t*d-g*s*d;c[8]=f*m*w-h*p*w+h*n*u-g*m*u-f*n*d+g*p*d;c[12]=h*p*t-f*m*t-h*n*s+g*m*s+f*n*r-g*p*r;c[1]=m*s*v-p*r*v-m*q*u+k*r*u+p*q*d-k*s*d;c[5]=f*r*v-h*s*v+h*q*u-e*r*u-f*q*d+e*s*d;c[9]=h*p*v-f*m*v-h*k*
|
|
|
+u+e*m*u+f*k*d-e*p*d;c[13]=f*m*q-h*p*q+h*k*s-e*m*s-f*k*r+e*p*r;c[2]=n*r*v-m*t*v+m*q*w-k*r*w-n*q*d+k*t*d;c[6]=h*t*v-g*r*v-h*q*w+e*r*w+g*q*d-e*t*d;c[10]=g*m*v-h*n*v+h*k*w-e*m*w-g*k*d+e*n*d;c[14]=h*n*q-g*m*q-h*k*t+e*m*t+g*k*r-e*n*r;c[3]=p*t*v-n*s*v-p*q*w+k*s*w+n*q*u-k*t*u;c[7]=g*s*v-f*t*v+f*q*w-e*s*w-g*q*u+e*t*u;c[11]=f*n*v-g*p*v-f*k*w+e*p*w+g*k*u-e*n*u;c[15]=g*p*q-f*n*q+f*k*t-e*p*t-g*k*s+e*n*s;c=e*c[0]+k*c[4]+q*c[8]+v*c[12];if(0==c){if(b)throw Error("Matrix4.getInverse(): can't invert matrix, determinant is 0");
|
|
|
console.warn("Matrix4.getInverse(): can't invert matrix, determinant is 0");this.identity();return this}this.multiplyScalar(1/c);return this},translate:function(a){console.warn("THREE.Matrix4: .translate() has been removed.")},rotateX:function(a){console.warn("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(a){console.warn("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(a){console.warn("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(a,b){console.warn("THREE.Matrix4: .rotateByAxis() has been removed.")},
|
|
|
scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,
|
|
|
-0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,k=e*g,m=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,m*f+c,m*h-d*g,0,k*h-d*f,m*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
|
|
|
-0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var g=this.elements,f=a.set(g[0],g[1],g[2]).length(),h=a.set(g[4],g[5],g[6]).length(),k=a.set(g[8],g[9],g[10]).length();0>this.determinant()&&(f=-f);c.x=g[12];c.y=g[13];c.z=g[14];b.elements.set(this.elements);c=1/f;var g=1/h,m=1/k;b.elements[0]*=c;b.elements[1]*=
|
|
|
-c;b.elements[2]*=c;b.elements[4]*=g;b.elements[5]*=g;b.elements[6]*=g;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=f;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,g){var f=this.elements;f[0]=2*e/(b-a);f[4]=0;f[8]=(b+a)/(b-a);f[12]=0;f[1]=0;f[5]=2*e/(d-c);f[9]=(d+c)/(d-c);f[13]=0;f[2]=0;f[6]=0;f[10]=-(g+e)/(g-e);f[14]=-2*g*e/(g-e);f[3]=0;f[7]=0;f[11]=-1;f[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));
|
|
|
-var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,g){var f=this.elements,h=b-a,k=c-d,m=g-e;f[0]=2/h;f[4]=0;f[8]=0;f[12]=-((b+a)/h);f[1]=0;f[5]=2/k;f[9]=0;f[13]=-((c+d)/k);f[2]=0;f[6]=0;f[10]=-2/m;f[14]=-((g+e)/m);f[3]=0;f[7]=0;f[11]=0;f[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};
|
|
|
+0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,g=a.x,f=a.y,h=a.z,k=e*g,n=e*f;this.set(k*g+c,k*f-d*h,k*h+d*f,0,k*f+d*h,n*f+c,n*h-d*g,0,k*h-d*f,n*h+d*g,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,
|
|
|
+0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var g=this.elements,f=a.set(g[0],g[1],g[2]).length(),h=a.set(g[4],g[5],g[6]).length(),k=a.set(g[8],g[9],g[10]).length();0>this.determinant()&&(f=-f);c.x=g[12];c.y=g[13];c.z=g[14];b.elements.set(this.elements);c=1/f;var g=1/h,n=1/k;b.elements[0]*=c;b.elements[1]*=
|
|
|
+c;b.elements[2]*=c;b.elements[4]*=g;b.elements[5]*=g;b.elements[6]*=g;b.elements[8]*=n;b.elements[9]*=n;b.elements[10]*=n;d.setFromRotationMatrix(b);e.x=f;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,g){var f=this.elements;f[0]=2*e/(b-a);f[4]=0;f[8]=(b+a)/(b-a);f[12]=0;f[1]=0;f[5]=2*e/(d-c);f[9]=(d+c)/(d-c);f[13]=0;f[2]=0;f[6]=0;f[10]=-(g+e)/(g-e);f[14]=-2*g*e/(g-e);f[3]=0;f[7]=0;f[11]=-1;f[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));
|
|
|
+var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,g){var f=this.elements,h=b-a,k=c-d,n=g-e;f[0]=2/h;f[4]=0;f[8]=0;f[12]=-((b+a)/h);f[1]=0;f[5]=2/k;f[9]=0;f[13]=-((c+d)/k);f[2]=0;f[6]=0;f[10]=-2/n;f[14]=-((g+e)/n);f[3]=0;f[7]=0;f[11]=0;f[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};
|
|
|
THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3};
|
|
|
THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);
|
|
|
var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(a,b,c,d){var e=a.clone().add(b).multiplyScalar(.5),g=b.clone().sub(a).normalize(),f=.5*a.distanceTo(b),h=
|
|
|
-this.origin.clone().sub(e);a=-this.direction.dot(g);b=h.dot(this.direction);var k=-h.dot(g),m=h.lengthSq(),n=Math.abs(1-a*a),q,r;0<=n?(h=a*k-b,q=a*b-k,r=f*n,0<=h?q>=-r?q<=r?(f=1/n,h*=f,q*=f,a=h*(h+a*q+2*b)+q*(a*h+q+2*k)+m):(q=f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m):(q=-f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m):q<=-r?(h=Math.max(0,-(-a*f+b)),q=0<h?-f:Math.min(Math.max(-f,-k),f),a=-h*h+q*(q+2*k)+m):q<=r?(h=0,q=Math.min(Math.max(-f,-k),f),a=q*(q+2*k)+m):(h=Math.max(0,-(a*f+b)),q=0<h?f:Math.min(Math.max(-f,
|
|
|
--k),f),a=-h*h+q*(q+2*k)+m)):(q=0<a?-f:f,h=Math.max(0,-(a*q+b)),a=-h*h+q*(q+2*k)+m);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(g.clone().multiplyScalar(q).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,g=b.radius*b.radius;if(e>g)return null;g=Math.sqrt(g-e);e=d-g;
|
|
|
+this.origin.clone().sub(e);a=-this.direction.dot(g);b=h.dot(this.direction);var k=-h.dot(g),n=h.lengthSq(),p=Math.abs(1-a*a),m,q;0<=p?(h=a*k-b,m=a*b-k,q=f*p,0<=h?m>=-q?m<=q?(f=1/p,h*=f,m*=f,a=h*(h+a*m+2*b)+m*(a*h+m+2*k)+n):(m=f,h=Math.max(0,-(a*m+b)),a=-h*h+m*(m+2*k)+n):(m=-f,h=Math.max(0,-(a*m+b)),a=-h*h+m*(m+2*k)+n):m<=-q?(h=Math.max(0,-(-a*f+b)),m=0<h?-f:Math.min(Math.max(-f,-k),f),a=-h*h+m*(m+2*k)+n):m<=q?(h=0,m=Math.min(Math.max(-f,-k),f),a=m*(m+2*k)+n):(h=Math.max(0,-(a*f+b)),m=0<h?f:Math.min(Math.max(-f,
|
|
|
+-k),f),a=-h*h+m*(m+2*k)+n)):(m=0<a?-f:f,h=Math.max(0,-(a*m+b)),a=-h*h+m*(m+2*k)+n);c&&c.copy(this.direction.clone().multiplyScalar(h).add(this.origin));d&&d.copy(g.clone().multiplyScalar(m).add(e));return a},isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,g=b.radius*b.radius;if(e>g)return null;g=Math.sqrt(g-e);e=d-g;
|
|
|
d+=g;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;
|
|
|
return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,g,f;d=1/this.direction.x;g=1/this.direction.y;f=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=g?(e=(a.min.y-h.y)*g,g*=a.max.y-h.y):(e=(a.max.y-h.y)*g,g*=a.min.y-h.y);if(c>g||e>d)return null;if(e>c||c!==c)c=e;if(g<d||d!==d)d=g;0<=f?(e=(a.min.z-h.z)*f,f*=a.max.z-h.z):(e=(a.max.z-h.z)*f,f*=a.min.z-h.z);if(c>f||e>d)return null;if(e>c||c!==
|
|
|
c)c=e;if(f<d||d!==d)d=f;return 0>d?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,g,f,h,k){b.subVectors(g,e);c.subVectors(f,e);d.crossVectors(b,c);g=this.direction.dot(d);if(0<g){if(h)return null;h=1}else if(0>g)h=-1,g=-g;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;f=h*this.direction.dot(b.cross(a));if(0>f||e+f>g)return null;
|
|
@@ -125,8 +125,8 @@ THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.c
|
|
|
this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius);
|
|
|
return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}};
|
|
|
THREE.Frustum=function(a,b,c,d,e,g){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==g?g:new THREE.Plane]};
|
|
|
-THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],g=c[3],f=c[4],h=c[5],k=c[6],m=c[7],n=c[8],q=c[9],r=c[10],t=c[11],p=c[12],s=c[13],v=c[14],c=c[15];b[0].setComponents(g-a,m-f,t-n,c-p).normalize();b[1].setComponents(g+
|
|
|
-a,m+f,t+n,c+p).normalize();b[2].setComponents(g+d,m+h,t+q,c+s).normalize();b[3].setComponents(g-d,m-h,t-q,c-s).normalize();b[4].setComponents(g-e,m-k,t-r,c-v).normalize();b[5].setComponents(g+e,m+k,t+r,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
|
|
|
+THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,g){var f=this.planes;f[0].copy(a);f[1].copy(b);f[2].copy(c);f[3].copy(d);f[4].copy(e);f[5].copy(g);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],g=c[3],f=c[4],h=c[5],k=c[6],n=c[7],p=c[8],m=c[9],q=c[10],t=c[11],s=c[12],r=c[13],v=c[14],c=c[15];b[0].setComponents(g-a,n-f,t-p,c-s).normalize();b[1].setComponents(g+
|
|
|
+a,n+f,t+p,c+s).normalize();b[2].setComponents(g+d,n+h,t+m,c+r).normalize();b[3].setComponents(g-d,n-h,t-m,c-r).normalize();b[4].setComponents(g-e,n-k,t-q,c-v).normalize();b[5].setComponents(g+e,n+k,t+q,c+v).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,
|
|
|
c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)<a)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){for(var d=this.planes,e=0;6>e;e++){var g=d[e];a.x=0<g.normal.x?c.min.x:c.max.x;b.x=0<g.normal.x?c.max.x:c.min.x;a.y=0<g.normal.y?c.min.y:c.max.y;b.y=0<g.normal.y?c.max.y:c.min.y;a.z=0<g.normal.z?c.min.z:c.max.z;b.z=0<g.normal.z?c.max.z:c.min.z;var f=g.distanceToPoint(a),g=g.distanceToPoint(b);if(0>f&&0>g)return!1}return!0}}(),
|
|
|
containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0};
|
|
|
THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,
|
|
@@ -137,11 +137,11 @@ a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}}
|
|
|
THREE.Math={generateUUID:function(){var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),b=Array(36),c=0,d;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return a<b?b:a>c?c:a},clampBottom:function(a,b){return a<b?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){if(a<=
|
|
|
b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=
|
|
|
180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}};
|
|
|
-THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,m,n,q,r;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
|
|
|
-2;m=this.points[c[0]];n=this.points[c[1]];q=this.points[c[2]];r=this.points[c[3]];h=f*f;k=f*h;d.x=b(m.x,n.x,q.x,r.x,f,h,k);d.y=b(m.y,n.y,q.y,r.y,f,h,k);d.z=b(m.z,n.z,q.z,r.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
|
|
|
+THREE.Spline=function(a){function b(a,b,c,d,e,g,f){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*f+(-3*(b-c)-2*a-d)*g+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,g,f,h,k,n,p,m,q;this.initFromArray=function(a){this.points=[];for(var b=0;b<a.length;b++)this.points[b]={x:a[b][0],y:a[b][1],z:a[b][2]}};this.getPoint=function(a){e=(this.points.length-1)*a;g=Math.floor(e);f=e-g;c[0]=0===g?g:g-1;c[1]=g;c[2]=g>this.points.length-2?this.points.length-1:g+1;c[3]=g>this.points.length-3?this.points.length-1:g+
|
|
|
+2;n=this.points[c[0]];p=this.points[c[1]];m=this.points[c[2]];q=this.points[c[3]];h=f*f;k=f*h;d.x=b(n.x,p.x,m.x,q.x,f,h,k);d.y=b(n.y,p.y,m.y,q.y,f,h,k);d.z=b(n.z,p.z,m.z,q.z,f,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a<c;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d};this.getLength=function(a){var b,c,d,e=b=b=0,g=new THREE.Vector3,f=new THREE.Vector3,h=[],k=0;h[0]=0;a||(a=100);c=this.points.length*a;g.copy(this.points[0]);for(a=1;a<c;a++)b=
|
|
|
a/c,d=this.getPoint(b),f.copy(d),k+=f.distanceTo(g),g.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=k,e=b);h[h.length]=k;return{chunks:h,total:k}};this.reparametrizeByArcLength=function(a){var b,c,d,e,g,f,h=[],k=new THREE.Vector3,m=this.getLength();h.push(k.copy(this.points[0]).clone());for(b=1;b<this.points.length;b++){c=m.chunks[b]-m.chunks[b-1];f=Math.ceil(a*c/m.total);e=(b-1)/(this.points.length-1);g=b/(this.points.length-1);for(c=1;c<f-1;c++)d=e+1/f*c*(g-e),d=this.getPoint(d),h.push(k.copy(d).clone());
|
|
|
h.push(k.copy(this.points[b]).clone())}this.points=h}};THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3;this.b=void 0!==b?b:new THREE.Vector3;this.c=void 0!==c?c:new THREE.Vector3};THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){e=e||new THREE.Vector3;e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}();
|
|
|
-THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=b.dot(c);var m=d*k-e*e;h=h||new THREE.Vector3;if(0==m)return h.set(-2,-1,-1);m=1/m;k=(k*g-e*f)*m;d=(d*f-e*g)*m;return h.set(1-k-d,d,k)}}();
|
|
|
+THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,g,f,h){a.subVectors(f,e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var k=b.dot(b);f=b.dot(c);var n=d*k-e*e;h=h||new THREE.Vector3;if(0==n)return h.set(-2,-1,-1);n=1/n;k=(k*g-e*f)*n;d=(d*f-e*g)*n;return h.set(1-k-d,d,k)}}();
|
|
|
THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a);return 0<=b.x&&0<=b.y&&1>=b.x+b.y}}();
|
|
|
THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(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)},
|
|
@@ -180,50 +180,50 @@ THREE.Uint16Attribute=function(a,b){console.warn("THREE.Uint16Attribute has been
|
|
|
THREE.Uint32Attribute=function(a,b){console.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.Float32Attribute=function(a,b){console.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};
|
|
|
THREE.Float64Attribute=function(a,b){console.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.");return new THREE.BufferAttribute(a,b)};THREE.BufferGeometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.attributesKeys=[];this.offsets=this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
|
|
|
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=
|
|
|
-this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,g=b.vertexColors,f=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var m=new Float32Array(9*d.length);
|
|
|
-this.addAttribute("normal",new THREE.BufferAttribute(m,3));if(g!==THREE.NoColors){var n=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(n,3))}if(!0===f){var q=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(q,2))}for(var r=0,t=0,p=0;r<d.length;r++,t+=6,p+=9){var s=d[r],v=c[s.a],w=c[s.b],u=c[s.c];k[p]=v.x;k[p+1]=v.y;k[p+2]=v.z;k[p+3]=w.x;k[p+4]=w.y;k[p+5]=w.z;k[p+6]=u.x;k[p+7]=u.y;k[p+8]=u.z;!0===h?(v=s.vertexNormals[0],w=s.vertexNormals[1],
|
|
|
-u=s.vertexNormals[2],m[p]=v.x,m[p+1]=v.y,m[p+2]=v.z,m[p+3]=w.x,m[p+4]=w.y,m[p+5]=w.z,m[p+6]=u.x,m[p+7]=u.y,m[p+8]=u.z):(v=s.normal,m[p]=v.x,m[p+1]=v.y,m[p+2]=v.z,m[p+3]=v.x,m[p+4]=v.y,m[p+5]=v.z,m[p+6]=v.x,m[p+7]=v.y,m[p+8]=v.z);g===THREE.FaceColors?(s=s.color,n[p]=s.r,n[p+1]=s.g,n[p+2]=s.b,n[p+3]=s.r,n[p+4]=s.g,n[p+5]=s.b,n[p+6]=s.r,n[p+7]=s.g,n[p+8]=s.b):g===THREE.VertexColors&&(v=s.vertexColors[0],w=s.vertexColors[1],s=s.vertexColors[2],n[p]=v.r,n[p+1]=v.g,n[p+2]=v.b,n[p+3]=w.r,n[p+4]=w.g,n[p+
|
|
|
-5]=w.b,n[p+6]=s.r,n[p+7]=s.g,n[p+8]=s.b);!0===f&&(s=e[0][r][0],v=e[0][r][1],w=e[0][r][2],q[t]=s.x,q[t+1]=s.y,q[t+2]=v.x,q[t+3]=v.y,q[t+4]=w.x,q[t+5]=w.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===
|
|
|
+this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0)},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,g=b.vertexColors,f=0<e[0].length,h=3==d[0].vertexNormals.length,k=new Float32Array(9*d.length);this.addAttribute("position",new THREE.BufferAttribute(k,3));var n=new Float32Array(9*d.length);
|
|
|
+this.addAttribute("normal",new THREE.BufferAttribute(n,3));if(g!==THREE.NoColors){var p=new Float32Array(9*d.length);this.addAttribute("color",new THREE.BufferAttribute(p,3))}if(!0===f){var m=new Float32Array(6*d.length);this.addAttribute("uv",new THREE.BufferAttribute(m,2))}for(var q=0,t=0,s=0;q<d.length;q++,t+=6,s+=9){var r=d[q],v=c[r.a],w=c[r.b],u=c[r.c];k[s]=v.x;k[s+1]=v.y;k[s+2]=v.z;k[s+3]=w.x;k[s+4]=w.y;k[s+5]=w.z;k[s+6]=u.x;k[s+7]=u.y;k[s+8]=u.z;!0===h?(v=r.vertexNormals[0],w=r.vertexNormals[1],
|
|
|
+u=r.vertexNormals[2],n[s]=v.x,n[s+1]=v.y,n[s+2]=v.z,n[s+3]=w.x,n[s+4]=w.y,n[s+5]=w.z,n[s+6]=u.x,n[s+7]=u.y,n[s+8]=u.z):(v=r.normal,n[s]=v.x,n[s+1]=v.y,n[s+2]=v.z,n[s+3]=v.x,n[s+4]=v.y,n[s+5]=v.z,n[s+6]=v.x,n[s+7]=v.y,n[s+8]=v.z);g===THREE.FaceColors?(r=r.color,p[s]=r.r,p[s+1]=r.g,p[s+2]=r.b,p[s+3]=r.r,p[s+4]=r.g,p[s+5]=r.b,p[s+6]=r.r,p[s+7]=r.g,p[s+8]=r.b):g===THREE.VertexColors&&(v=r.vertexColors[0],w=r.vertexColors[1],r=r.vertexColors[2],p[s]=v.r,p[s+1]=v.g,p[s+2]=v.b,p[s+3]=w.r,p[s+4]=w.g,p[s+
|
|
|
+5]=w.b,p[s+6]=r.r,p[s+7]=r.g,p[s+8]=r.b);!0===f&&(r=e[0][q][0],v=e[0][q][1],w=e[0][q][2],m[t]=r.x,m[t+1]=r.y,m[t+2]=v.x,m[t+3]=v.y,m[t+4]=w.x,m[t+5]=w.y)}this.computeBoundingSphere();return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}if(void 0===b||0===
|
|
|
b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;
|
|
|
if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.set(c[e],c[e+1],c[e+2]),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=
|
|
|
-this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k,m,n,q=new THREE.Vector3,r=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,s=new THREE.Vector3;if(a.index)for(var v=a.index.array,w=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,z=w.length;u<z;++u){e=w[u].start;g=w[u].count;
|
|
|
-for(var x=w[u].index,d=e,e=e+g;d<e;d+=3)g=3*(x+v[d]),f=3*(x+v[d+1]),h=3*(x+v[d+2]),k=b[g],m=b[g+1],n=b[g+2],q.set(k,m,n),k=b[f],m=b[f+1],n=b[f+2],r.set(k,m,n),k=b[h],m=b[h+1],n=b[h+2],t.set(k,m,n),p.subVectors(t,r),s.subVectors(q,r),p.cross(s),c[g]+=p.x,c[g+1]+=p.y,c[g+2]+=p.z,c[f]+=p.x,c[f+1]+=p.y,c[f+2]+=p.z,c[h]+=p.x,c[h+1]+=p.y,c[h+2]+=p.z}else for(d=0,e=b.length;d<e;d+=9)k=b[d],m=b[d+1],n=b[d+2],q.set(k,m,n),k=b[d+3],m=b[d+4],n=b[d+5],r.set(k,m,n),k=b[d+6],m=b[d+7],n=b[d+8],t.set(k,m,n),p.subVectors(t,
|
|
|
-r),s.subVectors(q,r),p.cross(s),c[d]=p.x,c[d+1]=p.y,c[d+2]=p.z,c[d+3]=p.x,c[d+4]=p.y,c[d+5]=p.z,c[d+6]=p.x,c[d+7]=p.y,c[d+8]=p.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){q=d[3*a];r=d[3*a+1];t=d[3*a+2];p=d[3*b];s=d[3*b+1];v=d[3*b+2];w=d[3*c];u=d[3*c+1];z=d[3*c+2];x=g[2*a];F=g[2*a+1];C=g[2*b];B=g[2*b+1];y=g[2*c];D=g[2*c+1];J=p-q;K=w-q;S=s-r;Q=u-r;da=v-t;V=z-t;R=C-x;G=y-x;N=B-F;xa=D-F;P=1/(R*xa-G*N);ya.set((xa*J-N*K)*P,(xa*S-N*Q)*P,(xa*da-N*V)*P);
|
|
|
-la.set((R*K-G*J)*P,(R*Q-G*S)*P,(R*V-G*da)*P);k[a].add(ya);k[b].add(ya);k[c].add(ya);m[a].add(la);m[b].add(la);m[c].add(la)}function b(a){Ca.x=e[3*a];Ca.y=e[3*a+1];Ca.z=e[3*a+2];hb.copy(Ca);I=k[a];Ga.copy(I);Ga.sub(Ca.multiplyScalar(Ca.dot(I))).normalize();Ta.crossVectors(hb,I);Na=Ta.dot(m[a]);Ra=0>Na?-1:1;h[4*a]=Ga.x;h[4*a+1]=Ga.y;h[4*a+2]=Ga.z;h[4*a+3]=Ra}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
|
|
|
-else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],m=[],n=0;n<f;n++)k[n]=new THREE.Vector3,m[n]=new THREE.Vector3;var q,r,t,p,s,v,w,u,z,x,F,C,B,y,D,J,K,S,Q,da,V,R,G,N,xa,P,ya=new THREE.Vector3,la=new THREE.Vector3,sa,L,ha,ra,Ia;0===this.drawcalls.length&&
|
|
|
-this.addDrawCall(0,c.length,0);var ta=this.drawcalls,n=0;for(L=ta.length;n<L;++n){sa=ta[n].start;ha=ta[n].count;var Ja=ta[n].index,f=sa;for(sa+=ha;f<sa;f+=3)ha=Ja+c[f],ra=Ja+c[f+1],Ia=Ja+c[f+2],a(ha,ra,Ia)}var Ga=new THREE.Vector3,Ta=new THREE.Vector3,Ca=new THREE.Vector3,hb=new THREE.Vector3,Ra,I,Na,n=0;for(L=ta.length;n<L;++n)for(sa=ta[n].start,ha=ta[n].count,Ja=ta[n].index,f=sa,sa+=ha;f<sa;f+=3)ha=Ja+c[f],ra=Ja+c[f+1],Ia=Ja+c[f+2],b(ha),b(ra),b(Ia)}},computeOffsets:function(a){var b=a;void 0===
|
|
|
-a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],m=0,n=0,q=new Int32Array(6),r=new Int32Array(c.length),t=new Int32Array(c.length),p=0;p<c.length;p++)r[p]=-1,t[p]=-1;for(c=0;c<d;c++){for(var s=n=0;3>s;s++)p=a[3*c+s],-1==r[p]?(q[2*s]=p,q[2*s+1]=-1,n++):r[p]<k.index?(q[2*s]=p,q[2*s+1]=-1,m++):(q[2*s]=p,q[2*s+1]=r[p]);if(f+n>k.index+b)for(k={start:g,count:0,index:f},h.push(k),
|
|
|
-n=0;6>n;n+=2)s=q[n+1],-1<s&&s<k.index&&(q[n+1]=-1);for(n=0;6>n;n+=2)p=q[n],s=q[n+1],-1===s&&(s=f++),r[p]=s,t[s]=p,e[g++]=s-k.index,k.count++}this.reorderBuffers(e,t,f);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=
|
|
|
-e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,m=d[e],n=0;n<k;n++)m[g*k+n]=h[f*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},
|
|
|
-uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var g=b[e],f=[],h=g.array,k=0,m=h.length;k<m;k++)f[k]=h[k];a.data.attributes[e]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,
|
|
|
+this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;d<e;d++)c[d]=0;var c=a.normal.array,g,f,h,k,n,p,m=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,r=new THREE.Vector3;if(a.index)for(var v=a.index.array,w=0<this.offsets.length?this.offsets:[{start:0,count:v.length,index:0}],u=0,z=w.length;u<z;++u){e=w[u].start;g=w[u].count;
|
|
|
+for(var x=w[u].index,d=e,e=e+g;d<e;d+=3)g=3*(x+v[d]),f=3*(x+v[d+1]),h=3*(x+v[d+2]),k=b[g],n=b[g+1],p=b[g+2],m.set(k,n,p),k=b[f],n=b[f+1],p=b[f+2],q.set(k,n,p),k=b[h],n=b[h+1],p=b[h+2],t.set(k,n,p),s.subVectors(t,q),r.subVectors(m,q),s.cross(r),c[g]+=s.x,c[g+1]+=s.y,c[g+2]+=s.z,c[f]+=s.x,c[f+1]+=s.y,c[f+2]+=s.z,c[h]+=s.x,c[h+1]+=s.y,c[h+2]+=s.z}else for(d=0,e=b.length;d<e;d+=9)k=b[d],n=b[d+1],p=b[d+2],m.set(k,n,p),k=b[d+3],n=b[d+4],p=b[d+5],q.set(k,n,p),k=b[d+6],n=b[d+7],p=b[d+8],t.set(k,n,p),s.subVectors(t,
|
|
|
+q),r.subVectors(m,q),s.cross(r),c[d]=s.x,c[d+1]=s.y,c[d+2]=s.z,c[d+3]=s.x,c[d+4]=s.y,c[d+5]=s.z,c[d+6]=s.x,c[d+7]=s.y,c[d+8]=s.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){m=d[3*a];q=d[3*a+1];t=d[3*a+2];s=d[3*b];r=d[3*b+1];v=d[3*b+2];w=d[3*c];u=d[3*c+1];z=d[3*c+2];x=g[2*a];G=g[2*a+1];F=g[2*b];B=g[2*b+1];y=g[2*c];E=g[2*c+1];R=s-m;I=w-m;O=r-q;C=u-q;W=v-t;U=z-t;Q=F-x;V=y-x;P=B-G;sa=E-G;L=1/(Q*sa-V*P);Y.set((sa*R-P*I)*L,(sa*O-P*C)*L,(sa*W-P*U)*L);ga.set((Q*
|
|
|
+I-V*R)*L,(Q*C-V*O)*L,(Q*U-V*W)*L);k[a].add(Y);k[b].add(Y);k[c].add(Y);n[a].add(ga);n[b].add(ga);n[c].add(ga)}function b(a){Ga.x=e[3*a];Ga.y=e[3*a+1];Ga.z=e[3*a+2];Za.copy(Ga);J=k[a];Ca.copy(J);Ca.sub(Ga.multiplyScalar(Ga.dot(J))).normalize();$a.crossVectors(Za,J);Va=$a.dot(n[a]);hb=0>Va?-1:1;h[4*a]=Ca.x;h[4*a+1]=Ca.y;h[4*a+2]=Ca.z;h[4*a+3]=hb}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
|
|
|
+else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;p<f;p++)k[p]=new THREE.Vector3,n[p]=new THREE.Vector3;var m,q,t,s,r,v,w,u,z,x,G,F,B,y,E,R,I,O,C,W,U,Q,V,P,sa,L,Y=new THREE.Vector3,ga=new THREE.Vector3,ua,N,ja,wa,Ia;0===this.drawcalls.length&&
|
|
|
+this.addDrawCall(0,c.length,0);var ka=this.drawcalls,p=0;for(N=ka.length;p<N;++p){ua=ka[p].start;ja=ka[p].count;var Ja=ka[p].index,f=ua;for(ua+=ja;f<ua;f+=3)ja=Ja+c[f],wa=Ja+c[f+1],Ia=Ja+c[f+2],a(ja,wa,Ia)}var Ca=new THREE.Vector3,$a=new THREE.Vector3,Ga=new THREE.Vector3,Za=new THREE.Vector3,hb,J,Va,p=0;for(N=ka.length;p<N;++p)for(ua=ka[p].start,ja=ka[p].count,Ja=ka[p].index,f=ua,ua+=ja;f<ua;f+=3)ja=Ja+c[f],wa=Ja+c[f+1],Ia=Ja+c[f+2],b(ja),b(wa),b(Ia)}},computeOffsets:function(a){var b=a;void 0===
|
|
|
+a&&(b=65535);Date.now();a=this.attributes.index.array;for(var c=this.attributes.position.array,d=a.length/3,e=new Uint16Array(a.length),g=0,f=0,h=[{start:0,count:0,index:0}],k=h[0],n=0,p=0,m=new Int32Array(6),q=new Int32Array(c.length),t=new Int32Array(c.length),s=0;s<c.length;s++)q[s]=-1,t[s]=-1;for(c=0;c<d;c++){for(var r=p=0;3>r;r++)s=a[3*c+r],-1==q[s]?(m[2*r]=s,m[2*r+1]=-1,p++):q[s]<k.index?(m[2*r]=s,m[2*r+1]=-1,n++):(m[2*r]=s,m[2*r+1]=q[s]);if(f+p>k.index+b)for(k={start:g,count:0,index:f},h.push(k),
|
|
|
+p=0;6>p;p+=2)r=m[p+1],-1<r&&r<k.index&&(m[p+1]=-1);for(p=0;6>p;p+=2)s=m[p],r=m[p+1],-1===r&&(r=f++),q[s]=r,t[r]=s,e[g++]=r-k.index,k.count++}this.reorderBuffers(e,t,f);return this.offsets=h},merge:function(){console.log("BufferGeometry.merge(): TODO")},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!=
|
|
|
+e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize*c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!=e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,n=d[e],p=0;p<k;p++)n[g*k+p]=h[f*k+p]}this.attributes.index.array=a;for(e in this.attributes)"index"!=e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},
|
|
|
+uuid:this.uuid,type:this.type,data:{attributes:{}}},b=this.attributes,c=this.offsets,d=this.boundingSphere,e;for(e in b){for(var g=b[e],f=[],h=g.array,k=0,n=h.length;k<n;k++)f[k]=h[k];a.data.attributes[e]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<c.length&&(a.data.offsets=JSON.parse(JSON.stringify(c)));null!==d&&(a.data.boundingSphere={center:d.center.toArray(),radius:d.radius});return a},clone:function(){var a=new THREE.BufferGeometry,b;for(b in this.attributes)a.addAttribute(b,
|
|
|
this.attributes[b].clone());b=0;for(var c=this.offsets.length;b<c;b++){var d=this.offsets[b];a.offsets.push({start:d.start,index:d.index,count:d.count})}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
|
|
|
THREE.Geometry=function(){this.id=THREE.GeometryIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphColors=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.hasTangents=!1;this.dynamic=!0;this.groupsNeedUpdate=this.buffersNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=
|
|
|
this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1};
|
|
|
THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}this.boundingBox instanceof THREE.Box3&&this.computeBoundingBox();this.boundingSphere instanceof THREE.Sphere&&this.computeBoundingSphere()},
|
|
|
-fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],m=[],n=c=0;c<d.length;c+=3,n+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==g&&k.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&m.push(new THREE.Vector2(h[n],h[n+1]));h=
|
|
|
-function(a,c,d){var e=void 0!==g?[k[a].clone(),k[c].clone(),k[d].clone()]:[],h=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,h));b.faceVertexUvs[0].push([m[a],m[c],m[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();
|
|
|
+fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,g=void 0!==c.normal?c.normal.array:void 0,f=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,k=[],n=[],p=c=0;c<d.length;c+=3,p+=2)b.vertices.push(new THREE.Vector3(d[c],d[c+1],d[c+2])),void 0!==g&&k.push(new THREE.Vector3(g[c],g[c+1],g[c+2])),void 0!==f&&b.colors.push(new THREE.Color(f[c],f[c+1],f[c+2])),void 0!==h&&n.push(new THREE.Vector2(h[p],h[p+1]));h=
|
|
|
+function(a,c,d){var e=void 0!==g?[k[a].clone(),k[c].clone(),k[d].clone()]:[],h=void 0!==f?[b.colors[a].clone(),b.colors[c].clone(),b.colors[d].clone()]:[];b.faces.push(new THREE.Face3(a,c,d,e,h));b.faceVertexUvs[0].push([n[a],n[c],n[d]])};if(void 0!==e)for(c=0;c<e.length;c+=3)h(e[c],e[c+1],e[c+2]);else for(c=0;c<d.length/3;c+=3)h(c,c+1,c+2);null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());return this},center:function(){this.computeBoundingBox();
|
|
|
var a=new THREE.Vector3;a.addVectors(this.boundingBox.min,this.boundingBox.max);a.multiplyScalar(-.5);this.applyMatrix((new THREE.Matrix4).makeTranslation(a.x,a.y,a.z));this.computeBoundingBox();return a},computeFaceNormals:function(){for(var a=new THREE.Vector3,b=new THREE.Vector3,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],g=this.vertices[e.a],f=this.vertices[e.b];a.subVectors(this.vertices[e.c],f);b.subVectors(g,f);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){var b,
|
|
|
c,d;d=Array(this.vertices.length);b=0;for(c=this.vertices.length;b<c;b++)d[b]=new THREE.Vector3;if(a){var e,g,f,h=new THREE.Vector3,k=new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],e=this.vertices[c.a],g=this.vertices[c.b],f=this.vertices[c.c],h.subVectors(f,g),k.subVectors(e,g),h.cross(k),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;a<b;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),
|
|
|
d[c.c].add(c.normal);b=0;for(c=this.vertices.length;b<c;b++)d[b].normalize();a=0;for(b=this.faces.length;a<b;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;c=0;for(d=this.faces.length;c<d;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;a<
|
|
|
b;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var g=new THREE.Geometry;g.faces=this.faces;a=0;for(b=this.morphTargets.length;a<b;a++){if(!this.morphNormals[a]){this.morphNormals[a]={};this.morphNormals[a].faceNormals=[];this.morphNormals[a].vertexNormals=[];e=this.morphNormals[a].faceNormals;var f=this.morphNormals[a].vertexNormals,h,k;c=0;for(d=this.faces.length;c<d;c++)h=new THREE.Vector3,k={a:new THREE.Vector3,
|
|
|
b:new THREE.Vector3,c:new THREE.Vector3},e.push(h),f.push(k)}f=this.morphNormals[a];g.vertices=this.morphTargets[a].vertices;g.computeFaceNormals();g.computeVertexNormals();c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],h=f.faceNormals[c],k=f.vertexNormals[c],h.copy(e.normal),k.a.copy(e.vertexNormals[0]),k.b.copy(e.vertexNormals[1]),k.c.copy(e.vertexNormals[2])}c=0;for(d=this.faces.length;c<d;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,
|
|
|
-b,c,d,e,g,f,h,k,m,n,q,r,t,p,s,v,w=[],u=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,F=new THREE.Vector3,C=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],m=g[0],n=g[1],q=g[2],g=h.x-f.x,r=k.x-f.x,t=h.y-f.y,p=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=n.x-m.x,s=q.x-m.x,n=n.y-m.y,m=q.y-
|
|
|
-m.y,q=1/(k*m-s*n),c.set((m*g-n*r)*q,(m*t-n*p)*q,(m*h-n*f)*q),z.set((k*r-s*g)*q,(k*p-s*t)*q,(k*f-s*h)*q),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(z),u[v].add(z),u[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)C.copy(e.vertexNormals[c]),d=e[z[c]],v=w[d],x.copy(v),x.sub(C.multiplyScalar(C.dot(v))).normalize(),F.crossVectors(e.vertexNormals[c],v),d=F.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,
|
|
|
+b,c,d,e,g,f,h,k,n,p,m,q,t,s,r,v,w=[],u=[];c=new THREE.Vector3;var z=new THREE.Vector3,x=new THREE.Vector3,G=new THREE.Vector3,F=new THREE.Vector3;a=0;for(b=this.vertices.length;a<b;a++)w[a]=new THREE.Vector3,u[a]=new THREE.Vector3;a=0;for(b=this.faces.length;a<b;a++)e=this.faces[a],g=this.faceVertexUvs[0][a],d=e.a,v=e.b,e=e.c,f=this.vertices[d],h=this.vertices[v],k=this.vertices[e],n=g[0],p=g[1],m=g[2],g=h.x-f.x,q=k.x-f.x,t=h.y-f.y,s=k.y-f.y,h=h.z-f.z,f=k.z-f.z,k=p.x-n.x,r=m.x-n.x,p=p.y-n.y,n=m.y-
|
|
|
+n.y,m=1/(k*n-r*p),c.set((n*g-p*q)*m,(n*t-p*s)*m,(n*h-p*f)*m),z.set((k*q-r*g)*m,(k*s-r*t)*m,(k*f-r*h)*m),w[d].add(c),w[v].add(c),w[e].add(c),u[d].add(z),u[v].add(z),u[e].add(z);z=["a","b","c","d"];a=0;for(b=this.faces.length;a<b;a++)for(e=this.faces[a],c=0;c<Math.min(e.vertexNormals.length,3);c++)F.copy(e.vertexNormals[c]),d=e[z[c]],v=w[d],x.copy(v),x.sub(F.multiplyScalar(F.dot(v))).normalize(),G.crossVectors(e.vertexNormals[c],v),d=G.dot(u[d]),d=0>d?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,
|
|
|
x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;c<d;c++)0<c&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1===a instanceof
|
|
|
-THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,m=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var n=0,q=f.length;n<q;n++){var r=f[n].clone();void 0!==b&&r.applyMatrix4(b);g.push(r)}n=0;for(q=k.length;n<q;n++){var f=k[n],t,p=f.vertexNormals,s=f.vertexColors,r=new THREE.Face3(f.a+e,f.b+
|
|
|
-e,f.c+e);r.normal.copy(f.normal);void 0!==d&&r.normal.applyMatrix3(d).normalize();b=0;for(g=p.length;b<g;b++)t=p[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),r.vertexNormals.push(t);r.color.copy(f.color);b=0;for(g=s.length;b<g;b++)t=s[b],r.vertexColors.push(t.clone());r.materialIndex=f.materialIndex+c;h.push(r)}n=0;for(q=a.length;n<q;n++)if(c=a[n],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));m.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,
|
|
|
+THREE.Geometry)console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,g=this.vertices,f=a.vertices,h=this.faces,k=a.faces,n=this.faceVertexUvs[0];a=a.faceVertexUvs[0];void 0===c&&(c=0);void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var p=0,m=f.length;p<m;p++){var q=f[p].clone();void 0!==b&&q.applyMatrix4(b);g.push(q)}p=0;for(m=k.length;p<m;p++){var f=k[p],t,s=f.vertexNormals,r=f.vertexColors,q=new THREE.Face3(f.a+e,f.b+
|
|
|
+e,f.c+e);q.normal.copy(f.normal);void 0!==d&&q.normal.applyMatrix3(d).normalize();b=0;for(g=s.length;b<g;b++)t=s[b].clone(),void 0!==d&&t.applyMatrix3(d).normalize(),q.vertexNormals.push(t);q.color.copy(f.color);b=0;for(g=r.length;b<g;b++)t=r[b],q.vertexColors.push(t.clone());q.materialIndex=f.materialIndex+c;h.push(q)}p=0;for(m=a.length;p<m;p++)if(c=a[p],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(new THREE.Vector2(c[b].x,c[b].y));n.push(d)}}},mergeVertices:function(){var a={},b=[],c=[],d,
|
|
|
e=Math.pow(10,4),g,f;g=0;for(f=this.vertices.length;g<f;g++)d=this.vertices[g],d=Math.round(d.x*e)+"_"+Math.round(d.y*e)+"_"+Math.round(d.z*e),void 0===a[d]?(a[d]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[d]];a=[];g=0;for(f=this.faces.length;g<f;g++)for(e=this.faces[g],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(e=a[g],this.faces.splice(e,1),c=0,f=this.faceVertexUvs.length;c<f;c++)this.faceVertexUvs[c].splice(e,
|
|
|
-1);g=this.vertices.length-b.length;this.vertices=b;return g},makeGroups:function(){var a=0;return function(b,c){var d,e,g,f,h={},k,m=this.morphTargets.length,n=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)g=this.faces[d],g=b?g.materialIndex:0,g in h||(h[g]={hash:g,counter:0}),f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=
|
|
|
-k,this.geometryGroupsList.push(k)),this.geometryGroups[f].vertices+3>c&&(h[g].counter+=1,f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:m,numMorphNormals:n},this.geometryGroups[f]=k,this.geometryGroupsList.push(k))),this.geometryGroups[f].faces3.push(d),this.geometryGroups[f].vertices+=3}}(),toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==
|
|
|
-m[b])return m[b];m[b]=k.length/3;k.push(a.x,a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==q[b])return q[b];q[b]=n.length;n.push(a.getHex());return q[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=r.length/2;r.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
|
|
|
-this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],m={},n=[],q={},r=[],t={};for(f=0;f<this.faces.length;f++){var p=this.faces[f],s=void 0!==this.faceVertexUvs[0][f],v=0<p.normal.length(),w=0<p.vertexNormals.length,u=1!==p.color.r||1!==p.color.g||1!==p.color.b,z=0<p.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,s),x=a(x,4,v),x=a(x,5,w),x=a(x,6,u),x=a(x,7,z);h.push(x);
|
|
|
-h.push(p.a,p.b,p.c);s&&(s=this.faceVertexUvs[0][f],h.push(d(s[0]),d(s[1]),d(s[2])));v&&h.push(b(p.normal));w&&(v=p.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(p.color));z&&(p=p.vertexColors,h.push(c(p[0]),c(p[1]),c(p[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<n.length&&(e.data.colors=n);0<r.length&&(e.data.uvs=[r]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=
|
|
|
+1);g=this.vertices.length-b.length;this.vertices=b;return g},makeGroups:function(){var a=0;return function(b,c){var d,e,g,f,h={},k,n=this.morphTargets.length,p=this.morphNormals.length;this.geometryGroups={};this.geometryGroupsList=[];d=0;for(e=this.faces.length;d<e;d++)g=this.faces[d],g=b?g.materialIndex:0,g in h||(h[g]={hash:g,counter:0}),f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:n,numMorphNormals:p},this.geometryGroups[f]=
|
|
|
+k,this.geometryGroupsList.push(k)),this.geometryGroups[f].vertices+3>c&&(h[g].counter+=1,f=h[g].hash+"_"+h[g].counter,f in this.geometryGroups||(k={id:a++,faces3:[],materialIndex:g,vertices:0,numMorphTargets:n,numMorphNormals:p},this.geometryGroups[f]=k,this.geometryGroupsList.push(k))),this.geometryGroups[f].faces3.push(d),this.geometryGroups[f].vertices+=3}}(),toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==
|
|
|
+n[b])return n[b];n[b]=k.length/3;k.push(a.x,a.y,a.z);return n[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==m[b])return m[b];m[b]=p.length;p.push(a.getHex());return m[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=q.length/2;q.push(a.x,a.y);return t[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=
|
|
|
+this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],n={},p=[],m={},q=[],t={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],r=void 0!==this.faceVertexUvs[0][f],v=0<s.normal.length(),w=0<s.vertexNormals.length,u=1!==s.color.r||1!==s.color.g||1!==s.color.b,z=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,r),x=a(x,4,v),x=a(x,5,w),x=a(x,6,u),x=a(x,7,z);h.push(x);
|
|
|
+h.push(s.a,s.b,s.c);r&&(r=this.faceVertexUvs[0][f],h.push(d(r[0]),d(r[1]),d(r[2])));v&&h.push(b(s.normal));w&&(v=s.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(s.color));z&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<p.length&&(e.data.colors=p);0<q.length&&(e.data.uvs=[q]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=
|
|
|
b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],g=[],f=0,h=e.length;f<h;f++)g.push(new THREE.Vector2(e[f].x,e[f].y));a.faceVertexUvs[0].push(g)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Script=function(a){this.uuid=THREE.Math.generateUUID();this.source=a};THREE.Script.prototype={constructor:THREE.Script,clone:function(){return new THREE.Script(this.source)}};
|
|
|
THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
|
|
|
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
|
|
|
THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,1);g.lookAt(new THREE.Vector3(0,1,0));this.add(g);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,-1);f.lookAt(new THREE.Vector3(0,-1,0));
|
|
|
-this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,r=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
|
|
|
-1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,g,c);c.activeCubeFace=3;a.render(b,f,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=r;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};
|
|
|
+this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,q=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
|
|
|
+1;a.render(b,e,c);c.activeCubeFace=2;a.render(b,g,c);c.activeCubeFace=3;a.render(b,f,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=q;c.activeCubeFace=5;a.render(b,k,c)}};THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype);THREE.OrthographicCamera=function(a,b,c,d,e,g){THREE.Camera.call(this);this.type="OrthographicCamera";this.zoom=1;this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:.1;this.far=void 0!==g?g:2E3;this.updateProjectionMatrix()};
|
|
|
THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)};
|
|
|
THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.zoom=this.zoom;a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;a.projectionMatrix.copy(this.projectionMatrix);return a};
|
|
|
THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.type="PerspectiveCamera";this.zoom=1;this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
|
|
@@ -246,8 +246,8 @@ this.shadowDarkness;a.shadowMapWidth=this.shadowMapWidth;a.shadowMapHeight=this.
|
|
|
THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null;this.imageLoader=new THREE.ImageLoader;this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){}};
|
|
|
THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.fontSize="0.8em";a.style.textAlign="left";a.style.background="rgba(0,0,0,0.25)";a.style.color="#fff";a.style.width="120px";a.style.padding="0.5em 0.5em 0.5em 0.5em";a.style.zIndex=1E3;a.innerHTML="Loading ...";return a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+
|
|
|
"%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){a=a.split("/");if(1===a.length)return"./";a.pop();return a.join("/")+"/"},initMaterials:function(a,b){for(var c=[],d=0;d<a.length;++d)c[d]=this.createMaterial(a[d],b);return c},needsTangents:function(a){for(var b=0,c=a.length;b<c;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}function d(a,
|
|
|
-d,e,f,h,k,s){var v=b+e,w,u=THREE.Loader.Handlers.get(v);null!==u?w=u.load(v):(w=new THREE.Texture,u=g.imageLoader,u.crossOrigin=g.crossOrigin,u.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;f&&(w.repeat.set(f[0],f[1]),1!==f[0]&&(w.wrapS=THREE.RepeatWrapping),
|
|
|
-1!==f[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));s&&(w.anisotropy=s);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var g=this,f="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?f="MeshPhongMaterial":
|
|
|
+d,e,f,h,k,r){var v=b+e,w,u=THREE.Loader.Handlers.get(v);null!==u?w=u.load(v):(w=new THREE.Texture,u=g.imageLoader,u.crossOrigin=g.crossOrigin,u.load(v,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b;e.height=d;e.getContext("2d").drawImage(a,0,0,b,d);w.image=e}else w.image=a;w.needsUpdate=!0}));w.sourceFile=e;f&&(w.repeat.set(f[0],f[1]),1!==f[0]&&(w.wrapS=THREE.RepeatWrapping),
|
|
|
+1!==f[1]&&(w.wrapT=THREE.RepeatWrapping));h&&w.offset.set(h[0],h[1]);k&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[k[0]]&&(w.wrapS=e[k[0]]),void 0!==e[k[1]]&&(w.wrapT=e[k[1]]));r&&(w.anisotropy=r);a[d]=w}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var g=this,f="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var k=a.shading.toLowerCase();"phong"===k?f="MeshPhongMaterial":
|
|
|
"basic"===k&&(f="MeshBasicMaterial")}void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]);if(void 0!==a.transparent||1>a.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"===
|
|
|
a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,
|
|
|
a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&&
|
|
@@ -260,13 +260,13 @@ THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d
|
|
|
a}};THREE.JSONLoader=function(a){THREE.Loader.call(this,a);this.withCredentials=!1};THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype);THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"===typeof c?c:this.extractUrlBase(a);this.onLoadStart();this.loadAjaxJSON(this,a,b,c)};
|
|
|
THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var g=new XMLHttpRequest,f=0;g.onreadystatechange=function(){if(g.readyState===g.DONE)if(200===g.status||0===g.status){if(g.responseText){var h=JSON.parse(g.responseText);if(void 0!==h.metadata&&"scene"===h.metadata.type){console.error('THREE.JSONLoader: "'+b+'" seems to be a Scene. Use THREE.SceneLoader instead.');return}h=a.parse(h,d);c(h.geometry,h.materials)}else console.error('THREE.JSONLoader: "'+b+'" seems to be unreachable or the file is empty.');
|
|
|
a.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+b+'" ('+g.status+")");else g.readyState===g.LOADING?e&&(0===f&&(f=g.getResponseHeader("Content-Length")),e({total:f,loaded:g.responseText.length})):g.readyState===g.HEADERS_RECEIVED&&void 0!==e&&(f=g.getResponseHeader("Content-Length"))};g.open("GET",b,!0);g.withCredentials=this.withCredentials;g.send(null)};
|
|
|
-THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,m,n,q,r,t,p,s,v,w,u=a.faces;n=a.vertices;var z=a.normals,x=a.colors,F=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&F++;for(d=0;d<F;d++)c.faceVertexUvs[d]=[]}k=0;for(m=n.length;k<m;)d=new THREE.Vector3,d.x=n[k++]*b,d.y=n[k++]*b,d.z=n[k++]*b,c.vertices.push(d);k=0;for(m=u.length;k<m;)if(b=u[k++],t=b&1,h=b&2,d=b&8,q=b&16,p=b&32,n=b&64,b&=128,t){t=new THREE.Face3;
|
|
|
-t.a=u[k];t.b=u[k+1];t.c=u[k+3];s=new THREE.Face3;s.a=u[k+1];s.b=u[k+2];s.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,s.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],w=new THREE.Vector2(w,r),2!==f&&c.faceVertexUvs[d][h].push(w),0!==f&&c.faceVertexUvs[d][h+1].push(w);q&&(q=3*u[k++],t.normal.set(z[q++],z[q++],z[q]),s.normal.copy(t.normal));if(p)for(d=0;4>d;d++)q=3*u[k++],p=new THREE.Vector3(z[q++],
|
|
|
-z[q++],z[q]),2!==d&&t.vertexNormals.push(p),0!==d&&s.vertexNormals.push(p);n&&(n=u[k++],n=x[n],t.color.setHex(n),s.color.setHex(n));if(b)for(d=0;4>d;d++)n=u[k++],n=x[n],2!==d&&t.vertexColors.push(new THREE.Color(n)),0!==d&&s.vertexColors.push(new THREE.Color(n));c.faces.push(t);c.faces.push(s)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<F;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)r=u[k++],w=v[2*r],r=v[2*r+1],
|
|
|
-w=new THREE.Vector2(w,r),c.faceVertexUvs[d][h].push(w);q&&(q=3*u[k++],t.normal.set(z[q++],z[q++],z[q]));if(p)for(d=0;3>d;d++)q=3*u[k++],p=new THREE.Vector3(z[q++],z[q++],z[q]),t.vertexNormals.push(p);n&&(n=u[k++],t.color.setHex(x[n]));if(b)for(d=0;3>d;d++)n=u[k++],t.vertexColors.push(new THREE.Color(x[n]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
|
|
|
+THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;(function(b){var d,f,h,k,n,p,m,q,t,s,r,v,w,u=a.faces;p=a.vertices;var z=a.normals,x=a.colors,G=0;if(void 0!==a.uvs){for(d=0;d<a.uvs.length;d++)a.uvs[d].length&&G++;for(d=0;d<G;d++)c.faceVertexUvs[d]=[]}k=0;for(n=p.length;k<n;)d=new THREE.Vector3,d.x=p[k++]*b,d.y=p[k++]*b,d.z=p[k++]*b,c.vertices.push(d);k=0;for(n=u.length;k<n;)if(b=u[k++],t=b&1,h=b&2,d=b&8,m=b&16,s=b&32,p=b&64,b&=128,t){t=new THREE.Face3;
|
|
|
+t.a=u[k];t.b=u[k+1];t.c=u[k+3];r=new THREE.Face3;r.a=u[k+1];r.b=u[k+2];r.c=u[k+3];k+=4;h&&(h=u[k++],t.materialIndex=h,r.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],c.faceVertexUvs[d][h+1]=[],f=0;4>f;f++)q=u[k++],w=v[2*q],q=v[2*q+1],w=new THREE.Vector2(w,q),2!==f&&c.faceVertexUvs[d][h].push(w),0!==f&&c.faceVertexUvs[d][h+1].push(w);m&&(m=3*u[k++],t.normal.set(z[m++],z[m++],z[m]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)m=3*u[k++],s=new THREE.Vector3(z[m++],
|
|
|
+z[m++],z[m]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=u[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=u[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=u[k++];t.b=u[k++];t.c=u[k++];h&&(h=u[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;d<G;d++)for(v=a.uvs[d],c.faceVertexUvs[d][h]=[],f=0;3>f;f++)q=u[k++],w=v[2*q],q=v[2*q+1],
|
|
|
+w=new THREE.Vector2(w,q),c.faceVertexUvs[d][h].push(w);m&&(m=3*u[k++],t.normal.set(z[m++],z[m++],z[m]));if(s)for(d=0;3>d;d++)m=3*u[k++],s=new THREE.Vector3(z[m++],z[m++],z[m]),t.vertexNormals.push(s);p&&(p=u[k++],t.color.setHex(x[p]));if(b)for(d=0;3>d;d++)p=u[k++],t.vertexColors.push(new THREE.Color(x[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,f=a.skinWeights.length;d<f;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],
|
|
|
1<b?a.skinWeights[d+1]:0,2<b?a.skinWeights[d+2]:0,3<b?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,f=a.skinIndices.length;d<f;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],1<b?a.skinIndices[d+1]:0,2<b?a.skinIndices[d+2]:0,3<b?a.skinIndices[d+3]:0));c.bones=a.bones;c.bones&&0<c.bones.length&&(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+
|
|
|
-"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,m,n;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],m=c.morphTargets[d].vertices,n=a.morphTargets[d].vertices,h=0,k=n.length;h<k;h+=3){var q=new THREE.Vector3;q.x=n[h]*b;q.y=n[h+1]*b;q.z=n[h+2]*b;m.push(q)}}if(void 0!==a.morphColors)for(d=
|
|
|
-0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,m=a.morphColors[d].colors,b=0,h=m.length;b<h;b+=3)n=new THREE.Color(16755200),n.setRGB(m[b],m[b+1],m[b+2]),k.push(n)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
|
|
|
+"), and skinWeights ("+c.skinWeights.length+") should match.");c.animation=a.animation;c.animations=a.animations})();(function(b){if(void 0!==a.morphTargets){var d,f,h,k,n,p;d=0;for(f=a.morphTargets.length;d<f;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],n=c.morphTargets[d].vertices,p=a.morphTargets[d].vertices,h=0,k=p.length;h<k;h+=3){var m=new THREE.Vector3;m.x=p[h]*b;m.y=p[h+1]*b;m.z=p[h+2]*b;n.push(m)}}if(void 0!==a.morphColors)for(d=
|
|
|
+0,f=a.morphColors.length;d<f;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],k=c.morphColors[d].colors,n=a.morphColors[d].colors,b=0,h=n.length;b<h;b+=3)p=new THREE.Color(16755200),p.setRGB(n[b],n[b+1],n[b+2]),k.push(p)})(d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};d=this.initMaterials(a.materials,b);this.needsTangents(d)&&c.computeTangents();return{geometry:c,materials:d}};
|
|
|
THREE.LoadingManager=function(a,b,c){var d=this,e=0,g=0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++};this.itemEnd=function(a){e++;if(void 0!==d.onProgress)d.onProgress(a,e,g);if(e===g&&void 0!==d.onLoad)d.onLoad()}};THREE.DefaultLoadingManager=new THREE.LoadingManager;THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
|
|
|
THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,g=new THREE.XHRLoader;g.setCrossOrigin(this.crossOrigin);g.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE.BufferGeometry,c=a.attributes,d;for(d in c){var e=c[d],g=new self[e.type](e.array);b.addAttribute(d,new THREE.BufferAttribute(g,e.itemSize))}c=a.offsets;void 0!==c&&(b.offsets=JSON.parse(JSON.stringify(c)));
|
|
|
a=a.boundingSphere;void 0!==a&&(b.boundingSphere=new THREE.Sphere((new THREE.Vector3).fromArray(void 0!==a.center?a.center:[0,0,0]),a.radius));return b}};THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
|
|
@@ -281,8 +281,8 @@ b.aspect,b.near,b.far);break;case "OrthographicCamera":e=new THREE.OrthographicC
|
|
|
b.groundColor,b.intensity);break;case "Mesh":e=c[b.geometry];var g=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,g);break;case "Sprite":g=d[b.material];void 0===g&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(g);break;case "Group":e=new THREE.Group;break;default:e=new THREE.Object3D}e.uuid=b.uuid;void 0!==b.name&&
|
|
|
(e.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale));void 0!==b.visible&&(e.visible=b.visible);void 0!==b.userData&&(e.userData=b.userData);void 0!==b.script&&(e.script=new THREE.Script(b.script));if(void 0!==b.children)for(var f in b.children)e.add(this.parseObject(b.children[f],c,d));return e}}()};
|
|
|
THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin);e.load(a,function(a){a=new THREE.Texture(a);a.needsUpdate=!0;void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}};THREE.CompressedTextureLoader=function(){this._parser=null};
|
|
|
-THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],g=new THREE.CompressedTexture;g.image=e;var f=new THREE.XHRLoader;f.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){f.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(1==a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.format=a.format,g.needsUpdate=!0,b&&b(g))})};for(var k=0,m=
|
|
|
-a.length;k<m;++k)c(k)}else f.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,f=0;f<c;f++){e[f]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[f].mipmaps.push(a.mipmaps[f*a.mipmapCount+h]),e[f].format=a.format,e[f].width=a.width,e[f].height=a.height}else g.image.width=a.width,g.image.height=a.height,g.mipmaps=a.mipmaps;1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter);g.format=a.format;g.needsUpdate=!0;b&&b(g)});return g}};
|
|
|
+THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],g=new THREE.CompressedTexture;g.image=e;var f=new THREE.XHRLoader;f.setResponseType("arraybuffer");if(a instanceof Array){var h=0;c=function(c){f.load(a[c],function(a){a=d._parser(a,!0);e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};h+=1;6===h&&(1==a.mipmapCount&&(g.minFilter=THREE.LinearFilter),g.format=a.format,g.needsUpdate=!0,b&&b(g))})};for(var k=0,n=
|
|
|
+a.length;k<n;++k)c(k)}else f.load(a,function(a){a=d._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,f=0;f<c;f++){e[f]={mipmaps:[]};for(var h=0;h<a.mipmapCount;h++)e[f].mipmaps.push(a.mipmaps[f*a.mipmapCount+h]),e[f].format=a.format,e[f].width=a.width,e[f].height=a.height}else g.image.width=a.width,g.image.height=a.height,g.mipmaps=a.mipmaps;1===a.mipmapCount&&(g.minFilter=THREE.LinearFilter);g.format=a.format;g.needsUpdate=!0;b&&b(g)});return g}};
|
|
|
THREE.Material=function(){this.id=THREE.MaterialIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.type="Material";this.side=THREE.FrontSide;this.opacity=1;this.transparent=!1;this.blending=THREE.NormalBlending;this.blendSrc=THREE.SrcAlphaFactor;this.blendDst=THREE.OneMinusSrcAlphaFactor;this.blendEquation=THREE.AddEquation;this.depthWrite=this.depthTest=!0;this.polygonOffset=!1;this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.needsUpdate=this.visible=
|
|
|
!0};
|
|
|
THREE.Material.prototype={constructor:THREE.Material,setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if(b in this){var d=this[b];d instanceof THREE.Color?d.set(c):d instanceof THREE.Vector3&&c instanceof THREE.Vector3?d.copy(c):this[b]="overdraw"==b?Number(c):c}}},toJSON:function(){var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(a.name=
|
|
@@ -323,25 +323,25 @@ THREE.Texture=function(a,b,c,d,e,g,f,h,k){this.id=THREE.TextureIdCount++;this.uu
|
|
|
f?f:THREE.RGBAFormat;this.type=void 0!==h?h:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this._needsUpdate=!1;this.onUpdate=null};THREE.Texture.DEFAULT_IMAGE=void 0;THREE.Texture.DEFAULT_MAPPING=new THREE.UVMapping;
|
|
|
THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(a){!0===a&&this.update();this._needsUpdate=a},clone:function(a){void 0===a&&(a=new THREE.Texture);a.image=this.image;a.mipmaps=this.mipmaps.slice(0);a.mapping=this.mapping;a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.format=this.format;a.type=this.type;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.generateMipmaps=
|
|
|
this.generateMipmaps;a.premultiplyAlpha=this.premultiplyAlpha;a.flipY=this.flipY;a.unpackAlignment=this.unpackAlignment;return a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype);THREE.TextureIdCount=0;THREE.CubeTexture=function(a,b,c,d,e,g,f,h,k){THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.images=a};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);
|
|
|
-THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,g,f,h,k,m,n){THREE.Texture.call(this,null,g,f,h,k,m,d,e,n);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);
|
|
|
-THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,m,n){THREE.Texture.call(this,null,g,f,h,k,m,d,e,n);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};
|
|
|
-THREE.VideoTexture=function(a,b,c,d,e,g,f,h,k){THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.generateMipmaps=!1;var m=this,n=function(){requestAnimationFrame(n);a.readyState===a.HAVE_ENOUGH_DATA&&(m.needsUpdate=!0)};n()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
+THREE.CubeTexture.clone=function(a){void 0===a&&(a=new THREE.CubeTexture);THREE.Texture.prototype.clone.call(this,a);a.images=this.images;return a};THREE.CompressedTexture=function(a,b,c,d,e,g,f,h,k,n,p){THREE.Texture.call(this,null,g,f,h,k,n,d,e,p);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);
|
|
|
+THREE.CompressedTexture.prototype.clone=function(){var a=new THREE.CompressedTexture;THREE.Texture.prototype.clone.call(this,a);return a};THREE.DataTexture=function(a,b,c,d,e,g,f,h,k,n,p){THREE.Texture.call(this,null,g,f,h,k,n,d,e,p);this.image={data:a,width:b,height:c}};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.clone=function(){var a=new THREE.DataTexture;THREE.Texture.prototype.clone.call(this,a);return a};
|
|
|
+THREE.VideoTexture=function(a,b,c,d,e,g,f,h,k){THREE.Texture.call(this,a,b,c,d,e,g,f,h,k);this.generateMipmaps=!1;var n=this,p=function(){requestAnimationFrame(p);a.readyState===a.HAVE_ENOUGH_DATA&&(n.needsUpdate=!0)};p()};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.Group=function(){THREE.Object3D.call(this);this.type="Group"};THREE.Group.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.PointCloud=function(a,b){THREE.Object3D.call(this);this.type="PointCloud";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.PointCloudMaterial({color:16777215*Math.random()});this.sortParticles=!1};THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.PointCloud.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray;return function(c,d){var e=this,g=e.geometry,f=c.params.PointCloud.threshold;a.getInverse(this.matrixWorld);b.copy(c.ray).applyMatrix4(a);if(null===g.boundingBox||!1!==b.isIntersectionBox(g.boundingBox)){var h=f/((this.scale.x+this.scale.y+this.scale.z)/3),k=new THREE.Vector3,f=function(a,f){var g=b.distanceToPoint(a);if(g<h){var k=b.closestPointToPoint(a);k.applyMatrix4(e.matrixWorld);var m=c.ray.origin.distanceTo(k);
|
|
|
-d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var m=g.attributes,n=m.position.array;if(void 0!==m.index){var m=m.index.array,q=g.offsets;0===q.length&&(q=[{start:0,count:m.length,index:0}]);for(var r=0,t=q.length;r<t;++r)for(var p=q[r].start,s=q[r].index,g=p,p=p+q[r].count;g<p;g++){var v=s+m[g];k.set(n[3*v],n[3*v+1],n[3*v+2]);f(k,v)}}else for(m=n.length/3,g=0;g<m;g++)k.set(n[3*g],n[3*g+1],n[3*g+2]),f(k,g)}else for(k=this.geometry.vertices,
|
|
|
+d.push({distance:m,distanceToRay:g,point:k.clone(),index:f,face:null,object:e})}};if(g instanceof THREE.BufferGeometry){var n=g.attributes,p=n.position.array;if(void 0!==n.index){var n=n.index.array,m=g.offsets;0===m.length&&(m=[{start:0,count:n.length,index:0}]);for(var q=0,t=m.length;q<t;++q)for(var s=m[q].start,r=m[q].index,g=s,s=s+m[q].count;g<s;g++){var v=r+n[g];k.set(p[3*v],p[3*v+1],p[3*v+2]);f(k,v)}}else for(n=p.length/3,g=0;g<n;g++)k.set(p[3*g],p[3*g+1],p[3*g+2]),f(k,g)}else for(k=this.geometry.vertices,
|
|
|
g=0;g<k.length;g++)f(k[g],g)}}}();THREE.PointCloud.prototype.clone=function(a){void 0===a&&(a=new THREE.PointCloud(this.geometry,this.material));a.sortParticles=this.sortParticles;THREE.Object3D.prototype.clone.call(this,a);return a};THREE.ParticleSystem=function(a,b){console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud.");return new THREE.PointCloud(a,b)};
|
|
|
THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.type="Line";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.LineBasicMaterial({color:16777215*Math.random()});this.type=void 0!==c?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
-THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),f instanceof THREE.Geometry))for(var f=f.vertices,h=f.length,k=new THREE.Vector3,m=new THREE.Vector3,n=this.type===THREE.LineStrip?
|
|
|
-1:2,q=0;q<h-1;q+=n)if(!(b.distanceSqToSegment(f[q],f[q+1],m,k)>g)){var r=b.origin.distanceTo(m);r<d.near||r>d.far||e.push({distance:r,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};
|
|
|
+THREE.Line.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere;return function(d,e){var g=d.linePrecision,g=g*g,f=this.geometry;null===f.boundingSphere&&f.computeBoundingSphere();c.copy(f.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==d.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(d.ray).applyMatrix4(a),f instanceof THREE.Geometry))for(var f=f.vertices,h=f.length,k=new THREE.Vector3,n=new THREE.Vector3,p=this.type===THREE.LineStrip?
|
|
|
+1:2,m=0;m<h-1;m+=p)if(!(b.distanceSqToSegment(f[m],f[m+1],n,k)>g)){var q=b.origin.distanceTo(n);q<d.near||q>d.far||e.push({distance:q,point:k.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.type));THREE.Object3D.prototype.clone.call(this,a);return a};
|
|
|
THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1;this.morphTargetForcedOrder=[];this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var a=0,b=this.geometry.morphTargets.length;a<b;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}};
|
|
|
THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morphTargetDictionary[a])return this.morphTargetDictionary[a];console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0.");return 0};
|
|
|
-THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var m=
|
|
|
-this.material;if(void 0!==m){var n=k.attributes,q,r,t=f.precision;if(void 0!==n.index){var p=n.index.array,s=n.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:p.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var n=v[w].start,z=v[w].index,k=n,x=n+v[w].count;k<x;k+=3){n=z+p[k];q=z+p[k+1];r=z+p[k+2];d.set(s[3*n],s[3*n+1],s[3*n+2]);e.set(s[3*q],s[3*q+1],s[3*q+2]);g.set(s[3*r],s[3*r+1],s[3*r+2]);var F=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==
|
|
|
-THREE.DoubleSide);if(null!==F){F.applyMatrix4(this.matrixWorld);var C=f.ray.origin.distanceTo(F);C<t||C<f.near||C>f.far||h.push({distance:C,point:F,face:new THREE.Face3(n,q,r,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this})}}}else for(s=n.position.array,p=k=0,x=s.length;k<x;k+=3,p+=9)n=k,q=k+1,r=k+2,d.set(s[p],s[p+1],s[p+2]),e.set(s[p+3],s[p+4],s[p+5]),g.set(s[p+6],s[p+7],s[p+8]),F=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),
|
|
|
-null!==F&&(F.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(F),C<t||C<f.near||C>f.far||h.push({distance:C,point:F,face:new THREE.Face3(n,q,r,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(p=this.material instanceof THREE.MeshFaceMaterial,s=!0===p?this.material.materials:null,t=f.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(z=k.faces[w],m=!0===p?s[z.materialIndex]:this.material,void 0!==m){n=v[z.a];q=v[z.b];r=v[z.c];if(!0===
|
|
|
-m.morphTargets){F=k.morphTargets;C=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var x=0,B=F.length;x<B;x++){var y=C[x];if(0!==y){var D=F[x].vertices;d.x+=(D[z.a].x-n.x)*y;d.y+=(D[z.a].y-n.y)*y;d.z+=(D[z.a].z-n.z)*y;e.x+=(D[z.b].x-q.x)*y;e.y+=(D[z.b].y-q.y)*y;e.z+=(D[z.b].z-q.z)*y;g.x+=(D[z.c].x-r.x)*y;g.y+=(D[z.c].y-r.y)*y;g.z+=(D[z.c].z-r.z)*y}}d.add(n);e.add(q);g.add(r);n=d;q=e;r=g}F=m.side===THREE.BackSide?b.intersectTriangle(r,q,n,!0):b.intersectTriangle(n,q,r,m.side!==
|
|
|
-THREE.DoubleSide);null!==F&&(F.applyMatrix4(this.matrixWorld),C=f.ray.origin.distanceTo(F),C<t||C<f.near||C>f.far||h.push({distance:C,point:F,face:z,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
+THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3;return function(f,h){var k=this.geometry;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(this.matrixWorld);if(!1!==f.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(f.ray).applyMatrix4(a),null===k.boundingBox||!1!==b.isIntersectionBox(k.boundingBox)))if(k instanceof THREE.BufferGeometry){var n=
|
|
|
+this.material;if(void 0!==n){var p=k.attributes,m,q,t=f.precision;if(void 0!==p.index){var s=p.index.array,r=p.position.array,v=k.offsets;0===v.length&&(v=[{start:0,count:s.length,index:0}]);for(var w=0,u=v.length;w<u;++w)for(var p=v[w].start,z=v[w].index,k=p,x=p+v[w].count;k<x;k+=3){p=z+s[k];m=z+s[k+1];q=z+s[k+2];d.set(r[3*p],r[3*p+1],r[3*p+2]);e.set(r[3*m],r[3*m+1],r[3*m+2]);g.set(r[3*q],r[3*q+1],r[3*q+2]);var G=n.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,n.side!==
|
|
|
+THREE.DoubleSide);if(null!==G){G.applyMatrix4(this.matrixWorld);var F=f.ray.origin.distanceTo(G);F<t||F<f.near||F>f.far||h.push({distance:F,point:G,face:new THREE.Face3(p,m,q,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k<x;k+=3,s+=9)p=k,m=k+1,q=k+2,d.set(r[s],r[s+1],r[s+2]),e.set(r[s+3],r[s+4],r[s+5]),g.set(r[s+6],r[s+7],r[s+8]),G=n.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,n.side!==THREE.DoubleSide),
|
|
|
+null!==G&&(G.applyMatrix4(this.matrixWorld),F=f.ray.origin.distanceTo(G),F<t||F<f.near||F>f.far||h.push({distance:F,point:G,face:new THREE.Face3(p,m,q,THREE.Triangle.normal(d,e,g)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=f.precision,v=k.vertices,w=0,u=k.faces.length;w<u;w++)if(z=k.faces[w],n=!0===s?r[z.materialIndex]:this.material,void 0!==n){p=v[z.a];m=v[z.b];q=v[z.c];if(!0===
|
|
|
+n.morphTargets){G=k.morphTargets;F=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var x=0,B=G.length;x<B;x++){var y=F[x];if(0!==y){var E=G[x].vertices;d.x+=(E[z.a].x-p.x)*y;d.y+=(E[z.a].y-p.y)*y;d.z+=(E[z.a].z-p.z)*y;e.x+=(E[z.b].x-m.x)*y;e.y+=(E[z.b].y-m.y)*y;e.z+=(E[z.b].z-m.z)*y;g.x+=(E[z.c].x-q.x)*y;g.y+=(E[z.c].y-q.y)*y;g.z+=(E[z.c].z-q.z)*y}}d.add(p);e.add(m);g.add(q);p=d;m=e;q=g}G=n.side===THREE.BackSide?b.intersectTriangle(q,m,p,!0):b.intersectTriangle(p,m,q,n.side!==
|
|
|
+THREE.DoubleSide);null!==G&&(G.applyMatrix4(this.matrixWorld),F=f.ray.origin.distanceTo(G),F<t||F<f.near||F>f.far||h.push({distance:F,point:G,face:z,faceIndex:w,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
|
|
|
this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],b=0,a=this.bones.length;b<a;b++)this.boneInverses.push(new THREE.Matrix4)};
|
|
|
THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}};
|
|
@@ -433,164 +433,164 @@ THREE.WebGLRenderer=function(a){function b(a,b){var c=a.vertices.length,d=b.mate
|
|
|
function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*f));c.hasTangents&&(a.__tangentArray=new Float32Array(4*f));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*f),a.__skinWeightArray=new Float32Array(4*
|
|
|
f));c=null!==Fb&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=2*h;if(e.attributes){void 0===a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=
|
|
|
[]);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:
|
|
|
-a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var g=0,k=b.length;g<k;g++){var m=b[g],n=e[m];if(0<=n){var r=c[m];void 0!==r?(m=r.itemSize,l.bindBuffer(l.ARRAY_BUFFER,r.buffer),f(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function g(){for(var a=
|
|
|
-0,b=Lb.length;a<b;a++)Lb[a]=0}function f(a){Lb[a]=1;0===vb[a]&&(l.enableVertexAttribArray(a),vb[a]=1)}function h(){for(var a=0,b=vb.length;a<b;a++)vb[a]!==Lb[a]&&(l.disableVertexAttribArray(a),vb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function n(a,b){return b[0]-a[0]}function q(a,e){if(!1!==e.visible){e instanceof THREE.Light&&Ga.push(e);if(!(e instanceof THREE.Scene||e instanceof
|
|
|
+a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var g=0,k=b.length;g<k;g++){var m=b[g],n=e[m];if(0<=n){var p=c[m];void 0!==p?(m=p.itemSize,l.bindBuffer(l.ARRAY_BUFFER,p.buffer),f(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,a.defaultAttributeValues[m]))}}h()}function g(){for(var a=
|
|
|
+0,b=Lb.length;a<b;a++)Lb[a]=0}function f(a){Lb[a]=1;0===vb[a]&&(l.enableVertexAttribArray(a),vb[a]=1)}function h(){for(var a=0,b=vb.length;a<b;a++)vb[a]!==Lb[a]&&(l.disableVertexAttribArray(a),vb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function m(a,e){if(!1!==e.visible){e instanceof THREE.Light&&Ca.push(e);if(!(e instanceof THREE.Scene||e instanceof
|
|
|
THREE.Group)){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Ec));var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Fc),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)v(a,e,f);else if(e instanceof THREE.Line){if(!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=
|
|
|
-l.createBuffer();I.info.memory.geometries++;var g=f.vertices.length;f.__vertexArray=new Float32Array(3*g);f.__colorArray=new Float32Array(3*g);f.__lineDistanceArray=new Float32Array(1*g);f.__webglLineCount=g;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();I.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*
|
|
|
-h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)w(Ta,f,e);else{if(f instanceof THREE.Geometry)for(var k=0,m=f.geometryGroupsList.length;k<m;k++)w(Ta,f.geometryGroupsList[k],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?w(Ta,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&Ca.push({id:null,
|
|
|
-object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var r=Ta[e.id];if(r&&(!1===e.frustumCulled||!0===Ac.intersectsObject(e))){var p=e.geometry,s,t,x;if(p instanceof THREE.BufferGeometry)for(var y=p.attributes,B=p.attributesKeys,C=0,F=B.length;C<F;C++){var D=B[C],K=y[D];void 0===K.buffer&&(K.buffer=l.createBuffer(),K.needsUpdate=!0);if(!0===K.needsUpdate){var N="index"===D?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(N,K.buffer);l.bufferData(N,K.array,l.STATIC_DRAW);K.needsUpdate=
|
|
|
-!1}}else if(e instanceof THREE.Mesh){(p.buffersNeedUpdate||p.groupsNeedUpdate)&&v(a,e,p);for(var J=0,S=p.geometryGroupsList.length;J<S;J++)if(s=p.geometryGroupsList[J],x=d(e,s),(p.buffersNeedUpdate||p.groupsNeedUpdate)&&c(s,e),t=x.attributes&&u(x),p.verticesNeedUpdate||p.morphTargetsNeedUpdate||p.elementsNeedUpdate||p.uvsNeedUpdate||p.normalsNeedUpdate||p.colorsNeedUpdate||p.tangentsNeedUpdate||t){var G=s,Q=e,L=l.DYNAMIC_DRAW,ta=!p.dynamic,R=x;if(G.__inittedArrays){var V=R&&void 0!==R.shading&&R.shading===
|
|
|
-THREE.SmoothShading,M=void 0,P=void 0,Ja=void 0,W=void 0,da=void 0,xa=void 0,Na=void 0,la=void 0,va=void 0,sa=void 0,ya=void 0,X=void 0,Y=void 0,Z=void 0,ra=void 0,ha=void 0,Ia=void 0,oa=void 0,O=void 0,ub=void 0,ma=void 0,pc=void 0,ka=void 0,qc=void 0,rc=void 0,sc=void 0,Aa=void 0,Ea=void 0,Fa=void 0,ga=void 0,Xa=void 0,tb=void 0,ua=void 0,Bc=void 0,Oa=void 0,Tb=void 0,ab=void 0,nb=void 0,Gb=void 0,Mb=void 0,ib=0,Ya=0,tc=0,uc=0,wb=0,Za=0,Pa=0,bb=0,Ka=0,fa=0,qa=0,E=0,La=void 0,cb=G.__vertexArray,
|
|
|
-Nb=G.__uvArray,xb=G.__uv2Array,db=G.__normalArray,za=G.__tangentArray,Ma=G.__colorArray,pa=G.__skinIndexArray,Ba=G.__skinWeightArray,ec=G.__morphTargetsArrays,jb=G.__morphNormalsArrays,yb=G.__webglCustomAttributesList,A=void 0,$a=G.__faceArray,Sa=G.__lineArray,Ha=Q.geometry,eb=Ha.elementsNeedUpdate,zb=Ha.uvsNeedUpdate,fb=Ha.normalsNeedUpdate,Uc=Ha.tangentsNeedUpdate,vb=Ha.colorsNeedUpdate,ea=Ha.morphTargetsNeedUpdate,Cc=Ha.vertices,H=G.faces3,$=Ha.faces,aa=Ha.faceVertexUvs[0],Ua=Ha.faceVertexUvs[1],
|
|
|
-wa=Ha.skinIndices,Yb=Ha.skinWeights,Zb=Ha.morphTargets,$b=Ha.morphNormals;if(Ha.verticesNeedUpdate){M=0;for(P=H.length;M<P;M++)W=$[H[M]],X=Cc[W.a],Y=Cc[W.b],Z=Cc[W.c],cb[Ya]=X.x,cb[Ya+1]=X.y,cb[Ya+2]=X.z,cb[Ya+3]=Y.x,cb[Ya+4]=Y.y,cb[Ya+5]=Y.z,cb[Ya+6]=Z.x,cb[Ya+7]=Z.y,cb[Ya+8]=Z.z,Ya+=9;l.bindBuffer(l.ARRAY_BUFFER,G.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,cb,L)}if(ea)for(Oa=0,Tb=Zb.length;Oa<Tb;Oa++){M=qa=0;for(P=H.length;M<P;M++)Gb=H[M],W=$[Gb],X=Zb[Oa].vertices[W.a],Y=Zb[Oa].vertices[W.b],
|
|
|
-Z=Zb[Oa].vertices[W.c],ab=ec[Oa],ab[qa]=X.x,ab[qa+1]=X.y,ab[qa+2]=X.z,ab[qa+3]=Y.x,ab[qa+4]=Y.y,ab[qa+5]=Y.z,ab[qa+6]=Z.x,ab[qa+7]=Z.y,ab[qa+8]=Z.z,R.morphNormals&&(V?(Mb=$b[Oa].vertexNormals[Gb],oa=Mb.a,O=Mb.b,ub=Mb.c):ub=O=oa=$b[Oa].faceNormals[Gb],nb=jb[Oa],nb[qa]=oa.x,nb[qa+1]=oa.y,nb[qa+2]=oa.z,nb[qa+3]=O.x,nb[qa+4]=O.y,nb[qa+5]=O.z,nb[qa+6]=ub.x,nb[qa+7]=ub.y,nb[qa+8]=ub.z),qa+=9;l.bindBuffer(l.ARRAY_BUFFER,G.__webglMorphTargetsBuffers[Oa]);l.bufferData(l.ARRAY_BUFFER,ec[Oa],L);R.morphNormals&&
|
|
|
-(l.bindBuffer(l.ARRAY_BUFFER,G.__webglMorphNormalsBuffers[Oa]),l.bufferData(l.ARRAY_BUFFER,jb[Oa],L))}if(Yb.length){M=0;for(P=H.length;M<P;M++)W=$[H[M]],qc=Yb[W.a],rc=Yb[W.b],sc=Yb[W.c],Ba[fa]=qc.x,Ba[fa+1]=qc.y,Ba[fa+2]=qc.z,Ba[fa+3]=qc.w,Ba[fa+4]=rc.x,Ba[fa+5]=rc.y,Ba[fa+6]=rc.z,Ba[fa+7]=rc.w,Ba[fa+8]=sc.x,Ba[fa+9]=sc.y,Ba[fa+10]=sc.z,Ba[fa+11]=sc.w,Aa=wa[W.a],Ea=wa[W.b],Fa=wa[W.c],pa[fa]=Aa.x,pa[fa+1]=Aa.y,pa[fa+2]=Aa.z,pa[fa+3]=Aa.w,pa[fa+4]=Ea.x,pa[fa+5]=Ea.y,pa[fa+6]=Ea.z,pa[fa+7]=Ea.w,pa[fa+
|
|
|
-8]=Fa.x,pa[fa+9]=Fa.y,pa[fa+10]=Fa.z,pa[fa+11]=Fa.w,fa+=12;0<fa&&(l.bindBuffer(l.ARRAY_BUFFER,G.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,pa,L),l.bindBuffer(l.ARRAY_BUFFER,G.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,Ba,L))}if(vb){M=0;for(P=H.length;M<P;M++)W=$[H[M]],Na=W.vertexColors,la=W.color,3===Na.length&&R.vertexColors===THREE.VertexColors?(ma=Na[0],pc=Na[1],ka=Na[2]):ka=pc=ma=la,Ma[Ka]=ma.r,Ma[Ka+1]=ma.g,Ma[Ka+2]=ma.b,Ma[Ka+3]=pc.r,Ma[Ka+4]=pc.g,Ma[Ka+5]=pc.b,Ma[Ka+6]=
|
|
|
-ka.r,Ma[Ka+7]=ka.g,Ma[Ka+8]=ka.b,Ka+=9;0<Ka&&(l.bindBuffer(l.ARRAY_BUFFER,G.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ma,L))}if(Uc&&Ha.hasTangents){M=0;for(P=H.length;M<P;M++)W=$[H[M]],va=W.vertexTangents,ra=va[0],ha=va[1],Ia=va[2],za[Pa]=ra.x,za[Pa+1]=ra.y,za[Pa+2]=ra.z,za[Pa+3]=ra.w,za[Pa+4]=ha.x,za[Pa+5]=ha.y,za[Pa+6]=ha.z,za[Pa+7]=ha.w,za[Pa+8]=Ia.x,za[Pa+9]=Ia.y,za[Pa+10]=Ia.z,za[Pa+11]=Ia.w,Pa+=12;l.bindBuffer(l.ARRAY_BUFFER,G.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,za,L)}if(fb){M=
|
|
|
-0;for(P=H.length;M<P;M++)if(W=$[H[M]],da=W.vertexNormals,xa=W.normal,3===da.length&&V)for(ga=0;3>ga;ga++)tb=da[ga],db[Za]=tb.x,db[Za+1]=tb.y,db[Za+2]=tb.z,Za+=3;else for(ga=0;3>ga;ga++)db[Za]=xa.x,db[Za+1]=xa.y,db[Za+2]=xa.z,Za+=3;l.bindBuffer(l.ARRAY_BUFFER,G.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,db,L)}if(zb&&aa){M=0;for(P=H.length;M<P;M++)if(Ja=H[M],sa=aa[Ja],void 0!==sa)for(ga=0;3>ga;ga++)ua=sa[ga],Nb[tc]=ua.x,Nb[tc+1]=ua.y,tc+=2;0<tc&&(l.bindBuffer(l.ARRAY_BUFFER,G.__webglUVBuffer),
|
|
|
-l.bufferData(l.ARRAY_BUFFER,Nb,L))}if(zb&&Ua){M=0;for(P=H.length;M<P;M++)if(Ja=H[M],ya=Ua[Ja],void 0!==ya)for(ga=0;3>ga;ga++)Bc=ya[ga],xb[uc]=Bc.x,xb[uc+1]=Bc.y,uc+=2;0<uc&&(l.bindBuffer(l.ARRAY_BUFFER,G.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,xb,L))}if(eb){M=0;for(P=H.length;M<P;M++)$a[wb]=ib,$a[wb+1]=ib+1,$a[wb+2]=ib+2,wb+=3,Sa[bb]=ib,Sa[bb+1]=ib+1,Sa[bb+2]=ib,Sa[bb+3]=ib+2,Sa[bb+4]=ib+1,Sa[bb+5]=ib+2,bb+=6,ib+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,G.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,
|
|
|
-$a,L);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,G.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Sa,L)}if(yb)for(ga=0,Xa=yb.length;ga<Xa;ga++)if(A=yb[ga],A.__original.needsUpdate){E=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],A.array[E]=A.value[W.a],A.array[E+1]=A.value[W.b],A.array[E+2]=A.value[W.c],E+=3;else{if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],A.array[E]=La,A.array[E+1]=La,A.array[E+2]=La,E+=3}else if(2===A.size)if(void 0===
|
|
|
-A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],Z=A.value[W.c],A.array[E]=X.x,A.array[E+1]=X.y,A.array[E+2]=Y.x,A.array[E+3]=Y.y,A.array[E+4]=Z.x,A.array[E+5]=Z.y,E+=6;else{if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[E]=X.x,A.array[E+1]=X.y,A.array[E+2]=Y.x,A.array[E+3]=Y.y,A.array[E+4]=Z.x,A.array[E+5]=Z.y,E+=6}else if(3===A.size){var ba;ba="c"===A.type?["r","g","b"]:["x","y","z"];if(void 0===A.boundTo||"vertices"===
|
|
|
-A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],Z=A.value[W.c],A.array[E]=X[ba[0]],A.array[E+1]=X[ba[1]],A.array[E+2]=X[ba[2]],A.array[E+3]=Y[ba[0]],A.array[E+4]=Y[ba[1]],A.array[E+5]=Y[ba[2]],A.array[E+6]=Z[ba[0]],A.array[E+7]=Z[ba[1]],A.array[E+8]=Z[ba[2]],E+=9;else if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[E]=X[ba[0]],A.array[E+1]=X[ba[1]],A.array[E+2]=X[ba[2]],A.array[E+3]=Y[ba[0]],A.array[E+4]=Y[ba[1]],A.array[E+5]=Y[ba[2]],
|
|
|
-A.array[E+6]=Z[ba[0]],A.array[E+7]=Z[ba[1]],A.array[E+8]=Z[ba[2]],E+=9;else if("faceVertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],X=La[0],Y=La[1],Z=La[2],A.array[E]=X[ba[0]],A.array[E+1]=X[ba[1]],A.array[E+2]=X[ba[2]],A.array[E+3]=Y[ba[0]],A.array[E+4]=Y[ba[1]],A.array[E+5]=Y[ba[2]],A.array[E+6]=Z[ba[0]],A.array[E+7]=Z[ba[1]],A.array[E+8]=Z[ba[2]],E+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)W=$[H[M]],X=A.value[W.a],Y=A.value[W.b],
|
|
|
-Z=A.value[W.c],A.array[E]=X.x,A.array[E+1]=X.y,A.array[E+2]=X.z,A.array[E+3]=X.w,A.array[E+4]=Y.x,A.array[E+5]=Y.y,A.array[E+6]=Y.z,A.array[E+7]=Y.w,A.array[E+8]=Z.x,A.array[E+9]=Z.y,A.array[E+10]=Z.z,A.array[E+11]=Z.w,E+=12;else if("faces"===A.boundTo)for(M=0,P=H.length;M<P;M++)Z=Y=X=La=A.value[H[M]],A.array[E]=X.x,A.array[E+1]=X.y,A.array[E+2]=X.z,A.array[E+3]=X.w,A.array[E+4]=Y.x,A.array[E+5]=Y.y,A.array[E+6]=Y.z,A.array[E+7]=Y.w,A.array[E+8]=Z.x,A.array[E+9]=Z.y,A.array[E+10]=Z.z,A.array[E+11]=
|
|
|
-Z.w,E+=12;else if("faceVertices"===A.boundTo)for(M=0,P=H.length;M<P;M++)La=A.value[H[M]],X=La[0],Y=La[1],Z=La[2],A.array[E]=X.x,A.array[E+1]=X.y,A.array[E+2]=X.z,A.array[E+3]=X.w,A.array[E+4]=Y.x,A.array[E+5]=Y.y,A.array[E+6]=Y.z,A.array[E+7]=Y.w,A.array[E+8]=Z.x,A.array[E+9]=Z.y,A.array[E+10]=Z.z,A.array[E+11]=Z.w,E+=12;l.bindBuffer(l.ARRAY_BUFFER,A.buffer);l.bufferData(l.ARRAY_BUFFER,A.array,L)}ta&&(delete G.__inittedArrays,delete G.__colorArray,delete G.__normalArray,delete G.__tangentArray,delete G.__uvArray,
|
|
|
-delete G.__uv2Array,delete G.__faceArray,delete G.__vertexArray,delete G.__lineArray,delete G.__skinIndexArray,delete G.__skinWeightArray)}}p.verticesNeedUpdate=!1;p.morphTargetsNeedUpdate=!1;p.elementsNeedUpdate=!1;p.uvsNeedUpdate=!1;p.normalsNeedUpdate=!1;p.colorsNeedUpdate=!1;p.tangentsNeedUpdate=!1;p.buffersNeedUpdate=!1;x.attributes&&z(x)}else if(e instanceof THREE.Line){x=d(e,p);t=x.attributes&&u(x);if(p.verticesNeedUpdate||p.colorsNeedUpdate||p.lineDistancesNeedUpdate||t){var ac=l.DYNAMIC_DRAW,
|
|
|
-Ob,ob,Pb,pb,ia,Ab,Ub=p.vertices,Xb=p.colors,Fb=p.lineDistances,Lb=Ub.length,Jb=Xb.length,Vb=Fb.length,kb=p.__vertexArray,lb=p.__colorArray,Kb=p.__lineDistanceArray,mc=p.colorsNeedUpdate,nc=p.lineDistancesNeedUpdate,mb=p.__webglCustomAttributesList,gb,sb,Da,ic,Va,na;if(p.verticesNeedUpdate){for(Ob=0;Ob<Lb;Ob++)pb=Ub[Ob],ia=3*Ob,kb[ia]=pb.x,kb[ia+1]=pb.y,kb[ia+2]=pb.z;l.bindBuffer(l.ARRAY_BUFFER,p.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,kb,ac)}if(mc){for(ob=0;ob<Jb;ob++)Ab=Xb[ob],ia=3*ob,lb[ia]=
|
|
|
-Ab.r,lb[ia+1]=Ab.g,lb[ia+2]=Ab.b;l.bindBuffer(l.ARRAY_BUFFER,p.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,lb,ac)}if(nc){for(Pb=0;Pb<Vb;Pb++)Kb[Pb]=Fb[Pb];l.bindBuffer(l.ARRAY_BUFFER,p.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Kb,ac)}if(mb)for(gb=0,sb=mb.length;gb<sb;gb++)if(na=mb[gb],na.needsUpdate&&(void 0===na.boundTo||"vertices"===na.boundTo)){ia=0;ic=na.value.length;if(1===na.size)for(Da=0;Da<ic;Da++)na.array[Da]=na.value[Da];else if(2===na.size)for(Da=0;Da<ic;Da++)Va=na.value[Da],
|
|
|
-na.array[ia]=Va.x,na.array[ia+1]=Va.y,ia+=2;else if(3===na.size)if("c"===na.type)for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.r,na.array[ia+1]=Va.g,na.array[ia+2]=Va.b,ia+=3;else for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.x,na.array[ia+1]=Va.y,na.array[ia+2]=Va.z,ia+=3;else if(4===na.size)for(Da=0;Da<ic;Da++)Va=na.value[Da],na.array[ia]=Va.x,na.array[ia+1]=Va.y,na.array[ia+2]=Va.z,na.array[ia+3]=Va.w,ia+=4;l.bindBuffer(l.ARRAY_BUFFER,na.buffer);l.bufferData(l.ARRAY_BUFFER,na.array,
|
|
|
-ac)}}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;p.lineDistancesNeedUpdate=!1;x.attributes&&z(x)}else if(e instanceof THREE.PointCloud){x=d(e,p);t=x.attributes&&u(x);if(p.verticesNeedUpdate||p.colorsNeedUpdate||e.sortParticles||t){var fc=l.DYNAMIC_DRAW,Wa,Bb,Cb,U,Db,Qb,wc=p.vertices,gc=wc.length,hc=p.colors,kc=hc.length,bc=p.__vertexArray,cc=p.__colorArray,Hb=p.__sortArray,Wb=p.verticesNeedUpdate,lc=p.colorsNeedUpdate,Ib=p.__webglCustomAttributesList,qb,jc,ca,rb,ja,T;if(e.sortParticles){Dc.copy(xc);
|
|
|
-Dc.multiply(e.matrixWorld);for(Wa=0;Wa<gc;Wa++)Cb=wc[Wa],Qa.copy(Cb),Qa.applyProjection(Dc),Hb[Wa]=[Qa.z,Wa];Hb.sort(n);for(Wa=0;Wa<gc;Wa++)Cb=wc[Hb[Wa][1]],U=3*Wa,bc[U]=Cb.x,bc[U+1]=Cb.y,bc[U+2]=Cb.z;for(Bb=0;Bb<kc;Bb++)U=3*Bb,Qb=hc[Hb[Bb][1]],cc[U]=Qb.r,cc[U+1]=Qb.g,cc[U+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(T=Ib[qb],void 0===T.boundTo||"vertices"===T.boundTo)if(U=0,rb=T.value.length,1===T.size)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],T.array[ca]=T.value[Db];else if(2===T.size)for(ca=0;ca<rb;ca++)Db=
|
|
|
-Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.r,T.array[U+1]=ja.g,T.array[U+2]=ja.b,U+=3;else for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,U+=3;else if(4===T.size)for(ca=0;ca<rb;ca++)Db=Hb[ca][1],ja=T.value[Db],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,T.array[U+3]=ja.w,U+=4}else{if(Wb)for(Wa=0;Wa<gc;Wa++)Cb=wc[Wa],U=3*
|
|
|
-Wa,bc[U]=Cb.x,bc[U+1]=Cb.y,bc[U+2]=Cb.z;if(lc)for(Bb=0;Bb<kc;Bb++)Qb=hc[Bb],U=3*Bb,cc[U]=Qb.r,cc[U+1]=Qb.g,cc[U+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(T=Ib[qb],T.needsUpdate&&(void 0===T.boundTo||"vertices"===T.boundTo))if(rb=T.value.length,U=0,1===T.size)for(ca=0;ca<rb;ca++)T.array[ca]=T.value[ca];else if(2===T.size)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,U+=2;else if(3===T.size)if("c"===T.type)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.r,T.array[U+1]=
|
|
|
-ja.g,T.array[U+2]=ja.b,U+=3;else for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,U+=3;else if(4===T.size)for(ca=0;ca<rb;ca++)ja=T.value[ca],T.array[U]=ja.x,T.array[U+1]=ja.y,T.array[U+2]=ja.z,T.array[U+3]=ja.w,U+=4}if(Wb||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,p.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,bc,fc);if(lc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,p.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,cc,fc);if(Ib)for(qb=0,jc=Ib.length;qb<
|
|
|
-jc;qb++)if(T=Ib[qb],T.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,T.buffer),l.bufferData(l.ARRAY_BUFFER,T.array,fc)}p.verticesNeedUpdate=!1;p.colorsNeedUpdate=!1;x.attributes&&z(x)}for(var dc=0,Eb=r.length;dc<Eb;dc++){var yc=r[dc],Rb=yc,oc=Rb.object,vc=Rb.buffer,zc=oc.geometry,Sb=oc.material;Sb instanceof THREE.MeshFaceMaterial?(Sb=Sb.materials[zc instanceof THREE.BufferGeometry?0:vc.materialIndex],Rb.material=Sb,Sb.transparent?Ra.push(Rb):hb.push(Rb)):Sb&&(Rb.material=Sb,Sb.transparent?
|
|
|
-Ra.push(Rb):hb.push(Rb));yc.render=!0;!0===I.sortObjects&&(null!==e.renderDepth?yc.z=e.renderDepth:(Qa.setFromMatrixPosition(e.matrixWorld),Qa.applyProjection(xc),yc.z=Qa.z))}}}dc=0;for(Eb=e.children.length;dc<Eb;dc++)q(a,e.children[dc])}}function r(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].render(b,c,zc,Gc)}function t(a,b,c,d,e,f){for(var g,h,k,l=a.length-1;-1!==l;l--){g=a[l];h=g.object;k=g.buffer;B(h,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&I.setBlending(g.blending,g.blendEquation,
|
|
|
-g.blendSrc,g.blendDst);I.setDepthTest(g.depthTest);I.setDepthWrite(g.depthWrite);K(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}I.setMaterialFaces(g);k instanceof THREE.BufferGeometry?I.renderBufferDirect(b,c,d,g,k,h):I.renderBuffer(b,c,d,g,k,h)}}function p(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<m;l++)if(h=a[l],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&I.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);I.setDepthTest(h.depthTest);I.setDepthWrite(h.depthWrite);
|
|
|
-K(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}I.renderImmediateObject(c,d,e,h,k)}}function s(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=!1;a=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete Ta[b.id],d.makeGroups(a instanceof THREE.MeshFaceMaterial,Fb?4294967296:65535),d.groupsNeedUpdate=!1;for(var f=0,g=d.geometryGroupsList.length;f<g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=
|
|
|
-!1;else{e=a;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],h=0,k=e.numMorphTargets;h<
|
|
|
-k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());I.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=!0}(e||void 0===b.__webglActive)&&w(Ta,a,b)}b.__webglActive=!0}function w(a,b,c){var d=c.id;a[d]=a[d]||[];
|
|
|
-a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function z(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;ec=0;if(d.needsUpdate){d.program&&Hc(d);d.addEventListener("dispose",Ic);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?
|
|
|
-m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=0,r=0,s=0,t=0,q=0,
|
|
|
-u=b.length;q<u;q++){var v=b[q];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&p++,v instanceof THREE.PointLight&&r++,v instanceof THREE.SpotLight&&s++,v instanceof THREE.HemisphereLight&&t++)}f=p;g=r;h=s;k=t;for(var w,x=0,z=0,B=b.length;z<B;z++){var K=b[z];K.castShadow&&(K instanceof THREE.SpotLight&&x++,K instanceof THREE.DirectionalLight&&!K.shadowCascade&&x++)}w=x;var J;if(fc&&e&&e.skeleton&&e.skeleton.useVertexTexture)J=1024;else{var L=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),
|
|
|
-ta=Math.floor((L-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(ta=Math.min(e.skeleton.bones.length,ta),ta<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+ta+" (try OpenGL instead of ANGLE)"));J=ta}var R={precision:P,supportsVertexTextures:gc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,
|
|
|
-useFog:d.fog,fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:Ia,skinning:d.skinning,maxBones:J,useVertexTexture:fc&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:I.maxMorphTargets,maxMorphNormals:I.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:w,shadowMapEnabled:I.shadowMapEnabled&&e.receiveShadow&&0<w,shadowMapType:I.shadowMapType,shadowMapDebug:I.shadowMapDebug,
|
|
|
-shadowMapCascade:I.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},M=[];m?M.push(m):(M.push(d.fragmentShader),M.push(d.vertexShader));if(void 0!==d.defines)for(var V in d.defines)M.push(V),M.push(d.defines[V]);for(V in R)M.push(V),M.push(R[V]);for(var Ga=M.join(),W,Ta=0,Ja=Na.length;Ta<Ja;Ta++){var da=Na[Ta];if(da.code===Ga){W=da;W.usedTimes++;break}}void 0===W&&(W=new THREE.WebGLProgram(I,Ga,d,R),
|
|
|
-Na.push(W),I.info.memory.programs=Na.length);d.program=W;var xa=W.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var Ca,la="morphTarget",Ra=0;Ra<I.maxMorphTargets;Ra++)Ca=la+Ra,0<=xa[Ca]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,la="morphNormal",Ra=0;Ra<I.maxMorphNormals;Ra++)Ca=la+Ra,0<=xa[Ca]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var X in d.__webglShader.uniforms){var Y=d.program.uniforms[X];Y&&d.uniformsList.push([d.__webglShader.uniforms[X],
|
|
|
-Y])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(I.maxMorphTargets));var Z=!1,hb=!1,sa=!1,ra=d.program,oa=ra.uniforms,O=d.__webglShader.uniforms;ra.id!==ub&&(l.useProgram(ra.program),ub=ra.id,sa=hb=Z=!0);d.id!==tb&&(-1===tb&&(sa=!0),tb=d.id,hb=!0);if(Z||a!==Tb)l.uniformMatrix4fv(oa.projectionMatrix,!1,a.projectionMatrix.elements),Ia&&l.uniform1f(oa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Tb&&(Tb=a),(d instanceof THREE.ShaderMaterial||
|
|
|
-d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==oa.cameraPosition&&(Qa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(oa.cameraPosition,Qa.x,Qa.y,Qa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==oa.viewMatrix&&l.uniformMatrix4fv(oa.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==oa.bindMatrix&&l.uniformMatrix4fv(oa.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&
|
|
|
-null!==oa.bindMatrixInverse&&l.uniformMatrix4fv(oa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),fc&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==oa.boneTexture){var ya=C();l.uniform1i(oa.boneTexture,ya);I.setTexture(e.skeleton.boneTexture,ya)}null!==oa.boneTextureWidth&&l.uniform1i(oa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==oa.boneTextureHeight&&l.uniform1i(oa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==oa.boneGlobalMatrices&&
|
|
|
-l.uniformMatrix4fv(oa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(hb){c&&d.fog&&(O.fogColor.value=c.color,c instanceof THREE.Fog?(O.fogNear.value=c.near,O.fogFar.value=c.far):c instanceof THREE.FogExp2&&(O.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ub){var sa=!0,ma,ha,ka,Ea=0,Fa=0,Xa=0,Aa,$a,jb,ga,kb,lb,ua=Jc,gb=ua.directional.colors,Oa=ua.directional.positions,mb=ua.point.colors,ab=ua.point.positions,nb=ua.point.distances,
|
|
|
-Gb=ua.spot.colors,Mb=ua.spot.positions,ib=ua.spot.distances,Ya=ua.spot.directions,Xb=ua.spot.anglesCos,Fb=ua.spot.exponents,wb=ua.hemi.skyColors,Za=ua.hemi.groundColors,Pa=ua.hemi.positions,bb=0,Ka=0,fa=0,qa=0,E=0,La=0,cb=0,Nb=0,xb=0,db=0,za=0,Ma=0;ma=0;for(ha=b.length;ma<ha;ma++)ka=b[ma],ka.onlyShadow||(Aa=ka.color,ga=ka.intensity,lb=ka.distance,ka instanceof THREE.AmbientLight?ka.visible&&(I.gammaInput?(Ea+=Aa.r*Aa.r,Fa+=Aa.g*Aa.g,Xa+=Aa.b*Aa.b):(Ea+=Aa.r,Fa+=Aa.g,Xa+=Aa.b)):ka instanceof THREE.DirectionalLight?
|
|
|
-(E+=1,ka.visible&&(va.setFromMatrixPosition(ka.matrixWorld),Qa.setFromMatrixPosition(ka.target.matrixWorld),va.sub(Qa),va.normalize(),xb=3*bb,Oa[xb]=va.x,Oa[xb+1]=va.y,Oa[xb+2]=va.z,I.gammaInput?y(gb,xb,Aa,ga*ga):D(gb,xb,Aa,ga),bb+=1)):ka instanceof THREE.PointLight?(La+=1,ka.visible&&(db=3*Ka,I.gammaInput?y(mb,db,Aa,ga*ga):D(mb,db,Aa,ga),Qa.setFromMatrixPosition(ka.matrixWorld),ab[db]=Qa.x,ab[db+1]=Qa.y,ab[db+2]=Qa.z,nb[Ka]=lb,Ka+=1)):ka instanceof THREE.SpotLight?(cb+=1,ka.visible&&(za=3*fa,I.gammaInput?
|
|
|
-y(Gb,za,Aa,ga*ga):D(Gb,za,Aa,ga),va.setFromMatrixPosition(ka.matrixWorld),Mb[za]=va.x,Mb[za+1]=va.y,Mb[za+2]=va.z,ib[fa]=lb,Qa.setFromMatrixPosition(ka.target.matrixWorld),va.sub(Qa),va.normalize(),Ya[za]=va.x,Ya[za+1]=va.y,Ya[za+2]=va.z,Xb[fa]=Math.cos(ka.angle),Fb[fa]=ka.exponent,fa+=1)):ka instanceof THREE.HemisphereLight&&(Nb+=1,ka.visible&&(va.setFromMatrixPosition(ka.matrixWorld),va.normalize(),Ma=3*qa,Pa[Ma]=va.x,Pa[Ma+1]=va.y,Pa[Ma+2]=va.z,$a=ka.color,jb=ka.groundColor,I.gammaInput?(kb=ga*
|
|
|
-ga,y(wb,Ma,$a,kb),y(Za,Ma,jb,kb)):(D(wb,Ma,$a,ga),D(Za,Ma,jb,ga)),qa+=1)));ma=3*bb;for(ha=Math.max(gb.length,3*E);ma<ha;ma++)gb[ma]=0;ma=3*Ka;for(ha=Math.max(mb.length,3*La);ma<ha;ma++)mb[ma]=0;ma=3*fa;for(ha=Math.max(Gb.length,3*cb);ma<ha;ma++)Gb[ma]=0;ma=3*qa;for(ha=Math.max(wb.length,3*Nb);ma<ha;ma++)wb[ma]=0;ma=3*qa;for(ha=Math.max(Za.length,3*Nb);ma<ha;ma++)Za[ma]=0;ua.directional.length=bb;ua.point.length=Ka;ua.spot.length=fa;ua.hemi.length=qa;ua.ambient[0]=Ea;ua.ambient[1]=Fa;ua.ambient[2]=
|
|
|
-Xa;Ub=!1}if(sa){var pa=Jc;O.ambientLightColor.value=pa.ambient;O.directionalLightColor.value=pa.directional.colors;O.directionalLightDirection.value=pa.directional.positions;O.pointLightColor.value=pa.point.colors;O.pointLightPosition.value=pa.point.positions;O.pointLightDistance.value=pa.point.distances;O.spotLightColor.value=pa.spot.colors;O.spotLightPosition.value=pa.spot.positions;O.spotLightDistance.value=pa.spot.distances;O.spotLightDirection.value=pa.spot.directions;O.spotLightAngleCos.value=
|
|
|
-pa.spot.anglesCos;O.spotLightExponent.value=pa.spot.exponents;O.hemisphereLightSkyColor.value=pa.hemi.skyColors;O.hemisphereLightGroundColor.value=pa.hemi.groundColors;O.hemisphereLightDirection.value=pa.hemi.positions;F(O,!0)}else F(O,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){O.opacity.value=d.opacity;I.gammaInput?O.diffuse.value.copyGammaToLinear(d.color):O.diffuse.value=d.color;O.map.value=d.map;O.lightMap.value=d.lightMap;
|
|
|
-O.specularMap.value=d.specularMap;O.alphaMap.value=d.alphaMap;d.bumpMap&&(O.bumpMap.value=d.bumpMap,O.bumpScale.value=d.bumpScale);d.normalMap&&(O.normalMap.value=d.normalMap,O.normalScale.value.copy(d.normalScale));var Ba;d.map?Ba=d.map:d.specularMap?Ba=d.specularMap:d.normalMap?Ba=d.normalMap:d.bumpMap?Ba=d.bumpMap:d.alphaMap&&(Ba=d.alphaMap);if(void 0!==Ba){var vb=Ba.offset,Eb=Ba.repeat;O.offsetRepeat.value.set(vb.x,vb.y,Eb.x,Eb.y)}O.envMap.value=d.envMap;O.flipEnvMap.value=d.envMap instanceof
|
|
|
-THREE.WebGLRenderTargetCube?1:-1;O.reflectivity.value=d.reflectivity;O.refractionRatio.value=d.refractionRatio;O.combine.value=d.combine;O.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(O.diffuse.value=d.color,O.opacity.value=d.opacity,O.dashSize.value=d.dashSize,O.totalSize.value=d.dashSize+d.gapSize,O.scale.value=d.scale):d instanceof
|
|
|
-THREE.PointCloudMaterial?(O.psColor.value=d.color,O.opacity.value=d.opacity,O.size.value=d.size,O.scale.value=N.height/2,O.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(O.shininess.value=d.shininess,I.gammaInput?(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive),O.specular.value.copyGammaToLinear(d.specular)):(O.ambient.value=d.ambient,O.emissive.value=d.emissive,O.specular.value=d.specular),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof
|
|
|
-THREE.MeshLambertMaterial?(I.gammaInput?(O.ambient.value.copyGammaToLinear(d.ambient),O.emissive.value.copyGammaToLinear(d.emissive)):(O.ambient.value=d.ambient,O.emissive.value=d.emissive),d.wrapAround&&O.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(O.mNear.value=a.near,O.mFar.value=a.far,O.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(O.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&O.shadowMatrix)for(var yb=0,A=0,Kb=b.length;A<Kb;A++){var Sa=
|
|
|
-b[A];Sa.castShadow&&(Sa instanceof THREE.SpotLight||Sa instanceof THREE.DirectionalLight&&!Sa.shadowCascade)&&(O.shadowMap.value[yb]=Sa.shadowMap,O.shadowMapSize.value[yb]=Sa.shadowMapSize,O.shadowMatrix.value[yb]=Sa.shadowMatrix,O.shadowDarkness.value[yb]=Sa.shadowDarkness,O.shadowBias.value[yb]=Sa.shadowBias,yb++)}for(var Ha=d.uniformsList,eb,zb,fb,sb=0,Lb=Ha.length;sb<Lb;sb++){var ea=Ha[sb][0];if(!1!==ea.needsUpdate){var Jb=ea.type,H=ea.value,$=Ha[sb][1];switch(Jb){case "1i":l.uniform1i($,H);break;
|
|
|
-case "1f":l.uniform1f($,H);break;case "2f":l.uniform2f($,H[0],H[1]);break;case "3f":l.uniform3f($,H[0],H[1],H[2]);break;case "4f":l.uniform4f($,H[0],H[1],H[2],H[3]);break;case "1iv":l.uniform1iv($,H);break;case "3iv":l.uniform3iv($,H);break;case "1fv":l.uniform1fv($,H);break;case "2fv":l.uniform2fv($,H);break;case "3fv":l.uniform3fv($,H);break;case "4fv":l.uniform4fv($,H);break;case "Matrix3fv":l.uniformMatrix3fv($,!1,H);break;case "Matrix4fv":l.uniformMatrix4fv($,!1,H);break;case "i":l.uniform1i($,
|
|
|
-H);break;case "f":l.uniform1f($,H);break;case "v2":l.uniform2f($,H.x,H.y);break;case "v3":l.uniform3f($,H.x,H.y,H.z);break;case "v4":l.uniform4f($,H.x,H.y,H.z,H.w);break;case "c":l.uniform3f($,H.r,H.g,H.b);break;case "iv1":l.uniform1iv($,H);break;case "iv":l.uniform3iv($,H);break;case "fv1":l.uniform1fv($,H);break;case "fv":l.uniform3fv($,H);break;case "v2v":void 0===ea._array&&(ea._array=new Float32Array(2*H.length));for(var aa=0,Ua=H.length;aa<Ua;aa++)fb=2*aa,ea._array[fb]=H[aa].x,ea._array[fb+
|
|
|
-1]=H[aa].y;l.uniform2fv($,ea._array);break;case "v3v":void 0===ea._array&&(ea._array=new Float32Array(3*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)fb=3*aa,ea._array[fb]=H[aa].x,ea._array[fb+1]=H[aa].y,ea._array[fb+2]=H[aa].z;l.uniform3fv($,ea._array);break;case "v4v":void 0===ea._array&&(ea._array=new Float32Array(4*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)fb=4*aa,ea._array[fb]=H[aa].x,ea._array[fb+1]=H[aa].y,ea._array[fb+2]=H[aa].z,ea._array[fb+3]=H[aa].w;l.uniform4fv($,ea._array);break;case "m3":l.uniformMatrix3fv($,
|
|
|
-!1,H.elements);break;case "m3v":void 0===ea._array&&(ea._array=new Float32Array(9*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)H[aa].flattenToArrayOffset(ea._array,9*aa);l.uniformMatrix3fv($,!1,ea._array);break;case "m4":l.uniformMatrix4fv($,!1,H.elements);break;case "m4v":void 0===ea._array&&(ea._array=new Float32Array(16*H.length));aa=0;for(Ua=H.length;aa<Ua;aa++)H[aa].flattenToArrayOffset(ea._array,16*aa);l.uniformMatrix4fv($,!1,ea._array);break;case "t":eb=H;zb=C();l.uniform1i($,zb);if(!eb)continue;
|
|
|
-if(eb instanceof THREE.CubeTexture||eb.image instanceof Array&&6===eb.image.length){var wa=eb,Yb=zb;if(6===wa.image.length)if(wa.needsUpdate){wa.image.__webglTextureCube||(wa.addEventListener("dispose",hc),wa.image.__webglTextureCube=l.createTexture(),I.info.memory.textures++);l.activeTexture(l.TEXTURE0+Yb);l.bindTexture(l.TEXTURE_CUBE_MAP,wa.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,wa.flipY);for(var Zb=wa instanceof THREE.CompressedTexture,$b=[],ba=0;6>ba;ba++)$b[ba]=I.autoScaleCubemaps&&
|
|
|
-!Zb?Q(wa.image[ba],Vc):wa.image[ba];var ac=$b[0],Ob=THREE.Math.isPowerOfTwo(ac.width)&&THREE.Math.isPowerOfTwo(ac.height),ob=G(wa.format),Pb=G(wa.type);S(l.TEXTURE_CUBE_MAP,wa,Ob);for(ba=0;6>ba;ba++)if(Zb)for(var pb,ia=$b[ba].mipmaps,Ab=0,Vb=ia.length;Ab<Vb;Ab++)pb=ia[Ab],wa.format!==THREE.RGBAFormat&&wa.format!==THREE.RGBFormat?-1<kc.indexOf(ob)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ba,Ab,ob,pb.width,pb.height,0,pb.data):console.warn("Attempt to load unsupported compressed texture format"):
|
|
|
-l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ba,Ab,ob,pb.width,pb.height,0,ob,Pb,pb.data);else l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+ba,0,ob,ob,Pb,$b[ba]);wa.generateMipmaps&&Ob&&l.generateMipmap(l.TEXTURE_CUBE_MAP);wa.needsUpdate=!1;if(wa.onUpdate)wa.onUpdate()}else l.activeTexture(l.TEXTURE0+Yb),l.bindTexture(l.TEXTURE_CUBE_MAP,wa.image.__webglTextureCube)}else if(eb instanceof THREE.WebGLRenderTargetCube){var Wb=eb;l.activeTexture(l.TEXTURE0+zb);l.bindTexture(l.TEXTURE_CUBE_MAP,Wb.__webglTexture)}else I.setTexture(eb,
|
|
|
-zb);break;case "tv":void 0===ea._array&&(ea._array=[]);aa=0;for(Ua=ea.value.length;aa<Ua;aa++)ea._array[aa]=C();l.uniform1iv($,ea._array);aa=0;for(Ua=ea.value.length;aa<Ua;aa++)eb=ea.value[aa],zb=ea._array[aa],eb&&I.setTexture(eb,zb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Jb)}}}}l.uniformMatrix4fv(oa.modelViewMatrix,!1,e._modelViewMatrix.elements);oa.normalMatrix&&l.uniformMatrix3fv(oa.normalMatrix,!1,e._normalMatrix.elements);null!==oa.modelMatrix&&l.uniformMatrix4fv(oa.modelMatrix,
|
|
|
-!1,e.matrixWorld.elements);return ra}function F(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=
|
|
|
-b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function C(){var a=ec;a>=Kc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Kc);ec+=1;return a}function B(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function y(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function J(a){a!==
|
|
|
-Lc&&(l.lineWidth(a),Lc=a)}function K(a,b,c){Mc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),Mc=a);!a||Nc===b&&Oc===c||(l.polygonOffset(b,c),Nc=b,Oc=c)}function S(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,G(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,G(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,G(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,G(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),
|
|
|
-l.texParameteri(a,l.TEXTURE_MAG_FILTER,R(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,R(b.minFilter)));jb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,jb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Pc)),b.__oldAnisotropy=b.anisotropy)}function Q(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,
|
|
|
-a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function da(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),
|
|
|
-l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function V(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function R(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
|
|
|
-a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function G(a){if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;
|
|
|
+l.createBuffer();J.info.memory.geometries++;var g=f.vertices.length;f.__vertexArray=new Float32Array(3*g);f.__colorArray=new Float32Array(3*g);f.__lineDistanceArray=new Float32Array(1*g);f.__webglLineCount=g;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&!f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();J.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*
|
|
|
+h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(f,e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive){if(e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)w($a,f,e);else{if(f instanceof THREE.Geometry)for(var k=0,n=f.geometryGroupsList.length;k<n;k++)w($a,f.geometryGroupsList[k],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?w($a,f,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&Ga.push({id:null,
|
|
|
+object:e,opaque:null,transparent:null,z:0});e.__webglActive=!0}var s=$a[e.id];if(s&&(!1===e.frustumCulled||!0===Ac.intersectsObject(e))){var q=e.geometry,t,r,x;if(q instanceof THREE.BufferGeometry)for(var y=q.attributes,B=q.attributesKeys,G=0,E=B.length;G<E;G++){var F=B[G],I=y[F];void 0===I.buffer&&(I.buffer=l.createBuffer(),I.needsUpdate=!0);if(!0===I.needsUpdate){var O="index"===F?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(O,I.buffer);l.bufferData(O,I.array,l.STATIC_DRAW);I.needsUpdate=
|
|
|
+!1}}else if(e instanceof THREE.Mesh){(q.buffersNeedUpdate||q.groupsNeedUpdate)&&v(a,e,q);for(var P=0,R=q.geometryGroupsList.length;P<R;P++)if(t=q.geometryGroupsList[P],x=d(e,t),(q.buffersNeedUpdate||q.groupsNeedUpdate)&&c(t,e),r=x.attributes&&u(x),q.verticesNeedUpdate||q.morphTargetsNeedUpdate||q.elementsNeedUpdate||q.uvsNeedUpdate||q.normalsNeedUpdate||q.colorsNeedUpdate||q.tangentsNeedUpdate||r){var C=t,N=e,ka=l.DYNAMIC_DRAW,Q=!q.dynamic,V=x;if(C.__inittedArrays){var U=V&&void 0!==V.shading&&V.shading===
|
|
|
+THREE.SmoothShading,K=void 0,L=void 0,W=void 0,X=void 0,Ja=void 0,Y=void 0,sa=void 0,Va=void 0,ga=void 0,ya=void 0,ua=void 0,Z=void 0,$=void 0,aa=void 0,wa=void 0,ja=void 0,Ia=void 0,qa=void 0,M=void 0,ub=void 0,oa=void 0,pc=void 0,na=void 0,qc=void 0,rc=void 0,sc=void 0,Aa=void 0,Ea=void 0,Fa=void 0,ia=void 0,Ua=void 0,tb=void 0,va=void 0,Bc=void 0,Na=void 0,Tb=void 0,ab=void 0,nb=void 0,Gb=void 0,Mb=void 0,ib=0,Wa=0,tc=0,uc=0,wb=0,Xa=0,Oa=0,bb=0,Ka=0,ha=0,ta=0,D=0,La=void 0,cb=C.__vertexArray,Nb=
|
|
|
+C.__uvArray,xb=C.__uv2Array,db=C.__normalArray,za=C.__tangentArray,Ma=C.__colorArray,ra=C.__skinIndexArray,Ba=C.__skinWeightArray,ec=C.__morphTargetsArrays,jb=C.__morphNormalsArrays,yb=C.__webglCustomAttributesList,A=void 0,Ya=C.__faceArray,Qa=C.__lineArray,Ha=N.geometry,eb=Ha.elementsNeedUpdate,zb=Ha.uvsNeedUpdate,fb=Ha.normalsNeedUpdate,Uc=Ha.tangentsNeedUpdate,vb=Ha.colorsNeedUpdate,fa=Ha.morphTargetsNeedUpdate,Cc=Ha.vertices,H=C.faces3,ba=Ha.faces,ca=Ha.faceVertexUvs[0],Ra=Ha.faceVertexUvs[1],
|
|
|
+xa=Ha.skinIndices,Yb=Ha.skinWeights,Zb=Ha.morphTargets,$b=Ha.morphNormals;if(Ha.verticesNeedUpdate){K=0;for(L=H.length;K<L;K++)X=ba[H[K]],Z=Cc[X.a],$=Cc[X.b],aa=Cc[X.c],cb[Wa]=Z.x,cb[Wa+1]=Z.y,cb[Wa+2]=Z.z,cb[Wa+3]=$.x,cb[Wa+4]=$.y,cb[Wa+5]=$.z,cb[Wa+6]=aa.x,cb[Wa+7]=aa.y,cb[Wa+8]=aa.z,Wa+=9;l.bindBuffer(l.ARRAY_BUFFER,C.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,cb,ka)}if(fa)for(Na=0,Tb=Zb.length;Na<Tb;Na++){K=ta=0;for(L=H.length;K<L;K++)Gb=H[K],X=ba[Gb],Z=Zb[Na].vertices[X.a],$=Zb[Na].vertices[X.b],
|
|
|
+aa=Zb[Na].vertices[X.c],ab=ec[Na],ab[ta]=Z.x,ab[ta+1]=Z.y,ab[ta+2]=Z.z,ab[ta+3]=$.x,ab[ta+4]=$.y,ab[ta+5]=$.z,ab[ta+6]=aa.x,ab[ta+7]=aa.y,ab[ta+8]=aa.z,V.morphNormals&&(U?(Mb=$b[Na].vertexNormals[Gb],qa=Mb.a,M=Mb.b,ub=Mb.c):ub=M=qa=$b[Na].faceNormals[Gb],nb=jb[Na],nb[ta]=qa.x,nb[ta+1]=qa.y,nb[ta+2]=qa.z,nb[ta+3]=M.x,nb[ta+4]=M.y,nb[ta+5]=M.z,nb[ta+6]=ub.x,nb[ta+7]=ub.y,nb[ta+8]=ub.z),ta+=9;l.bindBuffer(l.ARRAY_BUFFER,C.__webglMorphTargetsBuffers[Na]);l.bufferData(l.ARRAY_BUFFER,ec[Na],ka);V.morphNormals&&
|
|
|
+(l.bindBuffer(l.ARRAY_BUFFER,C.__webglMorphNormalsBuffers[Na]),l.bufferData(l.ARRAY_BUFFER,jb[Na],ka))}if(Yb.length){K=0;for(L=H.length;K<L;K++)X=ba[H[K]],qc=Yb[X.a],rc=Yb[X.b],sc=Yb[X.c],Ba[ha]=qc.x,Ba[ha+1]=qc.y,Ba[ha+2]=qc.z,Ba[ha+3]=qc.w,Ba[ha+4]=rc.x,Ba[ha+5]=rc.y,Ba[ha+6]=rc.z,Ba[ha+7]=rc.w,Ba[ha+8]=sc.x,Ba[ha+9]=sc.y,Ba[ha+10]=sc.z,Ba[ha+11]=sc.w,Aa=xa[X.a],Ea=xa[X.b],Fa=xa[X.c],ra[ha]=Aa.x,ra[ha+1]=Aa.y,ra[ha+2]=Aa.z,ra[ha+3]=Aa.w,ra[ha+4]=Ea.x,ra[ha+5]=Ea.y,ra[ha+6]=Ea.z,ra[ha+7]=Ea.w,ra[ha+
|
|
|
+8]=Fa.x,ra[ha+9]=Fa.y,ra[ha+10]=Fa.z,ra[ha+11]=Fa.w,ha+=12;0<ha&&(l.bindBuffer(l.ARRAY_BUFFER,C.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,ra,ka),l.bindBuffer(l.ARRAY_BUFFER,C.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,Ba,ka))}if(vb){K=0;for(L=H.length;K<L;K++)X=ba[H[K]],sa=X.vertexColors,Va=X.color,3===sa.length&&V.vertexColors===THREE.VertexColors?(oa=sa[0],pc=sa[1],na=sa[2]):na=pc=oa=Va,Ma[Ka]=oa.r,Ma[Ka+1]=oa.g,Ma[Ka+2]=oa.b,Ma[Ka+3]=pc.r,Ma[Ka+4]=pc.g,Ma[Ka+5]=pc.b,Ma[Ka+
|
|
|
+6]=na.r,Ma[Ka+7]=na.g,Ma[Ka+8]=na.b,Ka+=9;0<Ka&&(l.bindBuffer(l.ARRAY_BUFFER,C.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ma,ka))}if(Uc&&Ha.hasTangents){K=0;for(L=H.length;K<L;K++)X=ba[H[K]],ga=X.vertexTangents,wa=ga[0],ja=ga[1],Ia=ga[2],za[Oa]=wa.x,za[Oa+1]=wa.y,za[Oa+2]=wa.z,za[Oa+3]=wa.w,za[Oa+4]=ja.x,za[Oa+5]=ja.y,za[Oa+6]=ja.z,za[Oa+7]=ja.w,za[Oa+8]=Ia.x,za[Oa+9]=Ia.y,za[Oa+10]=Ia.z,za[Oa+11]=Ia.w,Oa+=12;l.bindBuffer(l.ARRAY_BUFFER,C.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,za,
|
|
|
+ka)}if(fb){K=0;for(L=H.length;K<L;K++)if(X=ba[H[K]],Ja=X.vertexNormals,Y=X.normal,3===Ja.length&&U)for(ia=0;3>ia;ia++)tb=Ja[ia],db[Xa]=tb.x,db[Xa+1]=tb.y,db[Xa+2]=tb.z,Xa+=3;else for(ia=0;3>ia;ia++)db[Xa]=Y.x,db[Xa+1]=Y.y,db[Xa+2]=Y.z,Xa+=3;l.bindBuffer(l.ARRAY_BUFFER,C.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,db,ka)}if(zb&&ca){K=0;for(L=H.length;K<L;K++)if(W=H[K],ya=ca[W],void 0!==ya)for(ia=0;3>ia;ia++)va=ya[ia],Nb[tc]=va.x,Nb[tc+1]=va.y,tc+=2;0<tc&&(l.bindBuffer(l.ARRAY_BUFFER,C.__webglUVBuffer),
|
|
|
+l.bufferData(l.ARRAY_BUFFER,Nb,ka))}if(zb&&Ra){K=0;for(L=H.length;K<L;K++)if(W=H[K],ua=Ra[W],void 0!==ua)for(ia=0;3>ia;ia++)Bc=ua[ia],xb[uc]=Bc.x,xb[uc+1]=Bc.y,uc+=2;0<uc&&(l.bindBuffer(l.ARRAY_BUFFER,C.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,xb,ka))}if(eb){K=0;for(L=H.length;K<L;K++)Ya[wb]=ib,Ya[wb+1]=ib+1,Ya[wb+2]=ib+2,wb+=3,Qa[bb]=ib,Qa[bb+1]=ib+1,Qa[bb+2]=ib,Qa[bb+3]=ib+2,Qa[bb+4]=ib+1,Qa[bb+5]=ib+2,bb+=6,ib+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,C.__webglFaceBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,
|
|
|
+Ya,ka);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,C.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Qa,ka)}if(yb)for(ia=0,Ua=yb.length;ia<Ua;ia++)if(A=yb[ia],A.__original.needsUpdate){D=0;if(1===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(K=0,L=H.length;K<L;K++)X=ba[H[K]],A.array[D]=A.value[X.a],A.array[D+1]=A.value[X.b],A.array[D+2]=A.value[X.c],D+=3;else{if("faces"===A.boundTo)for(K=0,L=H.length;K<L;K++)La=A.value[H[K]],A.array[D]=La,A.array[D+1]=La,A.array[D+2]=La,D+=3}else if(2===
|
|
|
+A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(K=0,L=H.length;K<L;K++)X=ba[H[K]],Z=A.value[X.a],$=A.value[X.b],aa=A.value[X.c],A.array[D]=Z.x,A.array[D+1]=Z.y,A.array[D+2]=$.x,A.array[D+3]=$.y,A.array[D+4]=aa.x,A.array[D+5]=aa.y,D+=6;else{if("faces"===A.boundTo)for(K=0,L=H.length;K<L;K++)aa=$=Z=La=A.value[H[K]],A.array[D]=Z.x,A.array[D+1]=Z.y,A.array[D+2]=$.x,A.array[D+3]=$.y,A.array[D+4]=aa.x,A.array[D+5]=aa.y,D+=6}else if(3===A.size){var da;da="c"===A.type?["r","g","b"]:["x","y","z"];
|
|
|
+if(void 0===A.boundTo||"vertices"===A.boundTo)for(K=0,L=H.length;K<L;K++)X=ba[H[K]],Z=A.value[X.a],$=A.value[X.b],aa=A.value[X.c],A.array[D]=Z[da[0]],A.array[D+1]=Z[da[1]],A.array[D+2]=Z[da[2]],A.array[D+3]=$[da[0]],A.array[D+4]=$[da[1]],A.array[D+5]=$[da[2]],A.array[D+6]=aa[da[0]],A.array[D+7]=aa[da[1]],A.array[D+8]=aa[da[2]],D+=9;else if("faces"===A.boundTo)for(K=0,L=H.length;K<L;K++)aa=$=Z=La=A.value[H[K]],A.array[D]=Z[da[0]],A.array[D+1]=Z[da[1]],A.array[D+2]=Z[da[2]],A.array[D+3]=$[da[0]],A.array[D+
|
|
|
+4]=$[da[1]],A.array[D+5]=$[da[2]],A.array[D+6]=aa[da[0]],A.array[D+7]=aa[da[1]],A.array[D+8]=aa[da[2]],D+=9;else if("faceVertices"===A.boundTo)for(K=0,L=H.length;K<L;K++)La=A.value[H[K]],Z=La[0],$=La[1],aa=La[2],A.array[D]=Z[da[0]],A.array[D+1]=Z[da[1]],A.array[D+2]=Z[da[2]],A.array[D+3]=$[da[0]],A.array[D+4]=$[da[1]],A.array[D+5]=$[da[2]],A.array[D+6]=aa[da[0]],A.array[D+7]=aa[da[1]],A.array[D+8]=aa[da[2]],D+=9}else if(4===A.size)if(void 0===A.boundTo||"vertices"===A.boundTo)for(K=0,L=H.length;K<
|
|
|
+L;K++)X=ba[H[K]],Z=A.value[X.a],$=A.value[X.b],aa=A.value[X.c],A.array[D]=Z.x,A.array[D+1]=Z.y,A.array[D+2]=Z.z,A.array[D+3]=Z.w,A.array[D+4]=$.x,A.array[D+5]=$.y,A.array[D+6]=$.z,A.array[D+7]=$.w,A.array[D+8]=aa.x,A.array[D+9]=aa.y,A.array[D+10]=aa.z,A.array[D+11]=aa.w,D+=12;else if("faces"===A.boundTo)for(K=0,L=H.length;K<L;K++)aa=$=Z=La=A.value[H[K]],A.array[D]=Z.x,A.array[D+1]=Z.y,A.array[D+2]=Z.z,A.array[D+3]=Z.w,A.array[D+4]=$.x,A.array[D+5]=$.y,A.array[D+6]=$.z,A.array[D+7]=$.w,A.array[D+8]=
|
|
|
+aa.x,A.array[D+9]=aa.y,A.array[D+10]=aa.z,A.array[D+11]=aa.w,D+=12;else if("faceVertices"===A.boundTo)for(K=0,L=H.length;K<L;K++)La=A.value[H[K]],Z=La[0],$=La[1],aa=La[2],A.array[D]=Z.x,A.array[D+1]=Z.y,A.array[D+2]=Z.z,A.array[D+3]=Z.w,A.array[D+4]=$.x,A.array[D+5]=$.y,A.array[D+6]=$.z,A.array[D+7]=$.w,A.array[D+8]=aa.x,A.array[D+9]=aa.y,A.array[D+10]=aa.z,A.array[D+11]=aa.w,D+=12;l.bindBuffer(l.ARRAY_BUFFER,A.buffer);l.bufferData(l.ARRAY_BUFFER,A.array,ka)}Q&&(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)}}q.verticesNeedUpdate=!1;q.morphTargetsNeedUpdate=!1;q.elementsNeedUpdate=!1;q.uvsNeedUpdate=!1;q.normalsNeedUpdate=!1;q.colorsNeedUpdate=!1;q.tangentsNeedUpdate=!1;q.buffersNeedUpdate=!1;x.attributes&&z(x)}else if(e instanceof THREE.Line){x=d(e,q);r=x.attributes&&u(x);if(q.verticesNeedUpdate||q.colorsNeedUpdate||
|
|
|
+q.lineDistancesNeedUpdate||r){var ac=l.DYNAMIC_DRAW,Ob,ob,Pb,pb,la,Ab,Ub=q.vertices,Xb=q.colors,Fb=q.lineDistances,Lb=Ub.length,Jb=Xb.length,Vb=Fb.length,kb=q.__vertexArray,lb=q.__colorArray,Kb=q.__lineDistanceArray,mc=q.colorsNeedUpdate,nc=q.lineDistancesNeedUpdate,mb=q.__webglCustomAttributesList,gb,sb,Da,ic,Sa,pa;if(q.verticesNeedUpdate){for(Ob=0;Ob<Lb;Ob++)pb=Ub[Ob],la=3*Ob,kb[la]=pb.x,kb[la+1]=pb.y,kb[la+2]=pb.z;l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,kb,
|
|
|
+ac)}if(mc){for(ob=0;ob<Jb;ob++)Ab=Xb[ob],la=3*ob,lb[la]=Ab.r,lb[la+1]=Ab.g,lb[la+2]=Ab.b;l.bindBuffer(l.ARRAY_BUFFER,q.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,lb,ac)}if(nc){for(Pb=0;Pb<Vb;Pb++)Kb[Pb]=Fb[Pb];l.bindBuffer(l.ARRAY_BUFFER,q.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Kb,ac)}if(mb)for(gb=0,sb=mb.length;gb<sb;gb++)if(pa=mb[gb],pa.needsUpdate&&(void 0===pa.boundTo||"vertices"===pa.boundTo)){la=0;ic=pa.value.length;if(1===pa.size)for(Da=0;Da<ic;Da++)pa.array[Da]=pa.value[Da];
|
|
|
+else if(2===pa.size)for(Da=0;Da<ic;Da++)Sa=pa.value[Da],pa.array[la]=Sa.x,pa.array[la+1]=Sa.y,la+=2;else if(3===pa.size)if("c"===pa.type)for(Da=0;Da<ic;Da++)Sa=pa.value[Da],pa.array[la]=Sa.r,pa.array[la+1]=Sa.g,pa.array[la+2]=Sa.b,la+=3;else for(Da=0;Da<ic;Da++)Sa=pa.value[Da],pa.array[la]=Sa.x,pa.array[la+1]=Sa.y,pa.array[la+2]=Sa.z,la+=3;else if(4===pa.size)for(Da=0;Da<ic;Da++)Sa=pa.value[Da],pa.array[la]=Sa.x,pa.array[la+1]=Sa.y,pa.array[la+2]=Sa.z,pa.array[la+3]=Sa.w,la+=4;l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+pa.buffer);l.bufferData(l.ARRAY_BUFFER,pa.array,ac)}}q.verticesNeedUpdate=!1;q.colorsNeedUpdate=!1;q.lineDistancesNeedUpdate=!1;x.attributes&&z(x)}else if(e instanceof THREE.PointCloud){x=d(e,q);r=x.attributes&&u(x);if(q.verticesNeedUpdate||q.colorsNeedUpdate||e.sortParticles||r){var fc=l.DYNAMIC_DRAW,Ta,Bb,Cb,T,Db,Qb,wc=q.vertices,gc=wc.length,hc=q.colors,kc=hc.length,bc=q.__vertexArray,cc=q.__colorArray,Hb=q.__sortArray,Wb=q.verticesNeedUpdate,lc=q.colorsNeedUpdate,Ib=q.__webglCustomAttributesList,
|
|
|
+qb,jc,ea,rb,ma,S;if(e.sortParticles){Dc.copy(xc);Dc.multiply(e.matrixWorld);for(Ta=0;Ta<gc;Ta++)Cb=wc[Ta],Pa.copy(Cb),Pa.applyProjection(Dc),Hb[Ta]=[Pa.z,Ta];Hb.sort(p);for(Ta=0;Ta<gc;Ta++)Cb=wc[Hb[Ta][1]],T=3*Ta,bc[T]=Cb.x,bc[T+1]=Cb.y,bc[T+2]=Cb.z;for(Bb=0;Bb<kc;Bb++)T=3*Bb,Qb=hc[Hb[Bb][1]],cc[T]=Qb.r,cc[T+1]=Qb.g,cc[T+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(S=Ib[qb],void 0===S.boundTo||"vertices"===S.boundTo)if(T=0,rb=S.value.length,1===S.size)for(ea=0;ea<rb;ea++)Db=Hb[ea][1],S.array[ea]=
|
|
|
+S.value[Db];else if(2===S.size)for(ea=0;ea<rb;ea++)Db=Hb[ea][1],ma=S.value[Db],S.array[T]=ma.x,S.array[T+1]=ma.y,T+=2;else if(3===S.size)if("c"===S.type)for(ea=0;ea<rb;ea++)Db=Hb[ea][1],ma=S.value[Db],S.array[T]=ma.r,S.array[T+1]=ma.g,S.array[T+2]=ma.b,T+=3;else for(ea=0;ea<rb;ea++)Db=Hb[ea][1],ma=S.value[Db],S.array[T]=ma.x,S.array[T+1]=ma.y,S.array[T+2]=ma.z,T+=3;else if(4===S.size)for(ea=0;ea<rb;ea++)Db=Hb[ea][1],ma=S.value[Db],S.array[T]=ma.x,S.array[T+1]=ma.y,S.array[T+2]=ma.z,S.array[T+3]=ma.w,
|
|
|
+T+=4}else{if(Wb)for(Ta=0;Ta<gc;Ta++)Cb=wc[Ta],T=3*Ta,bc[T]=Cb.x,bc[T+1]=Cb.y,bc[T+2]=Cb.z;if(lc)for(Bb=0;Bb<kc;Bb++)Qb=hc[Bb],T=3*Bb,cc[T]=Qb.r,cc[T+1]=Qb.g,cc[T+2]=Qb.b;if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(S=Ib[qb],S.needsUpdate&&(void 0===S.boundTo||"vertices"===S.boundTo))if(rb=S.value.length,T=0,1===S.size)for(ea=0;ea<rb;ea++)S.array[ea]=S.value[ea];else if(2===S.size)for(ea=0;ea<rb;ea++)ma=S.value[ea],S.array[T]=ma.x,S.array[T+1]=ma.y,T+=2;else if(3===S.size)if("c"===S.type)for(ea=0;ea<
|
|
|
+rb;ea++)ma=S.value[ea],S.array[T]=ma.r,S.array[T+1]=ma.g,S.array[T+2]=ma.b,T+=3;else for(ea=0;ea<rb;ea++)ma=S.value[ea],S.array[T]=ma.x,S.array[T+1]=ma.y,S.array[T+2]=ma.z,T+=3;else if(4===S.size)for(ea=0;ea<rb;ea++)ma=S.value[ea],S.array[T]=ma.x,S.array[T+1]=ma.y,S.array[T+2]=ma.z,S.array[T+3]=ma.w,T+=4}if(Wb||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,bc,fc);if(lc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,q.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,
|
|
|
+cc,fc);if(Ib)for(qb=0,jc=Ib.length;qb<jc;qb++)if(S=Ib[qb],S.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,S.buffer),l.bufferData(l.ARRAY_BUFFER,S.array,fc)}q.verticesNeedUpdate=!1;q.colorsNeedUpdate=!1;x.attributes&&z(x)}for(var dc=0,Eb=s.length;dc<Eb;dc++){var yc=s[dc],Rb=yc,oc=Rb.object,vc=Rb.buffer,zc=oc.geometry,Sb=oc.material;Sb instanceof THREE.MeshFaceMaterial?(Sb=Sb.materials[zc instanceof THREE.BufferGeometry?0:vc.materialIndex],Rb.material=Sb,Sb.transparent?hb.push(Rb):Za.push(Rb)):
|
|
|
+Sb&&(Rb.material=Sb,Sb.transparent?hb.push(Rb):Za.push(Rb));yc.render=!0;!0===J.sortObjects&&(null!==e.renderDepth?yc.z=e.renderDepth:(Pa.setFromMatrixPosition(e.matrixWorld),Pa.applyProjection(xc),yc.z=Pa.z))}}}dc=0;for(Eb=e.children.length;dc<Eb;dc++)m(a,e.children[dc])}}function q(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].render(b,c,zc,Gc)}function t(a,b,c,d,e,f){for(var g,h,k,l=a.length-1;-1!==l;l--){g=a[l];h=g.object;k=g.buffer;B(h,b);if(f)g=f;else{g=g.material;if(!g)continue;
|
|
|
+e&&J.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);J.setDepthTest(g.depthTest);J.setDepthWrite(g.depthWrite);I(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}J.setMaterialFaces(g);k instanceof THREE.BufferGeometry?J.renderBufferDirect(b,c,d,g,k,h):J.renderBuffer(b,c,d,g,k,h)}}function s(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<m;l++)if(h=a[l],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&J.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst);
|
|
|
+J.setDepthTest(h.depthTest);J.setDepthWrite(h.depthWrite);I(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}J.renderImmediateObject(c,d,e,h,k)}}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=!1;a=b.material;if(void 0===d.geometryGroups||d.groupsNeedUpdate)delete $a[b.id],d.makeGroups(a instanceof THREE.MeshFaceMaterial,Fb?4294967296:65535),d.groupsNeedUpdate=!1;for(var f=0,g=d.geometryGroupsList.length;f<
|
|
|
+g;f++){a=d.geometryGroupsList[f];if(a.__webglVertexBuffer)e=!1;else{e=a;e.__webglVertexBuffer=l.createBuffer();e.__webglNormalBuffer=l.createBuffer();e.__webglTangentBuffer=l.createBuffer();e.__webglColorBuffer=l.createBuffer();e.__webglUVBuffer=l.createBuffer();e.__webglUV2Buffer=l.createBuffer();e.__webglSkinIndicesBuffer=l.createBuffer();e.__webglSkinWeightsBuffer=l.createBuffer();e.__webglFaceBuffer=l.createBuffer();e.__webglLineBuffer=l.createBuffer();var h=void 0,k=void 0;if(e.numMorphTargets)for(e.__webglMorphTargetsBuffers=
|
|
|
+[],h=0,k=e.numMorphTargets;h<k;h++)e.__webglMorphTargetsBuffers.push(l.createBuffer());if(e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],h=0,k=e.numMorphNormals;h<k;h++)e.__webglMorphNormalsBuffers.push(l.createBuffer());J.info.memory.geometries++;c(a,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;e=d.colorsNeedUpdate=!0}(e||void 0===b.__webglActive)&&w($a,a,b)}b.__webglActive=!0}function w(a,
|
|
|
+b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function z(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;ec=0;if(d.needsUpdate){d.program&&Hc(d);d.addEventListener("dispose",Ic);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof
|
|
|
+THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var p=
|
|
|
+0,q=0,s=0,t=0,r=0,u=b.length;r<u;r++){var w=b[r];w.onlyShadow||!1===w.visible||(w instanceof THREE.DirectionalLight&&p++,w instanceof THREE.PointLight&&q++,w instanceof THREE.SpotLight&&s++,w instanceof THREE.HemisphereLight&&t++)}f=p;g=q;h=s;k=t;for(var v,x=0,z=0,B=b.length;z<B;z++){var I=b[z];I.castShadow&&(I instanceof THREE.SpotLight&&x++,I instanceof THREE.DirectionalLight&&!I.shadowCascade&&x++)}v=x;var R;if(fc&&e&&e.skeleton&&e.skeleton.useVertexTexture)R=1024;else{var ka=l.getParameter(l.MAX_VERTEX_UNIFORM_VECTORS),
|
|
|
+N=Math.floor((ka-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(N=Math.min(e.skeleton.bones.length,N),N<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+N+" (try OpenGL instead of ANGLE)"));R=N}var Q={precision:L,supportsVertexTextures:gc,map:!!d.map,envMap:!!d.envMap,lightMap:!!d.lightMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,vertexColors:d.vertexColors,fog:c,useFog:d.fog,
|
|
|
+fogExp:c instanceof THREE.FogExp2,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:Ia,skinning:d.skinning,maxBones:R,useVertexTexture:fc&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:J.maxMorphTargets,maxMorphNormals:J.maxMorphNormals,maxDirLights:f,maxPointLights:g,maxSpotLights:h,maxHemiLights:k,maxShadows:v,shadowMapEnabled:J.shadowMapEnabled&&e.receiveShadow&&0<v,shadowMapType:J.shadowMapType,shadowMapDebug:J.shadowMapDebug,
|
|
|
+shadowMapCascade:J.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},K=[];m?K.push(m):(K.push(d.fragmentShader),K.push(d.vertexShader));if(void 0!==d.defines)for(var U in d.defines)K.push(U),K.push(d.defines[U]);for(U in Q)K.push(U),K.push(Q[U]);for(var W=K.join(),X,Ca=0,$a=Va.length;Ca<$a;Ca++){var Ja=Va[Ca];if(Ja.code===W){X=Ja;X.usedTimes++;break}}void 0===X&&(X=new THREE.WebGLProgram(J,W,d,Q),Va.push(X),
|
|
|
+J.info.memory.programs=Va.length);d.program=X;var sa=X.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var Y,Ga="morphTarget",ga=0;ga<J.maxMorphTargets;ga++)Y=Ga+ga,0<=sa[Y]&&d.numSupportedMorphTargets++}if(d.morphNormals)for(d.numSupportedMorphNormals=0,Ga="morphNormal",ga=0;ga<J.maxMorphNormals;ga++)Y=Ga+ga,0<=sa[Y]&&d.numSupportedMorphNormals++;d.uniformsList=[];for(var Z in d.__webglShader.uniforms){var $=d.program.uniforms[Z];$&&d.uniformsList.push([d.__webglShader.uniforms[Z],
|
|
|
+$])}d.needsUpdate=!1}d.morphTargets&&!e.__webglMorphTargetInfluences&&(e.__webglMorphTargetInfluences=new Float32Array(J.maxMorphTargets));var aa=!1,hb=!1,Za=!1,ua=d.program,qa=ua.uniforms,M=d.__webglShader.uniforms;ua.id!==ub&&(l.useProgram(ua.program),ub=ua.id,Za=hb=aa=!0);d.id!==tb&&(-1===tb&&(Za=!0),tb=d.id,hb=!0);if(aa||a!==Tb)l.uniformMatrix4fv(qa.projectionMatrix,!1,a.projectionMatrix.elements),Ia&&l.uniform1f(qa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Tb&&(Tb=a),(d instanceof THREE.ShaderMaterial||
|
|
|
+d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==qa.cameraPosition&&(Pa.setFromMatrixPosition(a.matrixWorld),l.uniform3f(qa.cameraPosition,Pa.x,Pa.y,Pa.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==qa.viewMatrix&&l.uniformMatrix4fv(qa.viewMatrix,!1,a.matrixWorldInverse.elements);if(d.skinning)if(e.bindMatrix&&null!==qa.bindMatrix&&l.uniformMatrix4fv(qa.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&
|
|
|
+null!==qa.bindMatrixInverse&&l.uniformMatrix4fv(qa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),fc&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==qa.boneTexture){var wa=F();l.uniform1i(qa.boneTexture,wa);J.setTexture(e.skeleton.boneTexture,wa)}null!==qa.boneTextureWidth&&l.uniform1i(qa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==qa.boneTextureHeight&&l.uniform1i(qa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==qa.boneGlobalMatrices&&
|
|
|
+l.uniformMatrix4fv(qa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(hb){c&&d.fog&&(M.fogColor.value=c.color,c instanceof THREE.Fog?(M.fogNear.value=c.near,M.fogFar.value=c.far):c instanceof THREE.FogExp2&&(M.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(Ub){var Za=!0,oa,ja,na,Ea=0,Fa=0,Ua=0,Aa,Ya,jb,ia,kb,lb,va=Jc,gb=va.directional.colors,Na=va.directional.positions,mb=va.point.colors,ab=va.point.positions,nb=va.point.distances,
|
|
|
+Gb=va.spot.colors,Mb=va.spot.positions,ib=va.spot.distances,Wa=va.spot.directions,Xb=va.spot.anglesCos,Fb=va.spot.exponents,wb=va.hemi.skyColors,Xa=va.hemi.groundColors,Oa=va.hemi.positions,bb=0,Ka=0,ha=0,ta=0,D=0,La=0,cb=0,Nb=0,xb=0,db=0,za=0,Ma=0;oa=0;for(ja=b.length;oa<ja;oa++)na=b[oa],na.onlyShadow||(Aa=na.color,ia=na.intensity,lb=na.distance,na instanceof THREE.AmbientLight?na.visible&&(J.gammaInput?(Ea+=Aa.r*Aa.r,Fa+=Aa.g*Aa.g,Ua+=Aa.b*Aa.b):(Ea+=Aa.r,Fa+=Aa.g,Ua+=Aa.b)):na instanceof THREE.DirectionalLight?
|
|
|
+(D+=1,na.visible&&(ya.setFromMatrixPosition(na.matrixWorld),Pa.setFromMatrixPosition(na.target.matrixWorld),ya.sub(Pa),ya.normalize(),xb=3*bb,Na[xb]=ya.x,Na[xb+1]=ya.y,Na[xb+2]=ya.z,J.gammaInput?y(gb,xb,Aa,ia*ia):E(gb,xb,Aa,ia),bb+=1)):na instanceof THREE.PointLight?(La+=1,na.visible&&(db=3*Ka,J.gammaInput?y(mb,db,Aa,ia*ia):E(mb,db,Aa,ia),Pa.setFromMatrixPosition(na.matrixWorld),ab[db]=Pa.x,ab[db+1]=Pa.y,ab[db+2]=Pa.z,nb[Ka]=lb,Ka+=1)):na instanceof THREE.SpotLight?(cb+=1,na.visible&&(za=3*ha,J.gammaInput?
|
|
|
+y(Gb,za,Aa,ia*ia):E(Gb,za,Aa,ia),ya.setFromMatrixPosition(na.matrixWorld),Mb[za]=ya.x,Mb[za+1]=ya.y,Mb[za+2]=ya.z,ib[ha]=lb,Pa.setFromMatrixPosition(na.target.matrixWorld),ya.sub(Pa),ya.normalize(),Wa[za]=ya.x,Wa[za+1]=ya.y,Wa[za+2]=ya.z,Xb[ha]=Math.cos(na.angle),Fb[ha]=na.exponent,ha+=1)):na instanceof THREE.HemisphereLight&&(Nb+=1,na.visible&&(ya.setFromMatrixPosition(na.matrixWorld),ya.normalize(),Ma=3*ta,Oa[Ma]=ya.x,Oa[Ma+1]=ya.y,Oa[Ma+2]=ya.z,Ya=na.color,jb=na.groundColor,J.gammaInput?(kb=ia*
|
|
|
+ia,y(wb,Ma,Ya,kb),y(Xa,Ma,jb,kb)):(E(wb,Ma,Ya,ia),E(Xa,Ma,jb,ia)),ta+=1)));oa=3*bb;for(ja=Math.max(gb.length,3*D);oa<ja;oa++)gb[oa]=0;oa=3*Ka;for(ja=Math.max(mb.length,3*La);oa<ja;oa++)mb[oa]=0;oa=3*ha;for(ja=Math.max(Gb.length,3*cb);oa<ja;oa++)Gb[oa]=0;oa=3*ta;for(ja=Math.max(wb.length,3*Nb);oa<ja;oa++)wb[oa]=0;oa=3*ta;for(ja=Math.max(Xa.length,3*Nb);oa<ja;oa++)Xa[oa]=0;va.directional.length=bb;va.point.length=Ka;va.spot.length=ha;va.hemi.length=ta;va.ambient[0]=Ea;va.ambient[1]=Fa;va.ambient[2]=
|
|
|
+Ua;Ub=!1}if(Za){var ra=Jc;M.ambientLightColor.value=ra.ambient;M.directionalLightColor.value=ra.directional.colors;M.directionalLightDirection.value=ra.directional.positions;M.pointLightColor.value=ra.point.colors;M.pointLightPosition.value=ra.point.positions;M.pointLightDistance.value=ra.point.distances;M.spotLightColor.value=ra.spot.colors;M.spotLightPosition.value=ra.spot.positions;M.spotLightDistance.value=ra.spot.distances;M.spotLightDirection.value=ra.spot.directions;M.spotLightAngleCos.value=
|
|
|
+ra.spot.anglesCos;M.spotLightExponent.value=ra.spot.exponents;M.hemisphereLightSkyColor.value=ra.hemi.skyColors;M.hemisphereLightGroundColor.value=ra.hemi.groundColors;M.hemisphereLightDirection.value=ra.hemi.positions;G(M,!0)}else G(M,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){M.opacity.value=d.opacity;J.gammaInput?M.diffuse.value.copyGammaToLinear(d.color):M.diffuse.value=d.color;M.map.value=d.map;M.lightMap.value=d.lightMap;
|
|
|
+M.specularMap.value=d.specularMap;M.alphaMap.value=d.alphaMap;d.bumpMap&&(M.bumpMap.value=d.bumpMap,M.bumpScale.value=d.bumpScale);d.normalMap&&(M.normalMap.value=d.normalMap,M.normalScale.value.copy(d.normalScale));var Ba;d.map?Ba=d.map:d.specularMap?Ba=d.specularMap:d.normalMap?Ba=d.normalMap:d.bumpMap?Ba=d.bumpMap:d.alphaMap&&(Ba=d.alphaMap);if(void 0!==Ba){var vb=Ba.offset,Eb=Ba.repeat;M.offsetRepeat.value.set(vb.x,vb.y,Eb.x,Eb.y)}M.envMap.value=d.envMap;M.flipEnvMap.value=d.envMap instanceof
|
|
|
+THREE.WebGLRenderTargetCube?1:-1;M.reflectivity.value=d.reflectivity;M.refractionRatio.value=d.refractionRatio;M.combine.value=d.combine;M.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(M.diffuse.value=d.color,M.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(M.diffuse.value=d.color,M.opacity.value=d.opacity,M.dashSize.value=d.dashSize,M.totalSize.value=d.dashSize+d.gapSize,M.scale.value=d.scale):d instanceof
|
|
|
+THREE.PointCloudMaterial?(M.psColor.value=d.color,M.opacity.value=d.opacity,M.size.value=d.size,M.scale.value=P.height/2,M.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(M.shininess.value=d.shininess,J.gammaInput?(M.ambient.value.copyGammaToLinear(d.ambient),M.emissive.value.copyGammaToLinear(d.emissive),M.specular.value.copyGammaToLinear(d.specular)):(M.ambient.value=d.ambient,M.emissive.value=d.emissive,M.specular.value=d.specular),d.wrapAround&&M.wrapRGB.value.copy(d.wrapRGB)):d instanceof
|
|
|
+THREE.MeshLambertMaterial?(J.gammaInput?(M.ambient.value.copyGammaToLinear(d.ambient),M.emissive.value.copyGammaToLinear(d.emissive)):(M.ambient.value=d.ambient,M.emissive.value=d.emissive),d.wrapAround&&M.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(M.mNear.value=a.near,M.mFar.value=a.far,M.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(M.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&M.shadowMatrix)for(var yb=0,A=0,Kb=b.length;A<Kb;A++){var Qa=
|
|
|
+b[A];Qa.castShadow&&(Qa instanceof THREE.SpotLight||Qa instanceof THREE.DirectionalLight&&!Qa.shadowCascade)&&(M.shadowMap.value[yb]=Qa.shadowMap,M.shadowMapSize.value[yb]=Qa.shadowMapSize,M.shadowMatrix.value[yb]=Qa.shadowMatrix,M.shadowDarkness.value[yb]=Qa.shadowDarkness,M.shadowBias.value[yb]=Qa.shadowBias,yb++)}for(var Ha=d.uniformsList,eb,zb,fb,sb=0,Lb=Ha.length;sb<Lb;sb++){var fa=Ha[sb][0];if(!1!==fa.needsUpdate){var Jb=fa.type,H=fa.value,ba=Ha[sb][1];switch(Jb){case "1i":l.uniform1i(ba,H);
|
|
|
+break;case "1f":l.uniform1f(ba,H);break;case "2f":l.uniform2f(ba,H[0],H[1]);break;case "3f":l.uniform3f(ba,H[0],H[1],H[2]);break;case "4f":l.uniform4f(ba,H[0],H[1],H[2],H[3]);break;case "1iv":l.uniform1iv(ba,H);break;case "3iv":l.uniform3iv(ba,H);break;case "1fv":l.uniform1fv(ba,H);break;case "2fv":l.uniform2fv(ba,H);break;case "3fv":l.uniform3fv(ba,H);break;case "4fv":l.uniform4fv(ba,H);break;case "Matrix3fv":l.uniformMatrix3fv(ba,!1,H);break;case "Matrix4fv":l.uniformMatrix4fv(ba,!1,H);break;case "i":l.uniform1i(ba,
|
|
|
+H);break;case "f":l.uniform1f(ba,H);break;case "v2":l.uniform2f(ba,H.x,H.y);break;case "v3":l.uniform3f(ba,H.x,H.y,H.z);break;case "v4":l.uniform4f(ba,H.x,H.y,H.z,H.w);break;case "c":l.uniform3f(ba,H.r,H.g,H.b);break;case "iv1":l.uniform1iv(ba,H);break;case "iv":l.uniform3iv(ba,H);break;case "fv1":l.uniform1fv(ba,H);break;case "fv":l.uniform3fv(ba,H);break;case "v2v":void 0===fa._array&&(fa._array=new Float32Array(2*H.length));for(var ca=0,Ra=H.length;ca<Ra;ca++)fb=2*ca,fa._array[fb]=H[ca].x,fa._array[fb+
|
|
|
+1]=H[ca].y;l.uniform2fv(ba,fa._array);break;case "v3v":void 0===fa._array&&(fa._array=new Float32Array(3*H.length));ca=0;for(Ra=H.length;ca<Ra;ca++)fb=3*ca,fa._array[fb]=H[ca].x,fa._array[fb+1]=H[ca].y,fa._array[fb+2]=H[ca].z;l.uniform3fv(ba,fa._array);break;case "v4v":void 0===fa._array&&(fa._array=new Float32Array(4*H.length));ca=0;for(Ra=H.length;ca<Ra;ca++)fb=4*ca,fa._array[fb]=H[ca].x,fa._array[fb+1]=H[ca].y,fa._array[fb+2]=H[ca].z,fa._array[fb+3]=H[ca].w;l.uniform4fv(ba,fa._array);break;case "m3":l.uniformMatrix3fv(ba,
|
|
|
+!1,H.elements);break;case "m3v":void 0===fa._array&&(fa._array=new Float32Array(9*H.length));ca=0;for(Ra=H.length;ca<Ra;ca++)H[ca].flattenToArrayOffset(fa._array,9*ca);l.uniformMatrix3fv(ba,!1,fa._array);break;case "m4":l.uniformMatrix4fv(ba,!1,H.elements);break;case "m4v":void 0===fa._array&&(fa._array=new Float32Array(16*H.length));ca=0;for(Ra=H.length;ca<Ra;ca++)H[ca].flattenToArrayOffset(fa._array,16*ca);l.uniformMatrix4fv(ba,!1,fa._array);break;case "t":eb=H;zb=F();l.uniform1i(ba,zb);if(!eb)continue;
|
|
|
+if(eb instanceof THREE.CubeTexture||eb.image instanceof Array&&6===eb.image.length){var xa=eb,Yb=zb;if(6===xa.image.length)if(xa.needsUpdate){xa.image.__webglTextureCube||(xa.addEventListener("dispose",hc),xa.image.__webglTextureCube=l.createTexture(),J.info.memory.textures++);l.activeTexture(l.TEXTURE0+Yb);l.bindTexture(l.TEXTURE_CUBE_MAP,xa.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,xa.flipY);for(var Zb=xa instanceof THREE.CompressedTexture,$b=[],da=0;6>da;da++)$b[da]=J.autoScaleCubemaps&&
|
|
|
+!Zb?C(xa.image[da],Vc):xa.image[da];var ac=$b[0],Ob=THREE.Math.isPowerOfTwo(ac.width)&&THREE.Math.isPowerOfTwo(ac.height),ob=V(xa.format),Pb=V(xa.type);O(l.TEXTURE_CUBE_MAP,xa,Ob);for(da=0;6>da;da++)if(Zb)for(var pb,la=$b[da].mipmaps,Ab=0,Vb=la.length;Ab<Vb;Ab++)pb=la[Ab],xa.format!==THREE.RGBAFormat&&xa.format!==THREE.RGBFormat?-1<kc.indexOf(ob)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+da,Ab,ob,pb.width,pb.height,0,pb.data):console.warn("Attempt to load unsupported compressed texture format"):
|
|
|
+l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+da,Ab,ob,pb.width,pb.height,0,ob,Pb,pb.data);else l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+da,0,ob,ob,Pb,$b[da]);xa.generateMipmaps&&Ob&&l.generateMipmap(l.TEXTURE_CUBE_MAP);xa.needsUpdate=!1;if(xa.onUpdate)xa.onUpdate()}else l.activeTexture(l.TEXTURE0+Yb),l.bindTexture(l.TEXTURE_CUBE_MAP,xa.image.__webglTextureCube)}else if(eb instanceof THREE.WebGLRenderTargetCube){var Wb=eb;l.activeTexture(l.TEXTURE0+zb);l.bindTexture(l.TEXTURE_CUBE_MAP,Wb.__webglTexture)}else J.setTexture(eb,
|
|
|
+zb);break;case "tv":void 0===fa._array&&(fa._array=[]);ca=0;for(Ra=fa.value.length;ca<Ra;ca++)fa._array[ca]=F();l.uniform1iv(ba,fa._array);ca=0;for(Ra=fa.value.length;ca<Ra;ca++)eb=fa.value[ca],zb=fa._array[ca],eb&&J.setTexture(eb,zb);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Jb)}}}}l.uniformMatrix4fv(qa.modelViewMatrix,!1,e._modelViewMatrix.elements);qa.normalMatrix&&l.uniformMatrix3fv(qa.normalMatrix,!1,e._normalMatrix.elements);null!==qa.modelMatrix&&l.uniformMatrix4fv(qa.modelMatrix,
|
|
|
+!1,e.matrixWorld.elements);return ua}function G(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=
|
|
|
+b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function F(){var a=ec;a>=Kc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Kc);ec+=1;return a}function B(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function y(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function E(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function R(a){a!==
|
|
|
+Lc&&(l.lineWidth(a),Lc=a)}function I(a,b,c){Mc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),Mc=a);!a||Nc===b&&Oc===c||(l.polygonOffset(b,c),Nc=b,Oc=c)}function O(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,V(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,V(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,V(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,V(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),
|
|
|
+l.texParameteri(a,l.TEXTURE_MAG_FILTER,Q(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,Q(b.minFilter)));jb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,jb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Pc)),b.__oldAnisotropy=b.anisotropy)}function C(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,
|
|
|
+a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function W(a,b){l.bindRenderbuffer(l.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),
|
|
|
+l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function U(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function Q(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||
|
|
|
+a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function V(a){if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;
|
|
|
if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;
|
|
|
if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===
|
|
|
THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;
|
|
|
if(null!==Ea){if(a===THREE.RGB_S3TC_DXT1_Format)return Ea.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return Ea.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return Ea.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return Ea.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==Fa){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return Fa.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return Fa.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return Fa.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
|
|
|
-if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return Fa.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(void 0!==$a){if(a===THREE.MinEquation)return $a.MIN_EXT;if(a===THREE.MaxEquation)return $a.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var N=void 0!==a.canvas?a.canvas:document.createElement("canvas"),xa=void 0!==a.context?a.context:null,P=void 0!==a.precision?a.precision:"highp",ya=void 0!==a.alpha?a.alpha:!1,la=void 0!==a.depth?a.depth:!0,sa=void 0!==a.stencil?a.stencil:!0,L=void 0!==
|
|
|
-a.antialias?a.antialias:!1,ha=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ra=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ia=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ta=new THREE.Color(0),Ja=0,Ga=[],Ta={},Ca=[],hb=[],Ra=[];this.domElement=N;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
|
|
|
-this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var I=this,Na=[],ub=null,Xb=null,tb=-1,Xa=null,
|
|
|
-Tb=null,ec=0,Jb=-1,Vb=-1,kb=-1,Wb=-1,lc=-1,Eb=-1,lb=-1,Kb=-1,Mc=null,Nc=null,Oc=null,Lc=null,mc=0,nc=0,mb=N.width,gb=N.height,zc=0,Gc=0,Lb=new Uint8Array(16),vb=new Uint8Array(16),Ac=new THREE.Frustum,xc=new THREE.Matrix4,Dc=new THREE.Matrix4,Qa=new THREE.Vector3,va=new THREE.Vector3,Ub=!0,Jc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},
|
|
|
-hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,sb,oc,jb,Ea,Fa,Fb,$a;(function(){try{var a={alpha:ya,depth:la,stencil:sa,antialias:L,premultipliedAlpha:ha,preserveDrawingBuffer:ra};l=xa||N.getContext("webgl",a)||N.getContext("experimental-webgl",a);if(null===l)throw"Error creating WebGL context.";}catch(b){console.error(b)}sb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");oc=l.getExtension("OES_standard_derivatives");jb=l.getExtension("EXT_texture_filter_anisotropic")||
|
|
|
-l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ea=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Fa=l.getExtension("WEBGL_compressed_texture_pvrtc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");Fb=l.getExtension("OES_element_index_uint");$a=l.getExtension("EXT_blend_minmax");null===sb&&console.log("THREE.WebGLRenderer: Float textures not supported.");
|
|
|
-null===oc&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===jb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Ea&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Fa&&console.log("THREE.WebGLRenderer: PVRTC compressed textures not supported.");null===Fb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");null===$a&&console.log("THREE.WebGLRenderer: min max blend equations not supported.");
|
|
|
-void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ia&&l.getExtension("EXT_frag_depth")})();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(mc,nc,mb,gb);l.clearColor(ta.r,ta.g,ta.b,Ja);this.context=l;var Kc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
|
|
|
+if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return Fa.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(void 0!==Ya){if(a===THREE.MinEquation)return Ya.MIN_EXT;if(a===THREE.MaxEquation)return Ya.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var P=void 0!==a.canvas?a.canvas:document.createElement("canvas"),sa=void 0!==a.context?a.context:null,L=void 0!==a.precision?a.precision:"highp",Y=void 0!==a.alpha?a.alpha:!1,ga=void 0!==a.depth?a.depth:!0,ua=void 0!==a.stencil?a.stencil:!0,N=void 0!==
|
|
|
+a.antialias?a.antialias:!1,ja=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,wa=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Ia=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ka=new THREE.Color(0),Ja=0,Ca=[],$a={},Ga=[],Za=[],hb=[];this.domElement=P;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=
|
|
|
+this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var J=this,Va=[],ub=null,Xb=null,tb=-1,Ua=null,
|
|
|
+Tb=null,ec=0,Jb=-1,Vb=-1,kb=-1,Wb=-1,lc=-1,Eb=-1,lb=-1,Kb=-1,Mc=null,Nc=null,Oc=null,Lc=null,mc=0,nc=0,mb=P.width,gb=P.height,zc=0,Gc=0,Lb=new Uint8Array(16),vb=new Uint8Array(16),Ac=new THREE.Frustum,xc=new THREE.Matrix4,Dc=new THREE.Matrix4,Pa=new THREE.Vector3,ya=new THREE.Vector3,Ub=!0,Jc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},
|
|
|
+hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,sb,oc,jb,Ea,Fa,Fb,Ya;(function(){try{var a={alpha:Y,depth:ga,stencil:ua,antialias:N,premultipliedAlpha:ja,preserveDrawingBuffer:wa};l=sa||P.getContext("webgl",a)||P.getContext("experimental-webgl",a);if(null===l)throw"Error creating WebGL context.";}catch(b){console.error(b)}sb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");oc=l.getExtension("OES_standard_derivatives");jb=l.getExtension("EXT_texture_filter_anisotropic")||
|
|
|
+l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");Ea=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");Fa=l.getExtension("WEBGL_compressed_texture_pvrtc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");Fb=l.getExtension("OES_element_index_uint");Ya=l.getExtension("EXT_blend_minmax");null===sb&&console.log("THREE.WebGLRenderer: Float textures not supported.");
|
|
|
+null===oc&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");null===jb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");null===Ea&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");null===Fa&&console.log("THREE.WebGLRenderer: PVRTC compressed textures not supported.");null===Fb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");null===Ya&&console.log("THREE.WebGLRenderer: min max blend equations not supported.");
|
|
|
+void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Ia&&l.getExtension("EXT_frag_depth")})();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(mc,nc,mb,gb);l.clearColor(ka.r,ka.g,ka.b,Ja);this.context=l;var Kc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),
|
|
|
Wc=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Xc=l.getParameter(l.MAX_TEXTURE_SIZE),Vc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Pc=jb?l.getParameter(jb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,gc=0<Wc,fc=gc&&sb,kc=[];if(Fa||Ea)for(var Qc=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),vc=0;vc<Qc.length;vc++)kc.push(Qc[vc]);var Yc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.HIGH_FLOAT),Zc=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);
|
|
|
-var $c=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),ad=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var bd=0<Yc.precision&&0<$c.precision,Rc=0<Zc.precision&&0<ad.precision;"highp"!==P||bd||(Rc?(P="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(P="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==P||Rc||(P="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));
|
|
|
-this.getContext=function(){return l};this.supportsVertexTextures=function(){return gc};this.supportsFloatTextures=function(){return sb};this.supportsStandardDerivatives=function(){return oc};this.supportsCompressedTextureS3TC=function(){return Ea};this.supportsCompressedTexturePVRTC=function(){return Fa};this.supportsBlendMinMax=function(){return $a};this.getMaxAnisotropy=function(){return Pc};this.getPrecision=function(){return P};this.setSize=function(a,b,c){N.width=a*this.devicePixelRatio;N.height=
|
|
|
-b*this.devicePixelRatio;!1!==c&&(N.style.width=a+"px",N.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){mc=a*this.devicePixelRatio;nc=b*this.devicePixelRatio;mb=c*this.devicePixelRatio;gb=d*this.devicePixelRatio;l.viewport(mc,nc,mb,gb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};
|
|
|
-this.setClearColor=function(a,b){ta.set(a);Ja=void 0!==b?b:1;l.clearColor(ta.r,ta.g,ta.b,Ja)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return ta};this.getClearAlpha=function(){return Ja};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};
|
|
|
-this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this,Ga,Ta,Ca);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this,Ga,Ta,Ca);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){ub=null;tb=Xa=Kb=lb=kb=-1;Ub=!0;Vb=Jb=-1;this.shadowMapPlugin.update(a,
|
|
|
-b)};var Ec=function(a){a.target.traverse(function(a){a.removeEventListener("remove",Ec);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete Ta[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Ca,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Fc=function(a){a=a.target;a.removeEventListener("dispose",Fc);a.__webglInit=
|
|
|
-void 0;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes)void 0!==a.attributes[b].buffer&&l.deleteBuffer(a.attributes[b].buffer);I.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)l.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)l.deleteBuffer(d.__webglMorphNormalsBuffers[e]);
|
|
|
-Sc(d)}}else Sc(a)},hc=function(a){a=a.target;a.removeEventListener("dispose",hc);a.image&&a.image.__webglTextureCube?l.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,l.deleteTexture(a.__webglTexture));I.info.memory.textures--},Tc=function(a){a=a.target;a.removeEventListener("dispose",Tc);if(a&&a.__webglTexture)if(l.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);
|
|
|
-else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);I.info.memory.textures--},Ic=function(a){a=a.target;a.removeEventListener("dispose",Ic);Hc(a)},Sc=function(a){void 0!==a.__webglVertexBuffer&&l.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&l.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&l.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&l.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
|
+var $c=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),ad=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var bd=0<Yc.precision&&0<$c.precision,Rc=0<Zc.precision&&0<ad.precision;"highp"!==L||bd||(Rc?(L="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(L="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==L||Rc||(L="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));
|
|
|
+this.getContext=function(){return l};this.supportsVertexTextures=function(){return gc};this.supportsFloatTextures=function(){return sb};this.supportsStandardDerivatives=function(){return oc};this.supportsCompressedTextureS3TC=function(){return Ea};this.supportsCompressedTexturePVRTC=function(){return Fa};this.supportsBlendMinMax=function(){return Ya};this.getMaxAnisotropy=function(){return Pc};this.getPrecision=function(){return L};this.setSize=function(a,b,c){P.width=a*this.devicePixelRatio;P.height=
|
|
|
+b*this.devicePixelRatio;!1!==c&&(P.style.width=a+"px",P.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){mc=a*this.devicePixelRatio;nc=b*this.devicePixelRatio;mb=c*this.devicePixelRatio;gb=d*this.devicePixelRatio;l.viewport(mc,nc,mb,gb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};
|
|
|
+this.setClearColor=function(a,b){ka.set(a);Ja=void 0!==b?b:1;l.clearColor(ka.r,ka.g,ka.b,Ja)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return ka};this.getClearAlpha=function(){return Ja};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};
|
|
|
+this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this,Ca,$a,Ga);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this,Ca,$a,Ga);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){ub=null;tb=Ua=Kb=lb=kb=-1;Ub=!0;Vb=Jb=-1;this.shadowMapPlugin.update(a,
|
|
|
+b)};var Ec=function(a){a.target.traverse(function(a){a.removeEventListener("remove",Ec);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete $a[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Ga,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Fc=function(a){a=a.target;a.removeEventListener("dispose",Fc);a.__webglInit=
|
|
|
+void 0;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes)void 0!==a.attributes[b].buffer&&l.deleteBuffer(a.attributes[b].buffer);J.info.memory.geometries--}else if(void 0!==a.geometryGroups){b=0;for(var c=a.geometryGroupsList.length;b<c;b++){var d=a.geometryGroupsList[b];if(void 0!==d.numMorphTargets)for(var e=0,f=d.numMorphTargets;e<f;e++)l.deleteBuffer(d.__webglMorphTargetsBuffers[e]);if(void 0!==d.numMorphNormals)for(e=0,f=d.numMorphNormals;e<f;e++)l.deleteBuffer(d.__webglMorphNormalsBuffers[e]);
|
|
|
+Sc(d)}}else Sc(a)},hc=function(a){a=a.target;a.removeEventListener("dispose",hc);a.image&&a.image.__webglTextureCube?l.deleteTexture(a.image.__webglTextureCube):a.__webglInit&&(a.__webglInit=!1,l.deleteTexture(a.__webglTexture));J.info.memory.textures--},Tc=function(a){a=a.target;a.removeEventListener("dispose",Tc);if(a&&a.__webglTexture)if(l.deleteTexture(a.__webglTexture),a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);
|
|
|
+else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);J.info.memory.textures--},Ic=function(a){a=a.target;a.removeEventListener("dispose",Ic);Hc(a)},Sc=function(a){void 0!==a.__webglVertexBuffer&&l.deleteBuffer(a.__webglVertexBuffer);void 0!==a.__webglNormalBuffer&&l.deleteBuffer(a.__webglNormalBuffer);void 0!==a.__webglTangentBuffer&&l.deleteBuffer(a.__webglTangentBuffer);void 0!==a.__webglColorBuffer&&l.deleteBuffer(a.__webglColorBuffer);void 0!==a.__webglUVBuffer&&
|
|
|
l.deleteBuffer(a.__webglUVBuffer);void 0!==a.__webglUV2Buffer&&l.deleteBuffer(a.__webglUV2Buffer);void 0!==a.__webglSkinIndicesBuffer&&l.deleteBuffer(a.__webglSkinIndicesBuffer);void 0!==a.__webglSkinWeightsBuffer&&l.deleteBuffer(a.__webglSkinWeightsBuffer);void 0!==a.__webglFaceBuffer&&l.deleteBuffer(a.__webglFaceBuffer);void 0!==a.__webglLineBuffer&&l.deleteBuffer(a.__webglLineBuffer);void 0!==a.__webglLineDistanceBuffer&&l.deleteBuffer(a.__webglLineDistanceBuffer);if(void 0!==a.__webglCustomAttributesList)for(var b in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[b].buffer);
|
|
|
-I.info.memory.geometries--},Hc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Na.length;a<c;a++)if(d=Na[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Na.length;a<c;a++)d=Na[a],d.program!==b&&e.push(d);Na=e;l.deleteProgram(b);I.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){g();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&
|
|
|
+J.info.memory.geometries--},Hc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Va.length;a<c;a++)if(d=Va[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Va.length;a<c;a++)d=Va[a],d.program!==b&&e.push(d);Va=e;l.deleteProgram(b);J.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){g();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());a.hasNormals&&!a.__webglNormalBuffer&&
|
|
|
(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);if(c.shading===THREE.FlatShading){var d,
|
|
|
-e,k,m,n,p,r,s,t,q,u,v=3*a.count;for(u=0;u<v;u+=9)q=a.normalArray,d=q[u],e=q[u+1],k=q[u+2],m=q[u+3],p=q[u+4],s=q[u+5],n=q[u+6],r=q[u+7],t=q[u+8],d=(d+m+n)/3,e=(e+p+r)/3,k=(k+s+t)/3,q[u]=d,q[u+1]=e,q[u+2]=k,q[u+3]=d,q[u+4]=e,q[u+5]=k,q[u+6]=d,q[u+7]=e,q[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,
|
|
|
+e,k,m,n,p,q,s,t,r,u,w=3*a.count;for(u=0;u<w;u+=9)r=a.normalArray,d=r[u],e=r[u+1],k=r[u+2],m=r[u+3],p=r[u+4],s=r[u+5],n=r[u+6],q=r[u+7],t=r[u+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+s+t)/3,r[u]=d,r[u+1]=e,r[u+2]=k,r[u+3]=d,r[u+4]=e,r[u+5]=k,r[u+6]=d,r[u+7]=e,r[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),l.bufferData(l.ARRAY_BUFFER,a.uvArray,
|
|
|
l.DYNAMIC_DRAW),f(b.attributes.uv),l.vertexAttribPointer(b.attributes.uv,2,l.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,a.colorArray,l.DYNAMIC_DRAW),f(b.attributes.color),l.vertexAttribPointer(b.attributes.color,3,l.FLOAT,!1,0,0));h();l.drawArrays(l.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,f,h){if(!1!==d.visible)if(a=x(a,b,c,d,h),b=!1,c=16777215*f.id+2*a.id+(d.wireframe?
|
|
|
-1:0),c!==Xa&&(Xa=c,b=!0),b&&g(),h instanceof THREE.Mesh)if(h=!0===d.wireframe?l.LINES:l.TRIANGLES,c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=c.array.length,I.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,r=n.length;p<r;p++){var s=n[p].index;b&&(e(d,
|
|
|
-a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);I.info.render.calls++;I.info.render.vertices+=n[p].count;I.info.render.faces+=n[p].count/3}}}else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.vertices+=d.array.length/3,I.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.POINTS,0,d.array.length/3),I.info.render.calls++,
|
|
|
-I.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,J(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),I.info.render.calls++,I.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,r=n.length;p<r;p++)s=n[p].index,b&&(e(d,a,f,
|
|
|
-s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),I.info.render.calls++,I.info.render.vertices+=n[p].count;else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),I.info.render.calls++,I.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){var m,p;c=x(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Xa&&(Xa=c,a=!0);a&&g();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
-e.__webglVertexBuffer),f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var r=0;p=k.morphTargetForcedOrder;
|
|
|
-for(m=k.morphTargetInfluences;r<d.numSupportedMorphTargets&&r<p.length;)0<=c["morphTarget"+r]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[p[r]]),f(c["morphTarget"+r]),l.vertexAttribPointer(c["morphTarget"+r],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+r]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[p[r]]),f(c["morphNormal"+r]),l.vertexAttribPointer(c["morphNormal"+r],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[r]=m[p[r]],r++}else{p=[];m=k.morphTargetInfluences;
|
|
|
-var s,q=m.length;for(s=0;s<q;s++)r=m[s],0<r&&p.push([r,s]);p.length>d.numSupportedMorphTargets?(p.sort(n),p.length=d.numSupportedMorphTargets):p.length>d.numSupportedMorphNormals?p.sort(n):0===p.length&&p.push([0,0]);for(r=0;r<d.numSupportedMorphTargets;)p[r]?(s=p[r][1],0<=c["morphTarget"+r]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+r]),l.vertexAttribPointer(c["morphTarget"+r],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+r]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
-e.__webglMorphNormalsBuffers[s]),f(c["morphNormal"+r]),l.vertexAttribPointer(c["morphNormal"+r],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[r]=m[s]):k.__webglMorphTargetInfluences[r]=0,r++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,p=e.__webglCustomAttributesList.length;m<p;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+1:0),c!==Ua&&(Ua=c,b=!0),b&&g(),h instanceof THREE.Mesh)if(h=!0===d.wireframe?l.LINES:l.TRIANGLES,c=f.attributes.index){var k,m;c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2);var n=f.offsets;if(0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),J.info.render.calls++,J.info.render.vertices+=c.array.length,J.info.render.faces+=c.array.length/3;else{b=!0;for(var p=0,q=n.length;p<q;p++){var s=n[p].index;b&&(e(d,
|
|
|
+a,f,s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer));l.drawElements(h,n[p].count,k,n[p].start*m);J.info.render.calls++;J.info.render.vertices+=n[p].count;J.info.render.faces+=n[p].count/3}}}else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),J.info.render.calls++,J.info.render.vertices+=d.array.length/3,J.info.render.faces+=d.array.length/9;else if(h instanceof THREE.PointCloud)b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(l.POINTS,0,d.array.length/3),J.info.render.calls++,
|
|
|
+J.info.render.points+=d.array.length/3;else if(h instanceof THREE.Line)if(h=h.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,R(d.linewidth),c=f.attributes.index)if(c.array instanceof Uint32Array?(k=l.UNSIGNED_INT,m=4):(k=l.UNSIGNED_SHORT,m=2),n=f.offsets,0===n.length)b&&(e(d,a,f,0),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,c.array.length,k,0),J.info.render.calls++,J.info.render.vertices+=c.array.length;else for(1<n.length&&(b=!0),p=0,q=n.length;p<q;p++)s=n[p].index,b&&(e(d,a,f,
|
|
|
+s),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer)),l.drawElements(h,n[p].count,k,n[p].start*m),J.info.render.calls++,J.info.render.vertices+=n[p].count;else b&&e(d,a,f,0),d=f.attributes.position,l.drawArrays(h,0,d.array.length/3),J.info.render.calls++,J.info.render.points+=d.array.length/3};this.renderBuffer=function(a,b,c,d,e,k){if(!1!==d.visible){var m,n;c=x(a,b,c,d,k);b=c.attributes;a=!1;c=16777215*e.id+2*c.id+(d.wireframe?1:0);c!==Ua&&(Ua=c,a=!0);a&&g();if(!d.morphTargets&&0<=b.position)a&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+e.__webglVertexBuffer),f(b.position),l.vertexAttribPointer(b.position,3,l.FLOAT,!1,0,0));else if(k.morphTargetBase){c=d.program.attributes;-1!==k.morphTargetBase&&0<=c.position?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[k.morphTargetBase]),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0)):0<=c.position&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglVertexBuffer),f(c.position),l.vertexAttribPointer(c.position,3,l.FLOAT,!1,0,0));if(k.morphTargetForcedOrder.length){var q=0;n=k.morphTargetForcedOrder;
|
|
|
+for(m=k.morphTargetInfluences;q<d.numSupportedMorphTargets&&q<n.length;)0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[n[q]]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[n[q]]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[n[q]],q++}else{n=[];m=k.morphTargetInfluences;
|
|
|
+var s,r=m.length;for(s=0;s<r;s++)q=m[s],0<q&&n.push([q,s]);n.length>d.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(q=0;q<d.numSupportedMorphTargets;)n[q]?(s=n[q][1],0<=c["morphTarget"+q]&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[s]),f(c["morphTarget"+q]),l.vertexAttribPointer(c["morphTarget"+q],3,l.FLOAT,!1,0,0)),0<=c["morphNormal"+q]&&d.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
+e.__webglMorphNormalsBuffers[s]),f(c["morphNormal"+q]),l.vertexAttribPointer(c["morphNormal"+q],3,l.FLOAT,!1,0,0)),k.__webglMorphTargetInfluences[q]=m[s]):k.__webglMorphTargetInfluences[q]=0,q++}null!==d.program.uniforms.morphTargetInfluences&&l.uniform1fv(d.program.uniforms.morphTargetInfluences,k.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(m=0,n=e.__webglCustomAttributesList.length;m<n;m++)c=e.__webglCustomAttributesList[m],0<=b[c.buffer.belongsToAttribute]&&(l.bindBuffer(l.ARRAY_BUFFER,
|
|
|
c.buffer),f(b[c.buffer.belongsToAttribute]),l.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,l.FLOAT,!1,0,0));0<=b.color&&(0<k.geometry.colors.length||0<k.geometry.faces.length?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglColorBuffer),f(b.color),l.vertexAttribPointer(b.color,3,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib3fv(b.color,d.defaultAttributeValues.color));0<=b.normal&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglNormalBuffer),f(b.normal),l.vertexAttribPointer(b.normal,
|
|
|
3,l.FLOAT,!1,0,0));0<=b.tangent&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglTangentBuffer),f(b.tangent),l.vertexAttribPointer(b.tangent,4,l.FLOAT,!1,0,0));0<=b.uv&&(k.geometry.faceVertexUvs[0]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUVBuffer),f(b.uv),l.vertexAttribPointer(b.uv,2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv,d.defaultAttributeValues.uv));0<=b.uv2&&(k.geometry.faceVertexUvs[1]?(l.bindBuffer(l.ARRAY_BUFFER,e.__webglUV2Buffer),f(b.uv2),l.vertexAttribPointer(b.uv2,
|
|
|
2,l.FLOAT,!1,0,0)):void 0!==d.defaultAttributeValues&&l.vertexAttrib2fv(b.uv2,d.defaultAttributeValues.uv2));d.skinning&&0<=b.skinIndex&&0<=b.skinWeight&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),f(b.skinIndex),l.vertexAttribPointer(b.skinIndex,4,l.FLOAT,!1,0,0),l.bindBuffer(l.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),f(b.skinWeight),l.vertexAttribPointer(b.skinWeight,4,l.FLOAT,!1,0,0));0<=b.lineDistance&&(l.bindBuffer(l.ARRAY_BUFFER,e.__webglLineDistanceBuffer),f(b.lineDistance),l.vertexAttribPointer(b.lineDistance,
|
|
|
-1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(J(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),I.info.render.calls++,I.info.render.vertices+=e.__webglFaceCount,I.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=
|
|
|
-k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,J(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),I.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),I.info.render.calls++,I.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h=a.fog;tb=-1;Tb=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
|
|
|
-void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);xc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ac.setFromMatrix(xc);Ga.length=0;hb.length=0;Ra.length=0;q(a,a);!0===I.sortObjects&&(hb.sort(k),Ra.sort(m));r(this.renderPluginsPre,a,b);I.info.render.calls=0;I.info.render.vertices=0;I.info.render.faces=0;I.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,
|
|
|
-this.autoClearDepth,this.autoClearStencil);d=0;for(e=Ca.length;d<e;d++)f=Ca[d],g=f.object,g.visible&&(B(g,b),s(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),K(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(hb,b,Ga,h,!0,d),t(Ra,b,Ga,h,!0,d),p(Ca,"",b,Ga,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(hb,b,Ga,h,!1,d),p(Ca,"opaque",b,Ga,h,!1,d),t(Ra,b,
|
|
|
-Ga,h,!0,d),p(Ca,"transparent",b,Ga,h,!0,d));r(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&V(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Xa=-1;I.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,Ac):e.render(function(a){I.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
|
|
|
+1,l.FLOAT,!1,0,0))}h();k instanceof THREE.Mesh?(k=e.__typeArray===Uint32Array?l.UNSIGNED_INT:l.UNSIGNED_SHORT,d.wireframe?(R(d.wireframeLinewidth),a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),l.drawElements(l.LINES,e.__webglLineCount,k,0)):(a&&l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),l.drawElements(l.TRIANGLES,e.__webglFaceCount,k,0)),J.info.render.calls++,J.info.render.vertices+=e.__webglFaceCount,J.info.render.faces+=e.__webglFaceCount/3):k instanceof THREE.Line?(k=
|
|
|
+k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,R(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),J.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),J.info.render.calls++,J.info.render.points+=e.__webglParticleCount)}};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var e,f,g,h=a.fog;tb=-1;Tb=null;Ub=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
|
|
|
+void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);xc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ac.setFromMatrix(xc);Ca.length=0;Za.length=0;hb.length=0;m(a,a);!0===J.sortObjects&&(Za.sort(k),hb.sort(n));q(this.renderPluginsPre,a,b);J.info.render.calls=0;J.info.render.vertices=0;J.info.render.faces=0;J.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,
|
|
|
+this.autoClearDepth,this.autoClearStencil);d=0;for(e=Ga.length;d<e;d++)f=Ga[d],g=f.object,g.visible&&(B(g,b),r(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),I(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),t(Za,b,Ca,h,!0,d),t(hb,b,Ca,h,!0,d),s(Ga,"",b,Ca,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),t(Za,b,Ca,h,!1,d),s(Ga,"opaque",b,Ca,h,!1,d),t(hb,b,
|
|
|
+Ca,h,!0,d),s(Ga,"transparent",b,Ca,h,!0,d));q(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&U(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Ua=-1;J.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,Ac):e.render(function(a){J.renderBufferImmediate(a,f,d)})};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
|
|
|
this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Jb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),Jb=b);Vb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Vb=a)};this.setDepthTest=
|
|
|
function(a){lb!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),lb=a)};this.setDepthWrite=function(a){Kb!==a&&(l.depthMask(a),Kb=a)};this.setBlending=function(a,b,c,d){a!==kb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),
|
|
|
-l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),kb=a);if(a===THREE.CustomBlending){if(b!==Wb&&(l.blendEquation(G(b)),Wb=b),c!==lc||d!==Eb)l.blendFunc(G(c),G(d)),lc=c,Eb=d}else Eb=lc=Wb=null};this.uploadTexture=function(a){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",hc),a.__webglTexture=l.createTexture(),
|
|
|
-I.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=Q(a.image,Xc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=G(a.format),e=G(a.type);S(l.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,
|
|
|
+l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),kb=a);if(a===THREE.CustomBlending){if(b!==Wb&&(l.blendEquation(V(b)),Wb=b),c!==lc||d!==Eb)l.blendFunc(V(c),V(d)),lc=c,Eb=d}else Eb=lc=Wb=null};this.uploadTexture=function(a){a.__webglInit||(a.__webglInit=!0,a.addEventListener("dispose",hc),a.__webglTexture=l.createTexture(),
|
|
|
+J.info.memory.textures++);l.bindTexture(l.TEXTURE_2D,a.__webglTexture);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,a.flipY);l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);l.pixelStorei(l.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=C(a.image,Xc);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=V(a.format),e=V(a.type);O(l.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<f.length&&c){for(var g=0,h=f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,
|
|
|
g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;g<h;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<kc.indexOf(d)?l.compressedTexImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,b.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);else if(0<f.length&&c){g=0;for(h=
|
|
|
-f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?I.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=
|
|
|
-!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Tc);a.__webglTexture=l.createTexture();I.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=G(a.format),e=G(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);S(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
-f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);da(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),S(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,
|
|
|
-0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):da(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);
|
|
|
-b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=mb,a=gb,d=mc,e=nc);b!==Xb&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Xb=b);zc=c;Gc=a};this.resetGLState=function(){Tb=ub=null;tb=Xa=Vb=Jb=Kb=lb=kb=-1;Ub=!0};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
|
|
|
+f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else l.texImage2D(l.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&l.generateMipmap(l.TEXTURE_2D);a.needsUpdate=!1;if(a.onUpdate)a.onUpdate()};this.setTexture=function(a,b){l.activeTexture(l.TEXTURE0+b);a.needsUpdate?J.uploadTexture(a):l.bindTexture(l.TEXTURE_2D,a.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=
|
|
|
+!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Tc);a.__webglTexture=l.createTexture();J.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=V(a.format),e=V(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);O(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
|
|
|
+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);W(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),O(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,
|
|
|
+0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):W(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);
|
|
|
+b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=mb,a=gb,d=mc,e=nc);b!==Xb&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),Xb=b);zc=c;Gc=a};this.resetGLState=function(){Tb=ub=null;tb=Ua=Vb=Jb=Kb=lb=kb=-1;Ub=!0};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);
|
|
|
this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
|
|
|
THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
|
|
|
THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
|
|
|
THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps;
|
|
|
a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);
|
|
|
-THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var g=b.context,f=d.defines,h=d.__webglShader.uniforms,k=d.attributes,m=d.__webglShader.vertexShader,n=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var r="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?r="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(r="SHADOWMAP_TYPE_PCF_SOFT");var t,p;t=[];for(var s in f)p=f[s],!1!==p&&(p="#define "+s+" "+p,t.push(p));
|
|
|
+THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var g=b.context,f=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,m=d.index0AttributeName;void 0===m&&!0===e.morphTargets&&(m="position");var q="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?q="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(q="SHADOWMAP_TYPE_PCF_SOFT");var t,s;t=[];for(var r in f)s=f[r],!1!==s&&(s="#define "+r+" "+s,t.push(s));
|
|
|
t=t.join("\n");f=g.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",t,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+
|
|
|
e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":
|
|
|
-"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
|
|
|
+"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+q:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),
|
|
|
b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",t,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG":
|
|
|
"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":
|
|
|
-"",e.shadowMapEnabled?"#define "+r:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));m=new THREE.WebGLShader(g,g.VERTEX_SHADER,d+m);n=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,b+n);g.attachShader(f,m);g.attachShader(f,n);void 0!==q&&g.bindAttribLocation(f,0,q);g.linkProgram(f);!1===g.getProgramParameter(f,g.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),
|
|
|
-console.error("gl.VALIDATE_STATUS",g.getProgramParameter(f,g.VALIDATE_STATUS)),console.error("gl.getError()",g.getError()));""!==g.getProgramInfoLog(f)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",g.getProgramInfoLog(f));g.deleteShader(m);g.deleteShader(n);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):
|
|
|
-q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var v in h)q.push(v);h=q;v={};q=0;for(b=h.length;q<b;q++)r=h[q],v[r]=g.getUniformLocation(f,r);this.uniforms=v;q="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)q.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)q.push("morphNormal"+h);for(var w in k)q.push(w);e=q;k={};w=0;for(h=e.length;w<h;w++)v=e[w],k[v]=g.getAttribLocation(f,v);this.attributes=
|
|
|
-k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=f;this.vertexShader=m;this.fragmentShader=n;return this}}();
|
|
|
+"",e.shadowMapEnabled?"#define "+q:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));n=new THREE.WebGLShader(g,g.VERTEX_SHADER,d+n);p=new THREE.WebGLShader(g,g.FRAGMENT_SHADER,b+p);g.attachShader(f,n);g.attachShader(f,p);void 0!==m&&g.bindAttribLocation(f,0,m);g.linkProgram(f);!1===g.getProgramParameter(f,g.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),
|
|
|
+console.error("gl.VALIDATE_STATUS",g.getProgramParameter(f,g.VALIDATE_STATUS)),console.error("gl.getError()",g.getError()));""!==g.getProgramInfoLog(f)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",g.getProgramInfoLog(f));g.deleteShader(n);g.deleteShader(p);m="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" ");e.useVertexTexture?(m.push("boneTexture"),m.push("boneTextureWidth"),m.push("boneTextureHeight")):
|
|
|
+m.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&m.push("logDepthBufFC");for(var v in h)m.push(v);h=m;v={};m=0;for(b=h.length;m<b;m++)q=h[m],v[q]=g.getUniformLocation(f,q);this.uniforms=v;m="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" ");for(h=0;h<e.maxMorphTargets;h++)m.push("morphTarget"+h);for(h=0;h<e.maxMorphNormals;h++)m.push("morphNormal"+h);for(var w in k)m.push(w);e=m;k={};w=0;for(h=e.length;w<h;w++)v=e[w],k[v]=g.getAttribLocation(f,v);this.attributes=
|
|
|
+k;this.attributesKeys=Object.keys(this.attributes);this.id=a++;this.code=c;this.usedTimes=1;this.program=f;this.vertexShader=n;this.fragmentShader=p;return this}}();
|
|
|
THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var c=0;c<a.length;c++)a[c]=c+1+": "+a[c];return a.join("\n")};return function(b,c,d){c=b.createShader(c);b.shaderSource(c,d);b.compileShader(c);!1===b.getShaderParameter(c,b.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==b.getShaderInfoLog(c)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",b.getShaderInfoLog(c)),console.warn(a(d)));return c}}();
|
|
|
THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
|
|
|
THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b);g.flipY=!1;var f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&
|
|
|
c(g))})};d=0;for(var h=a.length;d<h;++d)b(d);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
|
|
|
-g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),m=k.data,n=0;n<d;n++)for(var q=0;q<e;q++){var r=0>q-1?0:q-1,t=q+1>e-1?e-1:q+1,p=0>n-1?0:n-1,s=n+1>d-1?d-1:n+1,v=[],w=[0,0,h[4*(q*d+n)]/255*b];v.push([-1,0,h[4*(q*d+p)]/255*b]);v.push([-1,-1,h[4*(r*d+p)]/255*b]);v.push([0,-1,h[4*(r*d+n)]/255*b]);v.push([1,-1,h[4*(r*d+s)]/255*b]);v.push([1,0,h[4*(q*d+s)]/255*b]);v.push([1,1,h[4*(t*d+s)]/255*b]);v.push([0,1,h[4*(t*d+n)]/255*
|
|
|
-b]);v.push([-1,1,h[4*(t*d+p)]/255*b]);r=[];p=v.length;for(t=0;t<p;t++){var s=v[t],u=v[(t+1)%p],s=[s[0]-w[0],s[1]-w[1],s[2]-w[2]],u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];r.push(c([s[1]*u[2]-s[2]*u[1],s[2]*u[0]-s[0]*u[2],s[0]*u[1]-s[1]*u[0]]))}v=[0,0,0];for(t=0;t<r.length;t++)v[0]+=r[t][0],v[1]+=r[t][1],v[2]+=r[t][2];v[0]/=r.length;v[1]/=r.length;v[2]/=r.length;w=4*(q*d+n);m[w]=(v[0]+1)/2*255|0;m[w+1]=(v[1]+1)/2*255|0;m[w+2]=255*v[2]|0;m[w+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
|
|
|
+g.width=d;g.height=e;var f=g.getContext("2d");f.drawImage(a,0,0);for(var h=f.getImageData(0,0,d,e).data,k=f.createImageData(d,e),n=k.data,p=0;p<d;p++)for(var m=0;m<e;m++){var q=0>m-1?0:m-1,t=m+1>e-1?e-1:m+1,s=0>p-1?0:p-1,r=p+1>d-1?d-1:p+1,v=[],w=[0,0,h[4*(m*d+p)]/255*b];v.push([-1,0,h[4*(m*d+s)]/255*b]);v.push([-1,-1,h[4*(q*d+s)]/255*b]);v.push([0,-1,h[4*(q*d+p)]/255*b]);v.push([1,-1,h[4*(q*d+r)]/255*b]);v.push([1,0,h[4*(m*d+r)]/255*b]);v.push([1,1,h[4*(t*d+r)]/255*b]);v.push([0,1,h[4*(t*d+p)]/255*
|
|
|
+b]);v.push([-1,1,h[4*(t*d+s)]/255*b]);q=[];s=v.length;for(t=0;t<s;t++){var r=v[t],u=v[(t+1)%s],r=[r[0]-w[0],r[1]-w[1],r[2]-w[2]],u=[u[0]-w[0],u[1]-w[1],u[2]-w[2]];q.push(c([r[1]*u[2]-r[2]*u[1],r[2]*u[0]-r[0]*u[2],r[0]*u[1]-r[1]*u[0]]))}v=[0,0,0];for(t=0;t<q.length;t++)v[0]+=q[t][0],v[1]+=q[t][1],v[2]+=q[t][2];v[0]/=q.length;v[1]/=q.length;v[2]/=q.length;w=4*(m*d+p);n[w]=(v[0]+1)/2*255|0;n[w+1]=(v[1]+1)/2*255|0;n[w+2]=255*v[2]|0;n[w+3]=255}f.putImageData(k,0,0);return g},generateDataTexture:function(a,
|
|
|
b,c){var d=a*b,e=new Uint8Array(3*d),g=Math.floor(255*c.r),f=Math.floor(255*c.g);c=Math.floor(255*c.b);for(var h=0;h<d;h++)e[3*h]=g,e[3*h+1]=f,e[3*h+2]=c;a=new THREE.DataTexture(e,a,b,THREE.RGBFormat);a.needsUpdate=!0;return a}};
|
|
|
THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;d<e;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld);b.remove(a);c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld);a.applyMatrix(d);b.remove(a);c.add(a)}};
|
|
|
THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing.";}},loadFace:function(a){var b=a.familyName.toLowerCase();this.faces[b]=this.faces[b]||{};this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{};this.faces[b][a.cssFontWeight][a.cssFontStyle]=a;return this.faces[b][a.cssFontWeight][a.cssFontStyle]=
|
|
|
-a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,m,n,q,r,t,p,s,v,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),m=b.length,a=0;a<m;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;n=b[a++]*c;e.moveTo(k,n);
|
|
|
-break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d;n=b[a++]*c;t=b[a++]*c+d;p=b[a++]*c;e.quadraticCurveTo(t,p,k,n);if(f=g[g.length-1])for(q=f.x,r=f.y,f=1,h=this.divisions;f<=h;f++){var u=f/h;THREE.Shape.Utils.b2(u,q,t,k);THREE.Shape.Utils.b2(u,r,p,n)}break;case "b":if(k=b[a++]*c+d,n=b[a++]*c,t=b[a++]*c+d,p=b[a++]*c,s=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,p,s,v,k,n),f=g[g.length-1])for(q=f.x,r=f.y,f=1,h=this.divisions;f<=h;f++)u=f/h,THREE.Shape.Utils.b3(u,q,t,s,k),THREE.Shape.Utils.b3(u,
|
|
|
-r,p,v,n)}return{offset:w.ha*c,path:e}}}};
|
|
|
+a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),g=e.length,f=[];for(a=0;a<g;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;f.push(h.path)}return{paths:f,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var g=[],f,h,k,n,p,m,q,t,s,r,v,w=b.glyphs[a]||b.glyphs["?"];if(w){if(w.o)for(b=w._cachedOutline||(w._cachedOutline=w.o.split(" ")),n=b.length,a=0;a<n;)switch(k=b[a++],k){case "m":k=b[a++]*c+d;p=b[a++]*c;e.moveTo(k,p);
|
|
|
+break;case "l":k=b[a++]*c+d;p=b[a++]*c;e.lineTo(k,p);break;case "q":k=b[a++]*c+d;p=b[a++]*c;t=b[a++]*c+d;s=b[a++]*c;e.quadraticCurveTo(t,s,k,p);if(f=g[g.length-1])for(m=f.x,q=f.y,f=1,h=this.divisions;f<=h;f++){var u=f/h;THREE.Shape.Utils.b2(u,m,t,k);THREE.Shape.Utils.b2(u,q,s,p)}break;case "b":if(k=b[a++]*c+d,p=b[a++]*c,t=b[a++]*c+d,s=b[a++]*c,r=b[a++]*c+d,v=b[a++]*c,e.bezierCurveTo(t,s,r,v,k,p),f=g[g.length-1])for(m=f.x,q=f.y,f=1,h=this.divisions;f<=h;f++)u=f/h,THREE.Shape.Utils.b3(u,m,t,r,k),THREE.Shape.Utils.b3(u,
|
|
|
+q,s,v,p)}return{offset:w.ha*c,path:e}}}};
|
|
|
THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
|
|
|
-(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,m,n;if(0<b(a))for(m=0;m<e;m++)f[m]=m;else for(m=0;m<e;m++)f[m]=e-1-m;var q=2*e;for(m=e-1;2<e;){if(0>=q--){console.log("Warning, unable to triangulate polygon!");break}k=m;e<=k&&(k=0);m=k+1;e<=m&&(m=0);n=m+1;e<=n&&(n=0);var r;a:{var t=r=void 0,p=void 0,s=void 0,v=void 0,w=void 0,u=void 0,z=void 0,x=void 0,
|
|
|
-t=a[f[k]].x,p=a[f[k]].y,s=a[f[m]].x,v=a[f[m]].y,w=a[f[n]].x,u=a[f[n]].y;if(1E-10>(s-t)*(u-p)-(v-p)*(w-t))r=!1;else{var F=void 0,C=void 0,B=void 0,y=void 0,D=void 0,J=void 0,K=void 0,S=void 0,Q=void 0,da=void 0,Q=S=K=x=z=void 0,F=w-s,C=u-v,B=t-w,y=p-u,D=s-t,J=v-p;for(r=0;r<e;r++)if(z=a[f[r]].x,x=a[f[r]].y,!(z===t&&x===p||z===s&&x===v||z===w&&x===u)&&(K=z-t,S=x-p,Q=z-s,da=x-v,z-=w,x-=u,Q=F*da-C*Q,K=D*S-J*K,S=B*x-y*z,-1E-10<=Q&&-1E-10<=S&&-1E-10<=K)){r=!1;break a}r=!0}}if(r){g.push([a[f[k]],a[f[m]],
|
|
|
-a[f[n]]]);h.push([f[k],f[m],f[n]]);k=m;for(n=m+1;n<e;k++,n++)f[k]=f[n];e--;q=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
|
|
|
+(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,n,p;if(0<b(a))for(n=0;n<e;n++)f[n]=n;else for(n=0;n<e;n++)f[n]=e-1-n;var m=2*e;for(n=e-1;2<e;){if(0>=m--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var q;a:{var t=q=void 0,s=void 0,r=void 0,v=void 0,w=void 0,u=void 0,z=void 0,x=void 0,
|
|
|
+t=a[f[k]].x,s=a[f[k]].y,r=a[f[n]].x,v=a[f[n]].y,w=a[f[p]].x,u=a[f[p]].y;if(1E-10>(r-t)*(u-s)-(v-s)*(w-t))q=!1;else{var G=void 0,F=void 0,B=void 0,y=void 0,E=void 0,R=void 0,I=void 0,O=void 0,C=void 0,W=void 0,C=O=I=x=z=void 0,G=w-r,F=u-v,B=t-w,y=s-u,E=r-t,R=v-s;for(q=0;q<e;q++)if(z=a[f[q]].x,x=a[f[q]].y,!(z===t&&x===s||z===r&&x===v||z===w&&x===u)&&(I=z-t,O=x-s,C=z-r,W=x-v,z-=w,x-=u,C=G*W-F*C,I=E*O-R*I,O=B*x-y*z,-1E-10<=C&&-1E-10<=O&&-1E-10<=I)){q=!1;break a}q=!0}}if(q){g.push([a[f[k]],a[f[n]],a[f[p]]]);
|
|
|
+h.push([f[k],f[n],f[p]]);k=n;for(p=n+1;p<e;k++,p++)f[k]=f[p];e--;m=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};THREE.typeface_js=self._typeface_js;
|
|
|
THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain)};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.source.connect(b.panner);b.source.start(0)})};c.send();return this};THREE.Audio.prototype.setLoop=function(a){this.source.loop=a};THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a};THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a};
|
|
|
THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}();THREE.AudioListener=function(){THREE.Object3D.call(this);this.type="AudioListener";this.context=new (window.AudioContext||window.webkitAudioContext)};THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype);
|
|
@@ -603,7 +603,7 @@ THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)
|
|
|
THREE.Curve.create=function(a,b){a.prototype=Object.create(THREE.Curve.prototype);a.prototype.getPoint=b;return a};THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=!1};THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype);THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){};
|
|
|
THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]};
|
|
|
THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a};
|
|
|
-THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,k,m,n,q=a[0]instanceof THREE.Vector3;n=q?new THREE.Vector3:new THREE.Vector2;k=0;for(m=a.length;k<m;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<g&&(g=h.y),q&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),n.add(h);a={minX:e,minY:g,maxX:b,maxY:c};q&&(a.maxZ=d,a.minZ=f);return a};
|
|
|
+THREE.CurvePath.prototype.getBoundingBox=function(){var a=this.getPoints(),b,c,d,e,g,f;b=c=Number.NEGATIVE_INFINITY;e=g=Number.POSITIVE_INFINITY;var h,k,n,p,m=a[0]instanceof THREE.Vector3;p=m?new THREE.Vector3:new THREE.Vector2;k=0;for(n=a.length;k<n;k++)h=a[k],h.x>b?b=h.x:h.x<e&&(e=h.x),h.y>c?c=h.y:h.y<g&&(g=h.y),m&&(h.z>d?d=h.z:h.z<f&&(f=h.z)),p.add(h);a={minX:e,minY:g,maxX:b,maxY:c};m&&(a.maxZ=d,a.minZ=f);return a};
|
|
|
THREE.CurvePath.prototype.createPointsGeometry=function(a){a=this.getPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createSpacedPointsGeometry=function(a){a=this.getSpacedPoints(a,!0);return this.createGeometry(a)};THREE.CurvePath.prototype.createGeometry=function(a){for(var b=new THREE.Geometry,c=0;c<a.length;c++)b.vertices.push(new THREE.Vector3(a[c].x,a[c].y,a[c].z||0));return b};THREE.CurvePath.prototype.addWrapPath=function(a){this.bends.push(a)};
|
|
|
THREE.CurvePath.prototype.getTransformedPoints=function(a,b){var c=this.getPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c=this.getSpacedPoints(a),d,e;b||(b=this.bends);d=0;for(e=b.length;d<e;d++)c=this.getWrapPoints(c,b[d]);return c};
|
|
|
THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c=this.getBoundingBox(),d,e,g,f,h,k;d=0;for(e=a.length;d<e;d++)g=a[d],f=g.x,h=g.y,k=f/c.maxX,k=b.getUtoTmapping(k,f),f=b.getPoint(k),k=b.getTangent(k),k.set(-k.y,k.x).multiplyScalar(h),g.x=f.x+k.x,g.y=f.y+k.y;return a};THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype);
|
|
@@ -616,22 +616,22 @@ THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,g){var f=Array.prototype.s
|
|
|
THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a);c=new THREE.SplineCurve(c);this.curves.push(c);this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})};THREE.Path.prototype.arc=function(a,b,c,d,e,g){var f=this.actions[this.actions.length-1].args;this.absarc(a+f[f.length-2],b+f[f.length-1],c,d,e,g)};
|
|
|
THREE.Path.prototype.absarc=function(a,b,c,d,e,g){this.absellipse(a,b,c,c,d,e,g)};THREE.Path.prototype.ellipse=function(a,b,c,d,e,g,f){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,g,f)};THREE.Path.prototype.absellipse=function(a,b,c,d,e,g,f){var h=Array.prototype.slice.call(arguments),k=new THREE.EllipseCurve(a,b,c,d,e,g,f);this.curves.push(k);k=k.getPoint(1);h.push(k.x);h.push(k.y);this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})};
|
|
|
THREE.Path.prototype.getSpacedPoints=function(a,b){a||(a=40);for(var c=[],d=0;d<a;d++)c.push(this.getPoint(d/a));return c};
|
|
|
-THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,m,n,q,r,t,p,s;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];q=g[0];r=g[1];0<c.length?(f=c[c.length-1],t=f.x,
|
|
|
-p=f.y):(f=this.actions[d-1].args,t=f[f.length-2],p=f[f.length-1]);for(g=1;g<=a;g++)s=g/a,f=THREE.Shape.Utils.b2(s,t,q,h),s=THREE.Shape.Utils.b2(s,p,r,k),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];q=g[0];r=g[1];m=g[2];n=g[3];0<c.length?(f=c[c.length-1],t=f.x,p=f.y):(f=this.actions[d-1].args,t=f[f.length-2],p=f[f.length-1]);for(g=1;g<=a;g++)s=g/a,f=THREE.Shape.Utils.b3(s,t,q,m,h),s=THREE.Shape.Utils.b3(s,p,r,n,k),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.CSPLINE_THRU:f=
|
|
|
-this.actions[d-1].args;s=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;s=s.concat(g[0]);s=new THREE.SplineCurve(s);for(g=1;g<=f;g++)c.push(s.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];r=g[2];m=g[3];f=g[4];q=!!g[5];t=f-m;p=2*a;for(g=1;g<=p;g++)s=g/p,q||(s=1-s),s=m+s*t,f=h+r*Math.cos(s),s=k+r*Math.sin(s),c.push(new THREE.Vector2(f,s));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],r=g[2],n=g[3],m=g[4],f=g[5],q=!!g[6],t=f-m,p=2*a,g=1;g<=p;g++)s=g/p,q||
|
|
|
-(s=1-s),s=m+s*t,f=h+r*Math.cos(s),s=k+n*Math.sin(s),c.push(new THREE.Vector2(f,s))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
|
|
|
+THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c=[],d,e,g,f,h,k,n,p,m,q,t,s,r;d=0;for(e=this.actions.length;d<e;d++)switch(g=this.actions[d],f=g.action,g=g.args,f){case THREE.PathActions.MOVE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.LINE_TO:c.push(new THREE.Vector2(g[0],g[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:h=g[2];k=g[3];m=g[0];q=g[1];0<c.length?(f=c[c.length-1],t=f.x,
|
|
|
+s=f.y):(f=this.actions[d-1].args,t=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b2(r,t,m,h),r=THREE.Shape.Utils.b2(r,s,q,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.BEZIER_CURVE_TO:h=g[4];k=g[5];m=g[0];q=g[1];n=g[2];p=g[3];0<c.length?(f=c[c.length-1],t=f.x,s=f.y):(f=this.actions[d-1].args,t=f[f.length-2],s=f[f.length-1]);for(g=1;g<=a;g++)r=g/a,f=THREE.Shape.Utils.b3(r,t,m,n,h),r=THREE.Shape.Utils.b3(r,s,q,p,k),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.CSPLINE_THRU:f=
|
|
|
+this.actions[d-1].args;r=[new THREE.Vector2(f[f.length-2],f[f.length-1])];f=a*g[0].length;r=r.concat(g[0]);r=new THREE.SplineCurve(r);for(g=1;g<=f;g++)c.push(r.getPointAt(g/f));break;case THREE.PathActions.ARC:h=g[0];k=g[1];q=g[2];n=g[3];f=g[4];m=!!g[5];t=f-n;s=2*a;for(g=1;g<=s;g++)r=g/s,m||(r=1-r),r=n+r*t,f=h+q*Math.cos(r),r=k+q*Math.sin(r),c.push(new THREE.Vector2(f,r));break;case THREE.PathActions.ELLIPSE:for(h=g[0],k=g[1],q=g[2],p=g[3],n=g[4],f=g[5],m=!!g[6],t=f-n,s=2*a,g=1;g<=s;g++)r=g/s,m||
|
|
|
+(r=1-r),r=n+r*t,f=h+q*Math.cos(r),r=k+p*Math.sin(r),c.push(new THREE.Vector2(f,r))}d=c[c.length-1];1E-10>Math.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c};
|
|
|
THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions;f.curves=e.curves;b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;f<c;e=f++){var g=b[e],h=b[f],k=h.x-g.x,m=h.y-g.y;if(1E-10<Math.abs(m)){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.y<g.y||a.y>h.y))if(a.y==g.y){if(a.x==g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=
|
|
|
-h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var g,f,h,k=[];if(1==e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var m=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),m=a?!m:m;
|
|
|
-h=[];var n=[],q=[],r=0,t;n[r]=void 0;q[r]=[];var p,s;p=0;for(s=e.length;p<s;p++)f=e[p],t=f.getPoints(),g=THREE.Shape.Utils.isClockWise(t),(g=a?!g:g)?(!m&&n[r]&&r++,n[r]={s:new THREE.Shape,p:t},n[r].s.actions=f.actions,n[r].s.curves=f.curves,m&&r++,q[r]=[]):q[r].push({h:f,p:t[0]});if(!n[0])return c(e);if(1<n.length){p=!1;s=[];f=0;for(e=n.length;f<e;f++)h[f]=[];f=0;for(e=n.length;f<e;f++)for(g=q[f],m=0;m<g.length;m++){r=g[m];t=!0;for(var v=0;v<n.length;v++)d(r.p,n[v].p)&&(f!=v&&s.push({froms:f,tos:v,
|
|
|
-hole:m}),t?(t=!1,h[v].push(r)):p=!0);t&&h[f].push(r)}0<s.length&&(p||(q=h))}p=0;for(s=n.length;p<s;p++)for(h=n[p].s,k.push(h),f=q[p],e=0,g=f.length;e<g;e++)h.holes.push(f[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};
|
|
|
+h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;b<c;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);0!=g.actions.length&&f.push(g);return f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var g,f,h,k=[];if(1==e.length)return f=e[0],h=new THREE.Shape,h.actions=f.actions,h.curves=f.curves,k.push(h),k;var n=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),n=a?!n:n;
|
|
|
+h=[];var p=[],m=[],q=0,t;p[q]=void 0;m[q]=[];var s,r;s=0;for(r=e.length;s<r;s++)f=e[s],t=f.getPoints(),g=THREE.Shape.Utils.isClockWise(t),(g=a?!g:g)?(!n&&p[q]&&q++,p[q]={s:new THREE.Shape,p:t},p[q].s.actions=f.actions,p[q].s.curves=f.curves,n&&q++,m[q]=[]):m[q].push({h:f,p:t[0]});if(!p[0])return c(e);if(1<p.length){s=!1;r=[];f=0;for(e=p.length;f<e;f++)h[f]=[];f=0;for(e=p.length;f<e;f++)for(g=m[f],n=0;n<g.length;n++){q=g[n];t=!0;for(var v=0;v<p.length;v++)d(q.p,p[v].p)&&(f!=v&&r.push({froms:f,tos:v,
|
|
|
+hole:n}),t?(t=!1,h[v].push(q)):s=!0);t&&h[f].push(q)}0<r.length&&(s||(m=h))}s=0;for(r=p.length;s<r;s++)for(h=p[s].s,k.push(h),f=m[s],e=0,g=f.length;e<g;e++)h.holes.push(f[e].h);return k};THREE.Shape=function(){THREE.Path.apply(this,arguments);this.holes=[]};THREE.Shape.prototype=Object.create(THREE.Path.prototype);THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)};THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)};
|
|
|
THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d};THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;b<c;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d};THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}};
|
|
|
THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)};THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}};
|
|
|
-THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,m=e.y-d.y,n=a.x-d.x,q=a.y-d.y,B=h*k-g*m,y=h*n-g*q;if(1E-10<Math.abs(B)){if(0<B){if(0>y||y>B)return[];k=m*n-k*q;if(0>k||k>B)return[]}else{if(0<y||y<B)return[];k=m*n-k*q;if(0<k||k<B)return[]}if(0==k)return!f||0!=y&&y!=B?[a]:[];if(k==B)return!f||0!=y&&y!=B?[b]:[];if(0==y)return[d];
|
|
|
-if(y==B)return[e];f=k/B;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=y||m*n!=k*q)return[];h=0==g&&0==h;k=0==k&&0==m;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,B=d.x,m=e,d=e.x):(b=e,B=e.x,m=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,B=d.y,m=e,d=e.y):(b=e,B=e.y,m=d,d=d.y));return k<=B?a<B?[]:a==B?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
|
|
|
-[g,m]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,m,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)m=h[g].x+":"+h[g].y,void 0!==n[m]&&console.log("Duplicate point",m),n[m]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
|
|
|
-d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<m.length;e++)for(f=b[m[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,m=[],n,q,C,B,y,D=[],J,K,S,Q=0;for(n=b.length;Q<n;Q++)m.push(Q);J=0;for(var da=2*m.length;0<m.length;){da--;if(0>da){console.log("Infinite Loop! Holes left:"+
|
|
|
-m.length+", Probably Hole outside Shape!");break}for(q=J;q<h.length;q++){C=h[q];n=-1;for(Q=0;Q<m.length;Q++)if(B=m[Q],y=C.x+":"+C.y+":"+B,void 0===D[y]){k=b[B];for(K=0;K<k.length;K++)if(B=k[K],c(q,K)&&!f(C,B)&&!g(C,B)){n=K;m.splice(Q,1);J=h.slice(0,q+1);B=h.slice(q);K=k.slice(n);S=k.slice(0,n+1);h=J.concat(K).concat(S).concat(B);J=q;break}if(0<=n)break;D[y]=!0}if(0<=n)break}}return h}(a,b);var q=THREE.FontUtils.Triangulate(g,!1);g=0;for(f=q.length;g<f;g++)for(k=q[g],h=0;3>h;h++)m=k[h].x+":"+k[h].y,
|
|
|
-m=n[m],void 0!==m&&(k[h]=m);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
|
|
|
+THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,m=e.y-d.y,n=a.x-d.x,p=a.y-d.y,B=h*k-g*m,y=h*n-g*p;if(1E-10<Math.abs(B)){if(0<B){if(0>y||y>B)return[];k=m*n-k*p;if(0>k||k>B)return[]}else{if(0<y||y<B)return[];k=m*n-k*p;if(0<k||k<B)return[]}if(0==k)return!f||0!=y&&y!=B?[a]:[];if(k==B)return!f||0!=y&&y!=B?[b]:[];if(0==y)return[d];
|
|
|
+if(y==B)return[e];f=k/B;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!=y||m*n!=k*p)return[];h=0==g&&0==h;k=0==k&&0==m;if(h&&k)return a.x!=d.x||a.y!=d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!=g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,B=d.x,m=e,d=e.x):(b=e,B=e.x,m=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,B=d.y,m=e,d=e.y):(b=e,B=e.y,m=d,d=d.y));return k<=B?a<B?[]:a==B?f?[]:[b]:a<=d?[b,h]:[b,m]:k>d?[]:k==d?f?[]:[g]:a<=d?[g,h]:
|
|
|
+[g,m]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,n,p={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)n=h[g].x+":"+h[g].y,void 0!==p[n]&&console.log("Duplicate point",n),p[n]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;
|
|
|
+d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<m.length;e++)for(f=b[m[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,m=[],n,p,F,B,y,E=[],R,I,O,C=0;for(n=b.length;C<n;C++)m.push(C);R=0;for(var W=2*m.length;0<m.length;){W--;if(0>W){console.log("Infinite Loop! Holes left:"+
|
|
|
+m.length+", Probably Hole outside Shape!");break}for(p=R;p<h.length;p++){F=h[p];n=-1;for(C=0;C<m.length;C++)if(B=m[C],y=F.x+":"+F.y+":"+B,void 0===E[y]){k=b[B];for(I=0;I<k.length;I++)if(B=k[I],c(p,I)&&!f(F,B)&&!g(F,B)){n=I;m.splice(C,1);R=h.slice(0,p+1);B=h.slice(p);I=k.slice(n);O=k.slice(0,n+1);h=R.concat(I).concat(O).concat(B);R=p;break}if(0<=n)break;E[y]=!0}if(0<=n)break}}return h}(a,b);var m=THREE.FontUtils.Triangulate(g,!1);g=0;for(f=m.length;g<f;g++)for(k=m[g],h=0;3>h;h++)n=k[h].x+":"+k[h].y,
|
|
|
+n=p[n],void 0!==n&&(k[h]=n);return m.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,
|
|
|
b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};
|
|
|
THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};
|
|
|
THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);
|
|
@@ -653,12 +653,12 @@ THREE.Animation.prototype.play=function(a,b){this.currentTime=void 0!==a?a:0;thi
|
|
|
THREE.Animation.prototype.reset=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];c.matrixAutoUpdate=!0;void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});void 0===c.animationCache.animations[this.data.name]&&(c.animationCache.animations[this.data.name]={},c.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},c.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},
|
|
|
c.animationCache.animations[this.data.name].originalMatrix=c.matrix);for(var c=c.animationCache.animations[this.data.name],d=0;3>d;d++){for(var e=this.keyTypes[d],g=this.data.hierarchy[a].keys[0],f=this.getNextKeyWith(e,a,1);f.time<this.currentTime&&f.index>g.index;)g=f,f=this.getNextKeyWith(e,a,f.index+1);c.prevKey[e]=g;c.nextKey[e]=f}}};
|
|
|
THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;a<b;a++){var c=this.hierarchy[a];void 0!==c.animationCache&&(c.animationCache.blending.positionWeight=0,c.animationCache.blending.quaternionWeight=0,c.animationCache.blending.scaleWeight=0)}};
|
|
|
-THREE.Animation.prototype.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,q,r,t,p,s;e=(a.length-1)*b;q=Math.floor(e);e-=q;c[0]=0===q?q:q-1;c[1]=q;c[2]=q>a.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];p=a[c[2]];s=a[c[3]];c=e*e;r=e*c;d[0]=g(q[0],t[0],p[0],s[0],e,c,r);d[1]=g(q[1],t[1],p[1],s[1],e,c,r);d[2]=g(q[2],t[2],p[2],s[2],e,c,r);return d},g=function(a,b,c,d,e,g,r){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*r+
|
|
|
-(-3*(b-c)-2*a-d)*g+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],m=k.animationCache.animations[this.data.name],n=k.animationCache.blending,q=0;3>q;q++){var r=this.keyTypes[q],t=m.prevKey[r],p=m.nextKey[r];
|
|
|
-if(0<this.timeScale&&p.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(p=this.getNextKeyWith(r,f,1);p.time<this.currentTime&&p.index>t.index;)t=p,p=this.getNextKeyWith(r,f,p.index+1);m.prevKey[r]=t;m.nextKey[r]=p}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var s=(this.currentTime-t.time)/(p.time-t.time),v=t[r],w=p[r];0>s&&(s=0);1<s&&(s=1);if("pos"===r)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=v[0]+(w[0]-v[0])*s,c.y=
|
|
|
-v[1]+(w[1]-v[1])*s,c.z=v[2]+(w[2]-v[2])*s,t=this.weight/(this.weight+n.positionWeight),k.position.lerp(c,t),n.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=v,a[2]=w,a[3]=this.getNextKeyWith("pos",f,p.index+1).pos,s=.33*s+.33,p=e(a,s),t=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,r=k.position,r.x+=(p[0]-
|
|
|
-r.x)*t,r.y+=(p[1]-r.y)*t,r.z+=(p[2]-r.z)*t,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(s=e(a,1.01*s),b.set(s[0],s[1],s[2]),b.sub(r),b.y=0,b.normalize(),s=Math.atan2(b.x,b.z),k.rotation.set(0,s,0))}else"rot"===r?(THREE.Quaternion.slerp(v,w,d,s),0===n.quaternionWeight?(k.quaternion.copy(d),n.quaternionWeight=this.weight):(t=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),n.quaternionWeight+=this.weight)):"scl"===r&&(c.x=v[0]+
|
|
|
-(w[0]-v[0])*s,c.y=v[1]+(w[1]-v[1])*s,c.z=v[2]+(w[2]-v[2])*s,t=this.weight/(this.weight+n.scaleWeight),k.scale.lerp(c,t),n.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(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.update=function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c=[],d=[],e,m,q,t,s,r;e=(a.length-1)*b;m=Math.floor(e);e-=m;c[0]=0===m?m:m-1;c[1]=m;c[2]=m>a.length-2?m:m+1;c[3]=m>a.length-3?m:m+2;m=a[c[0]];t=a[c[1]];s=a[c[2]];r=a[c[3]];c=e*e;q=e*c;d[0]=g(m[0],t[0],s[0],r[0],e,c,q);d[1]=g(m[1],t[1],s[1],r[1],e,c,q);d[2]=g(m[2],t[2],s[2],r[2],e,c,q);return d},g=function(a,b,c,d,e,g,q){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*q+
|
|
|
+(-3*(b-c)-2*a-d)*g+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)if(this.loop)this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset();else{this.stop();return}f=0;for(var g=this.hierarchy.length;f<g;f++)for(var k=this.hierarchy[f],n=k.animationCache.animations[this.data.name],p=k.animationCache.blending,m=0;3>m;m++){var q=this.keyTypes[m],t=n.prevKey[q],s=n.nextKey[q];
|
|
|
+if(0<this.timeScale&&s.time<=this.currentTime||0>this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(q,f,1);s.time<this.currentTime&&s.index>t.index;)t=s,s=this.getNextKeyWith(q,f,s.index+1);n.prevKey[q]=t;n.nextKey[q]=s}k.matrixAutoUpdate=!0;k.matrixWorldNeedsUpdate=!0;var r=(this.currentTime-t.time)/(s.time-t.time),v=t[q],w=s[q];0>r&&(r=0);1<r&&(r=1);if("pos"===q)if(this.interpolationType===THREE.AnimationHandler.LINEAR)c.x=v[0]+(w[0]-v[0])*r,c.y=
|
|
|
+v[1]+(w[1]-v[1])*r,c.z=v[2]+(w[2]-v[2])*r,t=this.weight/(this.weight+p.positionWeight),k.position.lerp(c,t),p.positionWeight+=this.weight;else{if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)a[0]=this.getPrevKeyWith("pos",f,t.index-1).pos,a[1]=v,a[2]=w,a[3]=this.getNextKeyWith("pos",f,s.index+1).pos,r=.33*r+.33,s=e(a,r),t=this.weight/(this.weight+p.positionWeight),p.positionWeight+=this.weight,q=k.position,q.x+=(s[0]-
|
|
|
+q.x)*t,q.y+=(s[1]-q.y)*t,q.z+=(s[2]-q.z)*t,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(r=e(a,1.01*r),b.set(r[0],r[1],r[2]),b.sub(q),b.y=0,b.normalize(),r=Math.atan2(b.x,b.z),k.rotation.set(0,r,0))}else"rot"===q?(THREE.Quaternion.slerp(v,w,d,r),0===p.quaternionWeight?(k.quaternion.copy(d),p.quaternionWeight=this.weight):(t=this.weight/(this.weight+p.quaternionWeight),THREE.Quaternion.slerp(k.quaternion,d,k.quaternion,t),p.quaternionWeight+=this.weight)):"scl"===q&&(c.x=v[0]+
|
|
|
+(w[0]-v[0])*r,c.y=v[1]+(w[1]-v[1])*r,c.z=v[2]+(w[2]-v[2])*r,t=this.weight/(this.weight+p.scaleWeight),k.scale.lerp(c,t),p.scaleWeight+=this.weight)}return!0}}}();THREE.Animation.prototype.getNextKeyWith=function(a,b,c){var d=this.data.hierarchy[b].keys;for(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){var d=this.data.hierarchy[b].keys;for(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){this.root=a.node;this.data=THREE.AnimationHandler.init(a);this.hierarchy=THREE.AnimationHandler.parse(this.root);this.currentTime=0;this.timeScale=.001;this.isPlaying=!1;this.loop=this.isPaused=!0;a=0;for(var 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 g=c[e],f=this.getNextKeyWith(g,a,0);f&&f.apply(g)}d.matrixAutoUpdate=!1;this.data.hierarchy[a].node.updateMatrix();
|
|
|
d.matrixWorldNeedsUpdate=!0}}};
|
|
@@ -669,64 +669,64 @@ g;d.nextKey=f}f.time>=this.currentTime?g.interpolate(f,this.currentTime):g.inter
|
|
|
THREE.KeyFrameAnimation.prototype.getPrevKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c=0<=c?c:c+b.length;0<=c;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]};THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.isPlaying=!1};
|
|
|
THREE.MorphAnimation.prototype={play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(){var a=0,b=0;return function(c){if(!1!==this.isPlaying){this.currentTime+=c;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);c=this.duration/this.frames;var d=Math.floor(this.currentTime/c);d!=b&&(this.mesh.morphTargetInfluences[a]=0,this.mesh.morphTargetInfluences[b]=1,this.mesh.morphTargetInfluences[d]=
|
|
|
0,a=b,b=d);this.mesh.morphTargetInfluences[d]=this.currentTime%c/c;this.mesh.morphTargetInfluences[a]=1-this.mesh.morphTargetInfluences[d]}}}()};
|
|
|
-THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,s){var v,w=h.widthSegments,u=h.heightSegments,z=e/2,x=f/2,F=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var C=w+1,B=u+1,y=e/w,D=f/u,J=new THREE.Vector3;J[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<C;f++){var K=new THREE.Vector3;K[a]=(f*y-z)*c;K[b]=(e*D-x)*d;K[v]=g;h.vertices.push(K)}for(e=
|
|
|
-0;e<u;e++)for(f=0;f<w;f++)x=f+C*e,a=f+C*(e+1),b=f+1+C*(e+1),c=f+1+C*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),z=new THREE.Vector2((f+1)/w,1-e/u),x=new THREE.Face3(x+F,a+F,c+F),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=s,h.faces.push(x),h.faceVertexUvs[0].push([d,g,z]),x=new THREE.Face3(a+F,b+F,c+F),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=s,h.faces.push(x),
|
|
|
+THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,r){var v,w=h.widthSegments,u=h.heightSegments,z=e/2,x=f/2,G=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)v="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)v="y",u=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)v="x",w=h.depthSegments;var F=w+1,B=u+1,y=e/w,E=f/u,R=new THREE.Vector3;R[v]=0<g?1:-1;for(e=0;e<B;e++)for(f=0;f<F;f++){var I=new THREE.Vector3;I[a]=(f*y-z)*c;I[b]=(e*E-x)*d;I[v]=g;h.vertices.push(I)}for(e=
|
|
|
+0;e<u;e++)for(f=0;f<w;f++)x=f+F*e,a=f+F*(e+1),b=f+1+F*(e+1),c=f+1+F*e,d=new THREE.Vector2(f/w,1-e/u),g=new THREE.Vector2(f/w,1-(e+1)/u),v=new THREE.Vector2((f+1)/w,1-(e+1)/u),z=new THREE.Vector2((f+1)/w,1-e/u),x=new THREE.Face3(x+G,a+G,c+G),x.normal.copy(R),x.vertexNormals.push(R.clone(),R.clone(),R.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,z]),x=new THREE.Face3(a+G,b+G,c+G),x.normal.copy(R),x.vertexNormals.push(R.clone(),R.clone(),R.clone()),x.materialIndex=r,h.faces.push(x),
|
|
|
h.faceVertexUvs[0].push([g.clone(),v,z.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="CircleGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e,g=[];e=new THREE.Vector3;var f=new THREE.Vector2(.5,.5);this.vertices.push(e);g.push(f);for(e=0;e<=b;e++){var h=new THREE.Vector3,k=c+e/b*d;h.x=a*Math.cos(k);h.y=a*Math.sin(k);this.vertices.push(h);g.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}c=new THREE.Vector3(0,
|
|
|
0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CubeGeometry=function(a,b,c,d,e,g){console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry.");return new THREE.BoxGeometry(a,b,c,d,e,g)};
|
|
|
-THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;var f=c/2,h,k,m=[],n=[];for(k=0;k<=e;k++){var q=[],r=[],t=k/e,p=t*(b-a)+a;for(h=0;h<=d;h++){var s=h/d,v=new THREE.Vector3;v.x=p*Math.sin(s*Math.PI*2);v.y=-t*c+f;v.z=p*Math.cos(s*Math.PI*2);this.vertices.push(v);q.push(this.vertices.length-
|
|
|
-1);r.push(new THREE.Vector2(s,1-t))}m.push(q);n.push(r)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(q=this.vertices[m[0][h]].clone(),r=this.vertices[m[0][h+1]].clone()):(q=this.vertices[m[1][h]].clone(),r=this.vertices[m[1][h+1]].clone()),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),r.setY(Math.sqrt(r.x*r.x+r.z*r.z)*c).normalize(),k=0;k<e;k++){var t=m[k][h],p=m[k+1][h],s=m[k+1][h+1],v=m[k][h+1],w=q.clone(),u=q.clone(),z=r.clone(),x=r.clone(),F=n[k][h].clone(),C=n[k+1][h].clone(),B=n[k+1][h+1].clone(),
|
|
|
-y=n[k][h+1].clone();this.faces.push(new THREE.Face3(t,p,v,[w,u,x]));this.faceVertexUvs[0].push([F,C,y]);this.faces.push(new THREE.Face3(p,s,v,[u.clone(),z,x.clone()]));this.faceVertexUvs[0].push([C.clone(),B,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=m[0][h],p=m[0][h+1],s=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),F=n[0][h].clone(),C=n[0][h+1].clone(),B=new THREE.Vector2(C.x,0),this.faces.push(new THREE.Face3(t,
|
|
|
-p,s,[w,u,z])),this.faceVertexUvs[0].push([F,C,B]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=m[k][h+1],p=m[k][h],s=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),F=n[k][h+1].clone(),C=n[k][h].clone(),B=new THREE.Vector2(C.x,1),this.faces.push(new THREE.Face3(t,p,s,[w,u,z])),this.faceVertexUvs[0].push([F,C,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
+THREE.CylinderGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;var f=c/2,h,k,n=[],p=[];for(k=0;k<=e;k++){var m=[],q=[],t=k/e,s=t*(b-a)+a;for(h=0;h<=d;h++){var r=h/d,v=new THREE.Vector3;v.x=s*Math.sin(r*Math.PI*2);v.y=-t*c+f;v.z=s*Math.cos(r*Math.PI*2);this.vertices.push(v);m.push(this.vertices.length-
|
|
|
+1);q.push(new THREE.Vector2(r,1-t))}n.push(m);p.push(q)}c=(b-a)/c;for(h=0;h<d;h++)for(0!==a?(m=this.vertices[n[0][h]].clone(),q=this.vertices[n[0][h+1]].clone()):(m=this.vertices[n[1][h]].clone(),q=this.vertices[n[1][h+1]].clone()),m.setY(Math.sqrt(m.x*m.x+m.z*m.z)*c).normalize(),q.setY(Math.sqrt(q.x*q.x+q.z*q.z)*c).normalize(),k=0;k<e;k++){var t=n[k][h],s=n[k+1][h],r=n[k+1][h+1],v=n[k][h+1],w=m.clone(),u=m.clone(),z=q.clone(),x=q.clone(),G=p[k][h].clone(),F=p[k+1][h].clone(),B=p[k+1][h+1].clone(),
|
|
|
+y=p[k][h+1].clone();this.faces.push(new THREE.Face3(t,s,v,[w,u,x]));this.faceVertexUvs[0].push([G,F,y]);this.faces.push(new THREE.Face3(s,r,v,[u.clone(),z,x.clone()]));this.faceVertexUvs[0].push([F.clone(),B,y.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,f,0)),h=0;h<d;h++)t=n[0][h],s=n[0][h+1],r=this.vertices.length-1,w=new THREE.Vector3(0,1,0),u=new THREE.Vector3(0,1,0),z=new THREE.Vector3(0,1,0),G=p[0][h].clone(),F=p[0][h+1].clone(),B=new THREE.Vector2(F.x,0),this.faces.push(new THREE.Face3(t,
|
|
|
+s,r,[w,u,z])),this.faceVertexUvs[0].push([G,F,B]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-f,0)),h=0;h<d;h++)t=n[k][h+1],s=n[k][h],r=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),u=new THREE.Vector3(0,-1,0),z=new THREE.Vector3(0,-1,0),G=p[k][h+1].clone(),F=p[k][h].clone(),B=new THREE.Vector2(F.x,1),this.faces.push(new THREE.Face3(t,s,r,[w,u,z])),this.faceVertexUvs[0].push([G,F,B]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),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=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)==
|
|
|
-Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(c,d){var e,f;for(L=c.length;0<=--L;){e=L;f=L-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*n,g=0;g<h;g++){var k=ya*g,m=ya*(g+1),p=d+e+k,k=d+f+k,q=d+f+m,m=d+e+m,s=c,r=g,v=h,w=e,x=f,p=p+S,k=k+S,q=q+S,m=m+S;K.faces.push(new THREE.Face3(p,k,m,null,null,u));K.faces.push(new THREE.Face3(k,q,m,null,null,u));p=z.generateSideWallUV(K,a,s,b,p,k,q,m,r,v,w,x);K.faceVertexUvs[0].push([p[0],p[1],p[3]]);
|
|
|
-K.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function g(a,b,c){K.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=S;d+=S;e+=S;K.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?z.generateBottomUV(K,a,b,c,d,e):z.generateTopUV(K,a,b,c,d,e);K.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,m=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==
|
|
|
-b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,p=b.extrudePath,s,v=!1,w=b.material,u=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,F,C,B;p&&(s=p.getSpacedPoints(t),v=!0,q=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(p,t,!1),F=new THREE.Vector3,C=new THREE.Vector3,B=new THREE.Vector3);q||(m=k=n=0);var y,D,J,K=this,S=this.vertices.length,p=a.extractPoints(r),r=p.shape,Q=p.holes;if(p=!THREE.Shape.Utils.isClockWise(r)){r=
|
|
|
-r.reverse();D=0;for(J=Q.length;D<J;D++)y=Q[D],THREE.Shape.Utils.isClockWise(y)&&(Q[D]=y.reverse());p=!1}var da=THREE.Shape.Utils.triangulateShape(r,Q),V=r;D=0;for(J=Q.length;D<J;D++)y=Q[D],r=r.concat(y);var R,G,N,xa,P,ya=r.length,la,sa=da.length,p=[],L=0;N=V.length;R=N-1;for(G=L+1;L<N;L++,R++,G++)R===N&&(R=0),G===N&&(G=0),p[L]=d(V[L],V[R],V[G]);var ha=[],ra,Ia=p.concat();D=0;for(J=Q.length;D<J;D++){y=Q[D];ra=[];L=0;N=y.length;R=N-1;for(G=L+1;L<N;L++,R++,G++)R===N&&(R=0),G===N&&(G=0),ra[L]=d(y[L],
|
|
|
-y[R],y[G]);ha.push(ra);Ia=Ia.concat(ra)}for(R=0;R<n;R++){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,-xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),g(P.x,P.y,-xa)}G=m;for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],G):r[L],v?(C.copy(x.normals[0]).multiplyScalar(P.x),F.copy(x.binormals[0]).multiplyScalar(P.y),B.copy(s[0]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,0);for(N=1;N<=t;N++)for(L=0;L<ya;L++)P=q?c(r[L],Ia[L],
|
|
|
-G):r[L],v?(C.copy(x.normals[N]).multiplyScalar(P.x),F.copy(x.binormals[N]).multiplyScalar(P.y),B.copy(s[N]).add(C).add(F),g(B.x,B.y,B.z)):g(P.x,P.y,h/t*N);for(R=n-1;0<=R;R--){N=R/n;xa=k*(1-N);G=m*Math.sin(N*Math.PI/2);L=0;for(N=V.length;L<N;L++)P=c(V[L],p[L],G),g(P.x,P.y,h+xa);D=0;for(J=Q.length;D<J;D++)for(y=Q[D],ra=ha[D],L=0,N=y.length;L<N;L++)P=c(y[L],ra[L],G),v?g(P.x,P.y+s[t-1].y,s[t-1].x+xa):g(P.x,P.y,h+xa)}(function(){if(q){var a;a=0*ya;for(L=0;L<sa;L++)la=da[L],f(la[2]+a,la[1]+a,la[0]+a,!0);
|
|
|
-a=t+2*n;a*=ya;for(L=0;L<sa;L++)la=da[L],f(la[0]+a,la[1]+a,la[2]+a,!1)}else{for(L=0;L<sa;L++)la=da[L],f(la[2],la[1],la[0],!0);for(L=0;L<sa;L++)la=da[L],f(la[0]+ya*t,la[1]+ya*t,la[2]+ya*t,!1)}})();(function(){var a=0;e(V,a);a+=V.length;D=0;for(J=Q.length;D<J;D++)y=Q[D],e(y,a),a+=y.length})()};
|
|
|
-THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[d];e=a.vertices[e];a=a.vertices[g];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(e.x,e.y),new THREE.Vector2(a.x,a.y)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,m,n,q){b=a.vertices[e];g=a.vertices[g];f=a.vertices[f];a=a.vertices[h];return.01>Math.abs(b.y-g.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(g.x,1-g.z),new THREE.Vector2(f.x,
|
|
|
+Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(c,d){var e,f;for(N=c.length;0<=--N;){e=N;f=N-1;0>f&&(f=c.length-1);for(var g=0,h=t+2*p,g=0;g<h;g++){var k=Y*g,m=Y*(g+1),n=d+e+k,k=d+f+k,q=d+f+m,m=d+e+m,s=c,r=g,v=h,w=e,x=f,n=n+O,k=k+O,q=q+O,m=m+O;I.faces.push(new THREE.Face3(n,k,m,null,null,u));I.faces.push(new THREE.Face3(k,q,m,null,null,u));n=z.generateSideWallUV(I,a,s,b,n,k,q,m,r,v,w,x);I.faceVertexUvs[0].push([n[0],n[1],n[3]]);
|
|
|
+I.faceVertexUvs[0].push([n[1],n[2],n[3]])}}}function g(a,b,c){I.vertices.push(new THREE.Vector3(a,b,c))}function f(c,d,e,f){c+=O;d+=O;e+=O;I.faces.push(new THREE.Face3(c,d,e,null,null,w));c=f?z.generateBottomUV(I,a,b,c,d,e):z.generateTopUV(I,a,b,c,d,e);I.faceVertexUvs[0].push(c)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,n=void 0!==b.bevelSize?b.bevelSize:k-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,m=void 0!==b.bevelEnabled?b.bevelEnabled:!0,q=void 0!==
|
|
|
+b.curveSegments?b.curveSegments:12,t=void 0!==b.steps?b.steps:1,s=b.extrudePath,r,v=!1,w=b.material,u=b.extrudeMaterial,z=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,x,G,F,B;s&&(r=s.getSpacedPoints(t),v=!0,m=!1,x=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(s,t,!1),G=new THREE.Vector3,F=new THREE.Vector3,B=new THREE.Vector3);m||(n=k=p=0);var y,E,R,I=this,O=this.vertices.length,s=a.extractPoints(q),q=s.shape,C=s.holes;if(s=!THREE.Shape.Utils.isClockWise(q)){q=
|
|
|
+q.reverse();E=0;for(R=C.length;E<R;E++)y=C[E],THREE.Shape.Utils.isClockWise(y)&&(C[E]=y.reverse());s=!1}var W=THREE.Shape.Utils.triangulateShape(q,C),U=q;E=0;for(R=C.length;E<R;E++)y=C[E],q=q.concat(y);var Q,V,P,sa,L,Y=q.length,ga,ua=W.length,s=[],N=0;P=U.length;Q=P-1;for(V=N+1;N<P;N++,Q++,V++)Q===P&&(Q=0),V===P&&(V=0),s[N]=d(U[N],U[Q],U[V]);var ja=[],wa,Ia=s.concat();E=0;for(R=C.length;E<R;E++){y=C[E];wa=[];N=0;P=y.length;Q=P-1;for(V=N+1;N<P;N++,Q++,V++)Q===P&&(Q=0),V===P&&(V=0),wa[N]=d(y[N],y[Q],
|
|
|
+y[V]);ja.push(wa);Ia=Ia.concat(wa)}for(Q=0;Q<p;Q++){P=Q/p;sa=k*(1-P);V=n*Math.sin(P*Math.PI/2);N=0;for(P=U.length;N<P;N++)L=c(U[N],s[N],V),g(L.x,L.y,-sa);E=0;for(R=C.length;E<R;E++)for(y=C[E],wa=ja[E],N=0,P=y.length;N<P;N++)L=c(y[N],wa[N],V),g(L.x,L.y,-sa)}V=n;for(N=0;N<Y;N++)L=m?c(q[N],Ia[N],V):q[N],v?(F.copy(x.normals[0]).multiplyScalar(L.x),G.copy(x.binormals[0]).multiplyScalar(L.y),B.copy(r[0]).add(F).add(G),g(B.x,B.y,B.z)):g(L.x,L.y,0);for(P=1;P<=t;P++)for(N=0;N<Y;N++)L=m?c(q[N],Ia[N],V):q[N],
|
|
|
+v?(F.copy(x.normals[P]).multiplyScalar(L.x),G.copy(x.binormals[P]).multiplyScalar(L.y),B.copy(r[P]).add(F).add(G),g(B.x,B.y,B.z)):g(L.x,L.y,h/t*P);for(Q=p-1;0<=Q;Q--){P=Q/p;sa=k*(1-P);V=n*Math.sin(P*Math.PI/2);N=0;for(P=U.length;N<P;N++)L=c(U[N],s[N],V),g(L.x,L.y,h+sa);E=0;for(R=C.length;E<R;E++)for(y=C[E],wa=ja[E],N=0,P=y.length;N<P;N++)L=c(y[N],wa[N],V),v?g(L.x,L.y+r[t-1].y,r[t-1].x+sa):g(L.x,L.y,h+sa)}(function(){if(m){var a;a=0*Y;for(N=0;N<ua;N++)ga=W[N],f(ga[2]+a,ga[1]+a,ga[0]+a,!0);a=t+2*p;
|
|
|
+a*=Y;for(N=0;N<ua;N++)ga=W[N],f(ga[0]+a,ga[1]+a,ga[2]+a,!1)}else{for(N=0;N<ua;N++)ga=W[N],f(ga[2],ga[1],ga[0],!0);for(N=0;N<ua;N++)ga=W[N],f(ga[0]+Y*t,ga[1]+Y*t,ga[2]+Y*t,!1)}})();(function(){var a=0;e(U,a);a+=U.length;E=0;for(R=C.length;E<R;E++)y=C[E],e(y,a),a+=y.length})()};
|
|
|
+THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d,e,g){b=a.vertices[d];e=a.vertices[e];a=a.vertices[g];return[new THREE.Vector2(b.x,b.y),new THREE.Vector2(e.x,e.y),new THREE.Vector2(a.x,a.y)]},generateBottomUV:function(a,b,c,d,e,g){return this.generateTopUV(a,b,c,d,e,g)},generateSideWallUV:function(a,b,c,d,e,g,f,h,k,n,p,m){b=a.vertices[e];g=a.vertices[g];f=a.vertices[f];a=a.vertices[h];return.01>Math.abs(b.y-g.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(g.x,1-g.z),new THREE.Vector2(f.x,
|
|
|
1-f.z),new THREE.Vector2(a.x,1-a.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(g.y,1-g.z),new THREE.Vector2(f.y,1-f.z),new THREE.Vector2(a.y,1-a.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;c<d;c++)this.addShape(a[c],b);return this};
|
|
|
-THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,m=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=m.length;e<g;e++)f=m[e],THREE.Shape.Utils.isClockWise(f)&&(m[e]=f.reverse());var n=THREE.Shape.Utils.triangulateShape(k,m);e=0;for(g=m.length;e<g;e++)f=m[e],
|
|
|
-k=k.concat(f);m=k.length;g=n.length;for(e=0;e<m;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)m=n[e],k=m[0]+h,f=m[1]+h,m=m[2]+h,this.faces.push(new THREE.Face3(k,f,m,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,m))};
|
|
|
-THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,m=Math.cos(k),n=Math.sin(k),k=0,q=a.length;k<q;k++){var r=a[k],t=new THREE.Vector3;t.x=m*r.x-n*r.y;t.y=n*r.x+m*r.y;t.z=r.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,q=a.length-1;k<q;k++){b=n=k+c*f;d=n+c;var m=n+1+c,n=n+1,r=f*g,t=k*e,p=
|
|
|
-r+g,s=t+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([new THREE.Vector2(r,t),new THREE.Vector2(p,t),new THREE.Vector2(r,s)]);this.faces.push(new THREE.Face3(d,m,n));this.faceVertexUvs[0].push([new THREE.Vector2(p,t),new THREE.Vector2(p,s),new THREE.Vector2(r,s)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
+THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c=b.material,d=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,e,g,f,h=this.vertices.length;e=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var k=e.shape,n=e.holes;if(!THREE.Shape.Utils.isClockWise(k))for(k=k.reverse(),e=0,g=n.length;e<g;e++)f=n[e],THREE.Shape.Utils.isClockWise(f)&&(n[e]=f.reverse());var p=THREE.Shape.Utils.triangulateShape(k,n);e=0;for(g=n.length;e<g;e++)f=n[e],
|
|
|
+k=k.concat(f);n=k.length;g=p.length;for(e=0;e<n;e++)f=k[e],this.vertices.push(new THREE.Vector3(f.x,f.y,0));for(e=0;e<g;e++)n=p[e],k=n[0]+h,f=n[1]+h,n=n[2]+h,this.faces.push(new THREE.Face3(k,f,n,null,null,c)),this.faceVertexUvs[0].push(d.generateBottomUV(this,a,b,k,f,n))};
|
|
|
+THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="LatheGeometry";this.parameters={points:a,segments:b,phiStart:c,phiLength:d};b=b||12;c=c||0;d=d||2*Math.PI;for(var e=1/(a.length-1),g=1/b,f=0,h=b;f<=h;f++)for(var k=c+f*g*d,n=Math.cos(k),p=Math.sin(k),k=0,m=a.length;k<m;k++){var q=a[k],t=new THREE.Vector3;t.x=n*q.x-p*q.y;t.y=p*q.x+n*q.y;t.z=q.z;this.vertices.push(t)}c=a.length;f=0;for(h=b;f<h;f++)for(k=0,m=a.length-1;k<m;k++){b=p=k+c*f;d=p+c;var n=p+1+c,p=p+1,q=f*g,t=k*e,s=
|
|
|
+q+g,r=t+e;this.faces.push(new THREE.Face3(b,d,p));this.faceVertexUvs[0].push([new THREE.Vector2(q,t),new THREE.Vector2(s,t),new THREE.Vector2(q,r)]);this.faces.push(new THREE.Face3(d,n,p));this.faceVertexUvs[0].push([new THREE.Vector2(s,t),new THREE.Vector2(s,r),new THREE.Vector2(q,r)])}this.mergeVertices();this.computeFaceNormals();this.computeVertexNormals()};THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.");THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=c||1;d=d||1;var f=c+1,h=d+1,k=a/c,m=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),q=0,r=0,t=0;t<h;t++)for(var p=t*m-g,s=0;s<f;s++)b[q]=s*k-e,b[q+1]=-p,a[q+2]=1,n[r]=s/c,n[r+1]=1-t/d,q+=3,r+=2;q=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(t=0;t<d;t++)for(s=
|
|
|
-0;s<c;s++)g=s+f*(t+1),h=s+1+f*(t+1),k=s+1+f*t,e[q]=s+f*t,e[q+1]=g,e[q+2]=k,e[q+3]=g,e[q+4]=h,e[q+5]=k,q+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
|
|
|
-THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,m=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,q=e+f/c*g;n.x=k*Math.cos(q);n.y=k*Math.sin(q);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
|
|
|
-(n.y/b+1)/2))}k+=m}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=q=f+e,m=q+c+1,n=q+c+2,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]),g=q,m=q+c+2,n=q+1,this.faces.push(new THREE.Face3(g,m,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[m].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
|
|
|
+THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=c||1;d=d||1;var f=c+1,h=d+1,k=a/c,n=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var p=new Float32Array(f*h*2),m=0,q=0,t=0;t<h;t++)for(var s=t*n-g,r=0;r<f;r++)b[m]=r*k-e,b[m+1]=-s,a[m+2]=1,p[q]=r/c,p[q+1]=1-t/d,m+=3,q+=2;m=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*d*6);for(t=0;t<d;t++)for(r=
|
|
|
+0;r<c;r++)g=r+f*(t+1),h=r+1+f*(t+1),k=r+1+f*t,e[m]=r+f*t,e[m+1]=g,e[m+2]=k,e[m+3]=g,e[m+4]=h,e[m+5]=k,m+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(p,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
|
|
|
+THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,n=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var p=new THREE.Vector3,m=e+f/c*g;p.x=k*Math.cos(m);p.y=k*Math.sin(m);this.vertices.push(p);h.push(new THREE.Vector2((p.x/b+1)/2,
|
|
|
+(p.y/b+1)/2))}k+=n}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=m=f+e,n=m+c+1,p=m+c+2,this.faces.push(new THREE.Face3(g,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[n].clone(),h[p].clone()]),g=m,n=m+c+2,p=m+1,this.faces.push(new THREE.Face3(g,n,p,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[n].clone(),h[p].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
|
|
|
THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,m=[],n=[];for(k=0;k<=c;k++){var q=[],r=[];for(h=0;h<=b;h++){var t=h/b,p=k/c,s=new THREE.Vector3;s.x=-a*Math.cos(d+t*e)*Math.sin(g+p*f);
|
|
|
-s.y=a*Math.cos(g+p*f);s.z=a*Math.sin(d+t*e)*Math.sin(g+p*f);this.vertices.push(s);q.push(this.vertices.length-1);r.push(new THREE.Vector2(t,1-p))}m.push(q);n.push(r)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=m[k][h+1];e=m[k][h];g=m[k+1][h];f=m[k+1][h+1];var q=this.vertices[d].clone().normalize(),r=this.vertices[e].clone().normalize(),t=this.vertices[g].clone().normalize(),p=this.vertices[f].clone().normalize(),s=n[k][h+1].clone(),v=n[k][h].clone(),w=n[k+1][h].clone(),u=n[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
|
|
|
-a?(s.x=(s.x+v.x)/2,this.faces.push(new THREE.Face3(d,g,f,[q,t,p])),this.faceVertexUvs[0].push([s,w,u])):Math.abs(this.vertices[g].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,g,[q,r,t])),this.faceVertexUvs[0].push([s,v,w])):(this.faces.push(new THREE.Face3(d,e,f,[q,r,p])),this.faceVertexUvs[0].push([s,v,u]),this.faces.push(new THREE.Face3(e,g,f,[r.clone(),t,p.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
|
|
|
+THREE.SphereGeometry=function(a,b,c,d,e,g,f){THREE.Geometry.call(this);this.type="SphereGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;var h,k,n=[],p=[];for(k=0;k<=c;k++){var m=[],q=[];for(h=0;h<=b;h++){var t=h/b,s=k/c,r=new THREE.Vector3;r.x=-a*Math.cos(d+t*e)*Math.sin(g+s*f);
|
|
|
+r.y=a*Math.cos(g+s*f);r.z=a*Math.sin(d+t*e)*Math.sin(g+s*f);this.vertices.push(r);m.push(this.vertices.length-1);q.push(new THREE.Vector2(t,1-s))}n.push(m);p.push(q)}for(k=0;k<c;k++)for(h=0;h<b;h++){d=n[k][h+1];e=n[k][h];g=n[k+1][h];f=n[k+1][h+1];var m=this.vertices[d].clone().normalize(),q=this.vertices[e].clone().normalize(),t=this.vertices[g].clone().normalize(),s=this.vertices[f].clone().normalize(),r=p[k][h+1].clone(),v=p[k][h].clone(),w=p[k+1][h].clone(),u=p[k+1][h+1].clone();Math.abs(this.vertices[d].y)===
|
|
|
+a?(r.x=(r.x+v.x)/2,this.faces.push(new THREE.Face3(d,g,f,[m,t,s])),this.faceVertexUvs[0].push([r,w,u])):Math.abs(this.vertices[g].y)===a?(w.x=(w.x+u.x)/2,this.faces.push(new THREE.Face3(d,e,g,[m,q,t])),this.faceVertexUvs[0].push([r,v,w])):(this.faces.push(new THREE.Face3(d,e,f,[m,q,s])),this.faceVertexUvs[0].push([r,v,u]),this.faces.push(new THREE.Face3(e,g,f,[q.clone(),t,s.clone()])),this.faceVertexUvs[0].push([v.clone(),w,u.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,
|
|
|
a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);
|
|
|
-THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var m=0;m<=d;m++){var n=m/d*e,q=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var r=new THREE.Vector3;r.x=(a+b*Math.cos(q))*Math.cos(n);r.y=(a+b*Math.cos(q))*Math.sin(n);r.z=b*Math.sin(q);this.vertices.push(r);f.push(new THREE.Vector2(m/
|
|
|
-d,k/c));h.push(r.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(m=1;m<=d;m++)a=(d+1)*k+m-1,b=(d+1)*(k-1)+m-1,e=(d+1)*(k-1)+m,g=(d+1)*k+m,n=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),n=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(n),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
|
|
|
+THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var n=0;n<=d;n++){var p=n/d*e,m=k/c*Math.PI*2;g.x=a*Math.cos(p);g.y=a*Math.sin(p);var q=new THREE.Vector3;q.x=(a+b*Math.cos(m))*Math.cos(p);q.y=(a+b*Math.cos(m))*Math.sin(p);q.z=b*Math.sin(m);this.vertices.push(q);f.push(new THREE.Vector2(n/
|
|
|
+d,k/c));h.push(q.clone().sub(g).normalize())}for(k=1;k<=c;k++)for(n=1;n<=d;n++)a=(d+1)*k+n-1,b=(d+1)*(k-1)+n-1,e=(d+1)*(k-1)+n,g=(d+1)*k+n,p=new THREE.Face3(a,b,g,[h[a].clone(),h[b].clone(),h[g].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([f[a].clone(),f[b].clone(),f[g].clone()]),p=new THREE.Face3(b,e,g,[h[b].clone(),h[e].clone(),h[g].clone()]),this.faces.push(p),this.faceVertexUvs[0].push([f[b].clone(),f[e].clone(),f[g].clone()]);this.computeFaceNormals()};
|
|
|
THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),m=new THREE.Vector3,n=new THREE.Vector3,q=new THREE.Vector3,r=0;r<c;++r){k[r]=
|
|
|
-Array(d);var t=r/c*2*e*Math.PI,p=h(t,g,e,a,f),t=h(t+.01,g,e,a,f);m.subVectors(t,p);n.addVectors(t,p);q.crossVectors(m,n);n.crossVectors(q,m);q.normalize();n.normalize();for(t=0;t<d;++t){var s=t/d*2*Math.PI,v=-b*Math.cos(s),s=b*Math.sin(s),w=new THREE.Vector3;w.x=p.x+v*n.x+s*q.x;w.y=p.y+v*n.y+s*q.y;w.z=p.z+v*n.z+s*q.z;k[r][t]=this.vertices.push(w)-1}}for(r=0;r<c;++r)for(t=0;t<d;++t)e=(r+1)%c,g=(t+1)%d,a=k[r][t],b=k[e][t],e=k[e][g],g=k[r][g],f=new THREE.Vector2(r/c,t/d),m=new THREE.Vector2((r+1)/c,
|
|
|
-t/d),n=new THREE.Vector2((r+1)/c,(t+1)/d),q=new THREE.Vector2(r/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,m,q]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([m.clone(),n,q.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=[],f,h,k=b+1,m,n,q,r,t=new THREE.Vector3,p,s,v;p=new THREE.TubeGeometry.FrenetFrames(a,b,e);s=p.normals;v=p.binormals;this.tangents=p.tangents;this.normals=s;this.binormals=v;for(p=0;p<k;p++)for(g[p]=[],m=p/(k-1),r=a.getPointAt(m),f=s[p],h=v[p],m=0;m<d;m++)n=m/d*2*Math.PI,q=-c*Math.cos(n),n=c*Math.sin(n),
|
|
|
-t.copy(r),t.x+=q*f.x+n*h.x,t.y+=q*f.y+n*h.y,t.z+=q*f.z+n*h.z,g[p][m]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(p=0;p<b;p++)for(m=0;m<d;m++)k=e?(p+1)%b:p+1,t=(m+1)%d,a=g[p][m],c=g[k][m],k=g[k][t],t=g[p][t],s=new THREE.Vector2(p/b,m/d),v=new THREE.Vector2((p+1)/b,m/d),f=new THREE.Vector2((p+1)/b,(m+1)/d),h=new THREE.Vector2(p/b,(m+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([s,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),
|
|
|
+THREE.TorusKnotGeometry=function(a,b,c,d,e,g,f){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);a*=b/c;b=Math.cos(a);f*=d*(2+b)*.5;g=d*(2+b)*g*.5;d=e*d*Math.sin(a)*.5;return new THREE.Vector3(f,g,d)}THREE.Geometry.call(this);this.type="TorusKnotGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:g,heightScale:f};a=a||100;b=b||40;c=c||64;d=d||8;e=e||2;g=g||3;f=f||1;for(var k=Array(c),n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,q=0;q<c;++q){k[q]=
|
|
|
+Array(d);var t=q/c*2*e*Math.PI,s=h(t,g,e,a,f),t=h(t+.01,g,e,a,f);n.subVectors(t,s);p.addVectors(t,s);m.crossVectors(n,p);p.crossVectors(m,n);m.normalize();p.normalize();for(t=0;t<d;++t){var r=t/d*2*Math.PI,v=-b*Math.cos(r),r=b*Math.sin(r),w=new THREE.Vector3;w.x=s.x+v*p.x+r*m.x;w.y=s.y+v*p.y+r*m.y;w.z=s.z+v*p.z+r*m.z;k[q][t]=this.vertices.push(w)-1}}for(q=0;q<c;++q)for(t=0;t<d;++t)e=(q+1)%c,g=(t+1)%d,a=k[q][t],b=k[e][t],e=k[e][g],g=k[q][g],f=new THREE.Vector2(q/c,t/d),n=new THREE.Vector2((q+1)/c,
|
|
|
+t/d),p=new THREE.Vector2((q+1)/c,(t+1)/d),m=new THREE.Vector2(q/c,(t+1)/d),this.faces.push(new THREE.Face3(a,b,g)),this.faceVertexUvs[0].push([f,n,m]),this.faces.push(new THREE.Face3(b,e,g)),this.faceVertexUvs[0].push([n.clone(),p,m.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
+THREE.TubeGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TubeGeometry";this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=[],f,h,k=b+1,n,p,m,q,t=new THREE.Vector3,s,r,v;s=new THREE.TubeGeometry.FrenetFrames(a,b,e);r=s.normals;v=s.binormals;this.tangents=s.tangents;this.normals=r;this.binormals=v;for(s=0;s<k;s++)for(g[s]=[],n=s/(k-1),q=a.getPointAt(n),f=r[s],h=v[s],n=0;n<d;n++)p=n/d*2*Math.PI,m=-c*Math.cos(p),p=c*Math.sin(p),
|
|
|
+t.copy(q),t.x+=m*f.x+p*h.x,t.y+=m*f.y+p*h.y,t.z+=m*f.z+p*h.z,g[s][n]=this.vertices.push(new THREE.Vector3(t.x,t.y,t.z))-1;for(s=0;s<b;s++)for(n=0;n<d;n++)k=e?(s+1)%b:s+1,t=(n+1)%d,a=g[s][n],c=g[k][n],k=g[k][t],t=g[s][t],r=new THREE.Vector2(s/b,n/d),v=new THREE.Vector2((s+1)/b,n/d),f=new THREE.Vector2((s+1)/b,(n+1)/d),h=new THREE.Vector2(s/b,(n+1)/d),this.faces.push(new THREE.Face3(a,c,t)),this.faceVertexUvs[0].push([r,v,h]),this.faces.push(new THREE.Face3(c,k,t)),this.faceVertexUvs[0].push([v.clone(),
|
|
|
f,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var m,n,q;this.tangents=e;this.normals=g;this.binormals=f;for(m=0;m<b;m++)n=m/(b-1),e[m]=a.getTangentAt(n),e[m].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;m=Math.abs(e[0].x);n=Math.abs(e[0].y);q=Math.abs(e[0].z);m<=a&&(a=m,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));q<=a&&d.set(0,0,1);h.crossVectors(e[0],
|
|
|
-d).normalize();g[0].crossVectors(e[0],h);f[0].crossVectors(e[0],g[0]);for(m=1;m<b;m++)g[m]=g[m-1].clone(),f[m]=f[m-1].clone(),h.crossVectors(e[m-1],e[m]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[m-1].dot(e[m]),-1,1)),g[m].applyMatrix4(k.makeRotationAxis(h,d))),f[m].crossVectors(e[m],g[m]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),m=1;m<b;m++)g[m].applyMatrix4(k.makeRotationAxis(e[m],d*m)),f[m].crossVectors(e[m],
|
|
|
-g[m])};
|
|
|
+THREE.TubeGeometry.FrenetFrames=function(a,b,c){new THREE.Vector3;var d=new THREE.Vector3;new THREE.Vector3;var e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var n,p,m;this.tangents=e;this.normals=g;this.binormals=f;for(n=0;n<b;n++)p=n/(b-1),e[n]=a.getTangentAt(p),e[n].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;n=Math.abs(e[0].x);p=Math.abs(e[0].y);m=Math.abs(e[0].z);n<=a&&(a=n,d.set(1,0,0));p<=a&&(a=p,d.set(0,1,0));m<=a&&d.set(0,0,1);h.crossVectors(e[0],
|
|
|
+d).normalize();g[0].crossVectors(e[0],h);f[0].crossVectors(e[0],g[0]);for(n=1;n<b;n++)g[n]=g[n-1].clone(),f[n]=f[n-1].clone(),h.crossVectors(e[n-1],e[n]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[n-1].dot(e[n]),-1,1)),g[n].applyMatrix4(k.makeRotationAxis(h,d))),f[n].crossVectors(e[n],g[n]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),n=1;n<b;n++)g[n].applyMatrix4(k.makeRotationAxis(e[n],d*n)),f[n].crossVectors(e[n],
|
|
|
+g[n])};
|
|
|
THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);v.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(v.z,-v.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a,b){var c=
|
|
|
Math.pow(2,b);Math.pow(4,b);for(var d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),m=[],n=0;n<=c;n++){m[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(f.clone().lerp(h,n/c)),s=c-n,r=0;r<=s;r++)m[n][r]=0==r&&n==c?p:e(p.clone().lerp(q,r/s))}for(n=0;n<c;n++)for(r=0;r<2*(c-n)-1;r++)d=Math.floor(r/2),0==r%2?g(m[n][d+1],m[n+1][d],m[n][d]):g(m[n][d+1],m[n+1][d+1],m[n+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,
|
|
|
-a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,m=0,n=a.length;m<n;m+=3)e(new THREE.Vector3(a[m],a[m+1],a[m+2]));a=this.vertices;for(var q=[],r=m=0,n=b.length;m<n;m+=3,r++){var t=a[b[m]],p=a[b[m+1]],s=a[b[m+2]];q[r]=new THREE.Face3(t.index,p.index,s.index,[t.clone(),p.clone(),s.clone()])}for(var v=new THREE.Vector3,m=0,n=q.length;m<n;m++)f(q[m],d);m=0;for(n=this.faceVertexUvs[0].length;m<
|
|
|
-n;m++)b=this.faceVertexUvs[0][m],d=b[0].x,a=b[1].x,q=b[2].x,r=Math.max(d,Math.max(a,q)),t=Math.min(d,Math.min(a,q)),.9<r&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));m=0;for(n=this.vertices.length;m<n;m++)this.vertices[m].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
+a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,n=0,p=a.length;n<p;n+=3)e(new THREE.Vector3(a[n],a[n+1],a[n+2]));a=this.vertices;for(var m=[],q=n=0,p=b.length;n<p;n+=3,q++){var t=a[b[n]],s=a[b[n+1]],r=a[b[n+2]];m[q]=new THREE.Face3(t.index,s.index,r.index,[t.clone(),s.clone(),r.clone()])}for(var v=new THREE.Vector3,n=0,p=m.length;n<p;n++)f(m[n],d);n=0;for(p=this.faceVertexUvs[0].length;n<
|
|
|
+p;n++)b=this.faceVertexUvs[0][n],d=b[0].x,a=b[1].x,m=b[2].x,q=Math.max(d,Math.max(a,m)),t=Math.min(d,Math.min(a,m)),.9<q&&.1>t&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>m&&(b[2].x+=1));n=0;for(p=this.vertices.length;n<p;n++)this.vertices[n].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,
|
|
|
11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)};THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b}};THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b}};THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b}};THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
-THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,g=this.faceVertexUvs[0],f,h,k,m,n=b+1;for(f=0;f<=c;f++)for(m=f/c,h=0;h<=b;h++)k=h/b,k=a(k,m),d.push(k);var q,r,t,p;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*n+h,d=f*n+h+1,m=(f+1)*n+h+1,k=(f+1)*n+h,q=new THREE.Vector2(h/b,f/c),r=new THREE.Vector2((h+1)/b,f/c),t=new THREE.Vector2((h+1)/b,(f+1)/c),p=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
|
|
|
-d,k)),g.push([q,r,p]),e.push(new THREE.Face3(d,m,k)),g.push([r.clone(),t,p.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
+THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};var d=this.vertices,e=this.faces,g=this.faceVertexUvs[0],f,h,k,n,p=b+1;for(f=0;f<=c;f++)for(n=f/c,h=0;h<=b;h++)k=h/b,k=a(k,n),d.push(k);var m,q,t,s;for(f=0;f<c;f++)for(h=0;h<b;h++)a=f*p+h,d=f*p+h+1,n=(f+1)*p+h+1,k=(f+1)*p+h,m=new THREE.Vector2(h/b,f/c),q=new THREE.Vector2((h+1)/b,f/c),t=new THREE.Vector2((h+1)/b,(f+1)/c),s=new THREE.Vector2(h/b,(f+1)/c),e.push(new THREE.Face3(a,
|
|
|
+d,k)),g.push([m,q,s]),e.push(new THREE.Face3(d,n,k)),g.push([q.clone(),t,s.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype);
|
|
|
THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry;a.addAttribute("position",new THREE.BufferAttribute(b,3));a.addAttribute("color",new THREE.BufferAttribute(c,3));b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.Line.call(this,a,b,THREE.LinePieces)};THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));return function(c,d,e,g,f,h){THREE.Object3D.call(this);void 0===g&&(g=16776960);void 0===e&&(e=1);void 0===f&&(f=.2*e);void 0===h&&(h=.2*f);this.position.copy(d);this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:g}));this.line.matrixAutoUpdate=!1;this.add(this.line);
|
|
|
this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:g}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(c);this.setLength(e,f,h)}}();THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.ArrowHelper.prototype.setDirection=function(){var a=new THREE.Vector3,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>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))}}();
|
|
@@ -744,8 +744,8 @@ THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=
|
|
|
c=new THREE.Geometry;c.vertices.push(new THREE.Vector3,new THREE.Vector3);d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine=new THREE.Line(c,d);this.add(this.targetLine);this.update()};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};
|
|
|
THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);this.lightPlane.lookAt(c);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(c);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();
|
|
|
-THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var m=k.vertices,k=k.faces,n=0,q=0,r=k.length;q<r;q++)for(var t=k[q],p=0;3>p;p++){d[0]=t[f[p]];d[1]=t[f[(p+1)%3]];d.sort(g);var s=d.toString();void 0===e[s]?(e[s]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},n++):e[s].face2=q}h.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6*
|
|
|
-n),3));d=h.attributes.position.array;g=0;for(s in e)if(f=e[s],void 0===f.face2||.9999>k[f.face1].normal.dot(k[f.face2].normal))n=m[f.vert1],d[g++]=n.x,d[g++]=n.y,d[g++]=n.z,n=m[f.vert2],d[g++]=n.x,d[g++]=n.y,d[g++]=n.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
+THREE.EdgesHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry,k=a.geometry.clone();k.mergeVertices();k.computeFaceNormals();for(var n=k.vertices,k=k.faces,p=0,m=0,q=k.length;m<q;m++)for(var t=k[m],s=0;3>s;s++){d[0]=t[f[s]];d[1]=t[f[(s+1)%3]];d.sort(g);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],face1:m,face2:void 0},p++):e[r].face2=m}h.addAttribute("position",new THREE.BufferAttribute(new Float32Array(6*
|
|
|
+p),3));d=h.attributes.position.array;g=0;for(r in e)if(f=e[r],void 0===f.face2||.9999>k[f.face1].normal.dot(k[f.face2].normal))p=n[f.vert1],d[g++]=p.x,d[g++]=p.y,d[g++]=p.z,p=n[f.vert2],d[g++]=p.x,d[g++]=p.y,d[g++]=p.z;THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3,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=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(e);for(var g=b=0,f=d.length;b<f;b++,g+=2){var h=d[b];a[g].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e);a[g+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[g])}this.geometry.verticesNeedUpdate=!0;return this};
|
|
|
THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924);this.color2=new THREE.Color(8947848);for(var e=-a;e<=a;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var g=0===e?this.color1:this.color2;c.colors.push(g,g,g,g)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);
|
|
@@ -761,14 +761,14 @@ THREE.SkeletonHelper.prototype.update=function(){for(var a=this.geometry,b=(new
|
|
|
THREE.SpotLightHelper=function(a){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;a=new THREE.CylinderGeometry(0,1,1,8,1,!0);a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0));a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b);this.add(this.cone);this.update()};THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1E4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}();
|
|
|
THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:16711680;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,g=a.length;e<g;e++)for(var f=0,h=a[e].vertexNormals.length;f<h;f++)c.vertices.push(new THREE.Vector3,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(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],q=0,r=n.vertexNormals.length;q<r;q++){var t=n.vertexNormals[q];d[h].copy(e[n[a[q]]]).applyMatrix4(f);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
|
|
|
+THREE.VertexNormalsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,n=g.length;k<n;k++)for(var p=g[k],m=0,q=p.vertexNormals.length;m<q;m++){var t=p.vertexNormals[m];d[h].copy(e[p[a[m]]]).applyMatrix4(f);b.copy(t).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);
|
|
|
b.add(d[h]);h+=1;d[h].copy(b);h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
|
|
|
THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;b=void 0!==c?c:255;d=void 0!==d?d:1;c=new THREE.Geometry;a=a.geometry.faces;for(var e=0,g=a.length;e<g;e++)for(var f=0,h=a[e].vertexTangents.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,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.update()};THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
-THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,m=g.length;k<m;k++)for(var n=g[k],q=0,r=n.vertexTangents.length;q<r;q++){var t=n.vertexTangents[q];d[h].copy(e[n[a[q]]]).applyMatrix4(f);b.copy(t).transformDirection(f).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
|
|
|
+THREE.VertexTangentsHelper.prototype.update=function(a){var b=new THREE.Vector3;return function(a){a=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var d=this.geometry.vertices,e=this.object.geometry.vertices,g=this.object.geometry.faces,f=this.object.matrixWorld,h=0,k=0,n=g.length;k<n;k++)for(var p=g[k],m=0,q=p.vertexTangents.length;m<q;m++){var t=p.vertexTangents[m];d[h].copy(e[p[a[m]]]).applyMatrix4(f);b.copy(t).transformDirection(f).multiplyScalar(this.size);b.add(d[h]);h+=1;d[h].copy(b);
|
|
|
h+=1}this.geometry.verticesNeedUpdate=!0;return this}}();
|
|
|
-THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,m=a.geometry.faces,n=0,q=new Uint32Array(6*m.length),r=0,t=m.length;r<t;r++)for(var p=m[r],s=0;3>s;s++){d[0]=p[f[s]];d[1]=p[f[(s+1)%3]];d.sort(g);var v=d.toString();void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++)}d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(s=0;2>s;s++)n=
|
|
|
-k[q[2*r+s]],f=6*r+3*s,d[f+0]=n.x,d[f+1]=n.y,d[f+2]=n.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,m=a.geometry.offsets,n=0,q=new Uint32Array(2*t.length),p=0,w=m.length;p<w;++p)for(var s=m[p].start,v=m[p].count,f=m[p].index,r=s,u=s+v;r<u;r+=3)for(s=0;3>s;s++)d[0]=f+t[r+s],d[1]=f+t[r+(s+1)%3],d.sort(g),v=d.toString(),
|
|
|
-void 0===e[v]&&(q[2*n]=d[0],q[2*n+1]=d[1],e[v]=!0,n++);d=new Float32Array(6*n);r=0;for(t=n;r<t;r++)for(s=0;2>s;s++)f=6*r+3*s,n=3*q[2*r+s],d[f+0]=k[n],d[f+1]=k[n+1],d[f+2]=k[n+2]}else for(k=a.geometry.attributes.position.array,n=k.length/3,q=n/3,d=new Float32Array(6*n),r=0,t=q;r<t;r++)for(s=0;3>s;s++)f=18*r+6*s,q=9*r+3*s,d[f+0]=k[q],d[f+1]=k[q+1],d[f+2]=k[q+2],n=9*r+(s+1)%3*3,d[f+3]=k[n],d[f+4]=k[n+1],d[f+5]=k[n+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),
|
|
|
+THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var k=a.geometry.vertices,n=a.geometry.faces,p=0,m=new Uint32Array(6*n.length),q=0,t=n.length;q<t;q++)for(var s=n[q],r=0;3>r;r++){d[0]=s[f[r]];d[1]=s[f[(r+1)%3]];d.sort(g);var v=d.toString();void 0===e[v]&&(m[2*p]=d[0],m[2*p+1]=d[1],e[v]=!0,p++)}d=new Float32Array(6*p);q=0;for(t=p;q<t;q++)for(r=0;2>r;r++)p=
|
|
|
+k[m[2*q+r]],f=6*q+3*r,d[f+0]=p.x,d[f+1]=p.y,d[f+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){for(var k=a.geometry.attributes.position.array,t=a.geometry.attributes.index.array,n=a.geometry.offsets,p=0,m=new Uint32Array(2*t.length),s=0,w=n.length;s<w;++s)for(var r=n[s].start,v=n[s].count,f=n[s].index,q=r,u=r+v;q<u;q+=3)for(r=0;3>r;r++)d[0]=f+t[q+r],d[1]=f+t[q+(r+1)%3],d.sort(g),v=d.toString(),
|
|
|
+void 0===e[v]&&(m[2*p]=d[0],m[2*p+1]=d[1],e[v]=!0,p++);d=new Float32Array(6*p);q=0;for(t=p;q<t;q++)for(r=0;2>r;r++)f=6*q+3*r,p=3*m[2*q+r],d[f+0]=k[p],d[f+1]=k[p+1],d[f+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,m=p/3,d=new Float32Array(6*p),q=0,t=m;q<t;q++)for(r=0;3>r;r++)f=18*q+6*r,m=9*q+3*r,d[f+0]=k[m],d[f+1]=k[m+1],d[f+2]=k[m+2],p=9*q+(r+1)%3*3,d[f+3]=k[p],d[f+4]=k[p+1],d[f+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),
|
|
|
THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};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,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=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:g,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=c.x*Math.PI*.25,c.rotation+=.25*(c.wantedRotation-c.rotation)};
|
|
@@ -780,41 +780,40 @@ THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.ani
|
|
|
THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};
|
|
|
THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var g=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),f=d.weight;
|
|
|
g!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*f,this.morphTargetInfluences[g]=0,d.lastFrame=d.currentFrame,d.currentFrame=g);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*f;this.morphTargetInfluences[d.lastFrame]=(1-e)*f}}};
|
|
|
-THREE.LensFlarePlugin=function(){function a(a,b){var d=c.createProgram(),e=c.createShader(c.FRAGMENT_SHADER),f=c.createShader(c.VERTEX_SHADER),g="precision "+b+" float;\n";c.shaderSource(e,g+a.fragmentShader);c.shaderSource(f,g+a.vertexShader);c.compileShader(e);c.compileShader(f);c.attachShader(d,e);c.attachShader(d,f);c.linkProgram(d);return d}var b=[],c,d,e,g,f,h,k,m,n,q,r,t,p;this.init=function(b){c=b.context;d=b;e=b.getPrecision();g=new Float32Array(16);f=new Uint16Array(6);b=0;g[b++]=-1;g[b++]=
|
|
|
--1;g[b++]=0;g[b++]=0;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=1;g[b++]=-1;g[b++]=1;g[b++]=0;g[b++]=1;b=0;f[b++]=0;f[b++]=1;f[b++]=2;f[b++]=0;f[b++]=2;f[b++]=3;h=c.createBuffer();k=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,h);c.bufferData(c.ARRAY_BUFFER,g,c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.bufferData(c.ELEMENT_ARRAY_BUFFER,f,c.STATIC_DRAW);m=c.createTexture();n=c.createTexture();c.bindTexture(c.TEXTURE_2D,m);c.texImage2D(c.TEXTURE_2D,0,c.RGB,16,
|
|
|
-16,0,c.RGB,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);c.bindTexture(c.TEXTURE_2D,n);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,16,16,0,c.RGBA,c.UNSIGNED_BYTE,null);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);
|
|
|
-c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.NEAREST);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.NEAREST);0>=c.getParameter(c.MAX_VERTEX_TEXTURE_IMAGE_UNITS)?(q=!1,r=a(THREE.ShaderFlares.lensFlare,e)):(q=!0,r=a(THREE.ShaderFlares.lensFlareVertexTexture,e));t={};p={};t.vertex=c.getAttribLocation(r,"position");t.uv=c.getAttribLocation(r,"uv");p.renderType=c.getUniformLocation(r,"renderType");p.map=c.getUniformLocation(r,"map");p.occlusionMap=c.getUniformLocation(r,"occlusionMap");p.opacity=
|
|
|
-c.getUniformLocation(r,"opacity");p.color=c.getUniformLocation(r,"color");p.scale=c.getUniformLocation(r,"scale");p.rotation=c.getUniformLocation(r,"rotation");p.screenPosition=c.getUniformLocation(r,"screenPosition")};this.render=function(a,e,f,g){b.length=0;a.traverseVisible(function(a){a instanceof THREE.LensFlare&&b.push(a)});if(0!==b.length){a=new THREE.Vector3;var z=g/f,x=.5*f,F=.5*g,C=16/g,B=new THREE.Vector2(C*z,C),y=new THREE.Vector3(1,1,0),D=new THREE.Vector2(1,1),J=p,C=t;c.useProgram(r);
|
|
|
-c.enableVertexAttribArray(t.vertex);c.enableVertexAttribArray(t.uv);c.uniform1i(J.occlusionMap,0);c.uniform1i(J.map,1);c.bindBuffer(c.ARRAY_BUFFER,h);c.vertexAttribPointer(C.vertex,2,c.FLOAT,!1,16,0);c.vertexAttribPointer(C.uv,2,c.FLOAT,!1,16,8);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,k);c.disable(c.CULL_FACE);c.depthMask(!1);for(var K=0,S=b.length;K<S;K++){C=16/g;B.set(C*z,C);var Q=b[K];a.set(Q.matrixWorld.elements[12],Q.matrixWorld.elements[13],Q.matrixWorld.elements[14]);a.applyMatrix4(e.matrixWorldInverse);
|
|
|
-a.applyProjection(e.projectionMatrix);y.copy(a);D.x=y.x*x+x;D.y=y.y*F+F;if(q||0<D.x&&D.x<f&&0<D.y&&D.y<g){c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.copyTexImage2D(c.TEXTURE_2D,0,c.RGB,D.x-8,D.y-8,16,16,0);c.uniform1i(J.renderType,0);c.uniform2f(J.scale,B.x,B.y);c.uniform3f(J.screenPosition,y.x,y.y,y.z);c.disable(c.BLEND);c.enable(c.DEPTH_TEST);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);c.activeTexture(c.TEXTURE0);c.bindTexture(c.TEXTURE_2D,n);c.copyTexImage2D(c.TEXTURE_2D,
|
|
|
-0,c.RGBA,D.x-8,D.y-8,16,16,0);c.uniform1i(J.renderType,1);c.disable(c.DEPTH_TEST);c.activeTexture(c.TEXTURE1);c.bindTexture(c.TEXTURE_2D,m);c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0);Q.positionScreen.copy(y);Q.customUpdateCallback?Q.customUpdateCallback(Q):Q.updateLensFlares();c.uniform1i(J.renderType,2);c.enable(c.BLEND);for(var da=0,V=Q.lensFlares.length;da<V;da++){var R=Q.lensFlares[da];.001<R.opacity&&.001<R.scale&&(y.x=R.x,y.y=R.y,y.z=R.z,C=R.size*R.scale/g,B.x=C*z,B.y=C,c.uniform3f(J.screenPosition,
|
|
|
-y.x,y.y,y.z),c.uniform2f(J.scale,B.x,B.y),c.uniform1f(J.rotation,R.rotation),c.uniform1f(J.opacity,R.opacity),c.uniform3f(J.color,R.color.r,R.color.g,R.color.b),d.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),d.setTexture(R.texture,1),c.drawElements(c.TRIANGLES,6,c.UNSIGNED_SHORT,0))}}}c.enable(c.CULL_FACE);c.enable(c.DEPTH_TEST);c.depthMask(!0);d.resetGLState()}}};
|
|
|
-THREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&c.castShadow&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);s.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,r=new THREE.Vector3,t=new THREE.Vector3,p=new THREE.Vector3,s=[];this.init=function(a,n,p,q){b=a.context;c=
|
|
|
-a;d=n;e=p;g=q;a=THREE.ShaderLib.depthRGBA;n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,
|
|
|
-uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){!1!==c.shadowMapEnabled&&!1!==c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(e,w){var u,z,x,F,C,B,y,D,J=[];F=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);u=0;for(z=d.length;u<z;u++)if(x=d[u],x.castShadow)if(x instanceof
|
|
|
-THREE.DirectionalLight&&x.shadowCascade)for(C=0;C<x.shadowCascadeCount;C++){var K;if(x.shadowCascadeArray[C])K=x.shadowCascadeArray[C];else{y=x;var S=C;K=new THREE.DirectionalLight;K.isVirtual=!0;K.onlyShadow=!0;K.castShadow=!0;K.shadowCameraNear=y.shadowCameraNear;K.shadowCameraFar=y.shadowCameraFar;K.shadowCameraLeft=y.shadowCameraLeft;K.shadowCameraRight=y.shadowCameraRight;K.shadowCameraBottom=y.shadowCameraBottom;K.shadowCameraTop=y.shadowCameraTop;K.shadowCameraVisible=y.shadowCameraVisible;
|
|
|
-K.shadowDarkness=y.shadowDarkness;K.shadowBias=y.shadowCascadeBias[S];K.shadowMapWidth=y.shadowCascadeWidth[S];K.shadowMapHeight=y.shadowCascadeHeight[S];K.pointsWorld=[];K.pointsFrustum=[];D=K.pointsWorld;B=K.pointsFrustum;for(var Q=0;8>Q;Q++)D[Q]=new THREE.Vector3,B[Q]=new THREE.Vector3;D=y.shadowCascadeNearZ[S];y=y.shadowCascadeFarZ[S];B[0].set(-1,-1,D);B[1].set(1,-1,D);B[2].set(-1,1,D);B[3].set(1,1,D);B[4].set(-1,-1,y);B[5].set(1,-1,y);B[6].set(-1,1,y);B[7].set(1,1,y);K.originalCamera=w;B=new THREE.Gyroscope;
|
|
|
-B.position.copy(x.shadowCascadeOffset);B.add(K);B.add(K.target);w.add(B);x.shadowCascadeArray[C]=K;console.log("Created virtualLight",K)}S=x;D=C;y=S.shadowCascadeArray[D];y.position.copy(S.position);y.target.position.copy(S.target.position);y.lookAt(y.target);y.shadowCameraVisible=S.shadowCameraVisible;y.shadowDarkness=S.shadowDarkness;y.shadowBias=S.shadowCascadeBias[D];B=S.shadowCascadeNearZ[D];S=S.shadowCascadeFarZ[D];y=y.pointsFrustum;y[0].z=B;y[1].z=B;y[2].z=B;y[3].z=B;y[4].z=S;y[5].z=S;y[6].z=
|
|
|
-S;y[7].z=S;J[F]=K;F++}else J[F]=x,F++;u=0;for(z=J.length;u<z;u++){x=J[u];x.shadowMap||(C=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(C=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:C,magFilter:C,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,
|
|
|
+THREE.LensFlarePlugin=function(){var a,b,c,d,e,g,f,h,k,n;function p(a,b){var c=m.createProgram(),d=m.createShader(m.FRAGMENT_SHADER),e=m.createShader(m.VERTEX_SHADER),f="precision "+b+" float;\n";m.shaderSource(d,f+a.fragmentShader);m.shaderSource(e,f+a.vertexShader);m.compileShader(d);m.compileShader(e);m.attachShader(c,d);m.attachShader(c,e);m.linkProgram(c);return c}var m,q,t,s=[],r,v,w,u,z,x;this.init=function(s){m=s.context;q=s;t=s.getPrecision();s=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,
|
|
|
+1,-1,1,0,1]);var F=new Uint16Array([0,1,2,0,2,3]);r=m.createBuffer();v=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,r);m.bufferData(m.ARRAY_BUFFER,s,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,v);m.bufferData(m.ELEMENT_ARRAY_BUFFER,F,m.STATIC_DRAW);z=m.createTexture();x=m.createTexture();m.bindTexture(m.TEXTURE_2D,z);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,
|
|
|
+m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);m.bindTexture(m.TEXTURE_2D,x);m.texImage2D(m.TEXTURE_2D,0,m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);w=(u=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?
|
|
|
+p(THREE.ShaderFlares.lensFlare,t):p(THREE.ShaderFlares.lensFlareVertexTexture,t);k=m.getAttribLocation(w,"position");n=m.getAttribLocation(w,"uv");a=m.getUniformLocation(w,"renderType");b=m.getUniformLocation(w,"map");c=m.getUniformLocation(w,"occlusionMap");d=m.getUniformLocation(w,"opacity");e=m.getUniformLocation(w,"color");g=m.getUniformLocation(w,"scale");f=m.getUniformLocation(w,"rotation");h=m.getUniformLocation(w,"screenPosition")};this.render=function(p,t,B,y){s.length=0;p.traverseVisible(function(a){a instanceof
|
|
|
+THREE.LensFlare&&s.push(a)});if(0!==s.length){p=new THREE.Vector3;var E=y/B,R=.5*B,I=.5*y,O=16/y,C=new THREE.Vector2(O*E,O),W=new THREE.Vector3(1,1,0),U=new THREE.Vector2(1,1);m.useProgram(w);m.enableVertexAttribArray(k);m.enableVertexAttribArray(n);m.uniform1i(c,0);m.uniform1i(b,1);m.bindBuffer(m.ARRAY_BUFFER,r);m.vertexAttribPointer(k,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,v);m.disable(m.CULL_FACE);m.depthMask(!1);for(var Q=0,V=s.length;Q<
|
|
|
+V;Q++){O=16/y;C.set(O*E,O);var P=s[Q];p.set(P.matrixWorld.elements[12],P.matrixWorld.elements[13],P.matrixWorld.elements[14]);p.applyMatrix4(t.matrixWorldInverse);p.applyProjection(t.projectionMatrix);W.copy(p);U.x=W.x*R+R;U.y=W.y*I+I;if(u||0<U.x&&U.x<B&&0<U.y&&U.y<y){m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,z);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,U.x-8,U.y-8,16,16,0);m.uniform1i(a,0);m.uniform2f(g,C.x,C.y);m.uniform3f(h,W.x,W.y,W.z);m.disable(m.BLEND);m.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,
|
|
|
+6,m.UNSIGNED_SHORT,0);m.activeTexture(m.TEXTURE0);m.bindTexture(m.TEXTURE_2D,x);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,U.x-8,U.y-8,16,16,0);m.uniform1i(a,1);m.disable(m.DEPTH_TEST);m.activeTexture(m.TEXTURE1);m.bindTexture(m.TEXTURE_2D,z);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);P.positionScreen.copy(W);P.customUpdateCallback?P.customUpdateCallback(P):P.updateLensFlares();m.uniform1i(a,2);m.enable(m.BLEND);for(var sa=0,L=P.lensFlares.length;sa<L;sa++){var Y=P.lensFlares[sa];.001<Y.opacity&&
|
|
|
+.001<Y.scale&&(W.x=Y.x,W.y=Y.y,W.z=Y.z,O=Y.size*Y.scale/y,C.x=O*E,C.y=O,m.uniform3f(h,W.x,W.y,W.z),m.uniform2f(g,C.x,C.y),m.uniform1f(f,Y.rotation),m.uniform1f(d,Y.opacity),m.uniform3f(e,Y.color.r,Y.color.g,Y.color.b),q.setBlending(Y.blending,Y.blendEquation,Y.blendSrc,Y.blendDst),q.setTexture(Y.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}}m.enable(m.CULL_FACE);m.enable(m.DEPTH_TEST);m.depthMask(!0);q.resetGLState()}}};
|
|
|
+THREE.ShadowMapPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&c.castShadow&&(!1===c.frustumCulled||!0===p.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);r.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}var b,c,d,e,g,f,h,k,n,p=new THREE.Frustum,m=new THREE.Matrix4,q=new THREE.Vector3,t=new THREE.Vector3,s=new THREE.Vector3,r=[];this.init=function(a,m,p,q){b=a.context;c=
|
|
|
+a;d=m;e=p;g=q;a=THREE.ShaderLib.depthRGBA;m=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m,skinning:!0});n=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,
|
|
|
+uniforms:m,morphTargets:!0,skinning:!0});f._shadowPass=!0;h._shadowPass=!0;k._shadowPass=!0;n._shadowPass=!0};this.render=function(a,b){!1!==c.shadowMapEnabled&&!1!==c.shadowMapAutoUpdate&&this.update(a,b)};this.update=function(e,w){var u,z,x,G,F,B,y,E,R=[];G=0;b.clearColor(1,1,1,1);b.disable(b.BLEND);b.enable(b.CULL_FACE);b.frontFace(b.CCW);c.shadowMapCullFace===THREE.CullFaceFront?b.cullFace(b.FRONT):b.cullFace(b.BACK);c.setDepthTest(!0);u=0;for(z=d.length;u<z;u++)if(x=d[u],x.castShadow)if(x instanceof
|
|
|
+THREE.DirectionalLight&&x.shadowCascade)for(F=0;F<x.shadowCascadeCount;F++){var I;if(x.shadowCascadeArray[F])I=x.shadowCascadeArray[F];else{y=x;var O=F;I=new THREE.DirectionalLight;I.isVirtual=!0;I.onlyShadow=!0;I.castShadow=!0;I.shadowCameraNear=y.shadowCameraNear;I.shadowCameraFar=y.shadowCameraFar;I.shadowCameraLeft=y.shadowCameraLeft;I.shadowCameraRight=y.shadowCameraRight;I.shadowCameraBottom=y.shadowCameraBottom;I.shadowCameraTop=y.shadowCameraTop;I.shadowCameraVisible=y.shadowCameraVisible;
|
|
|
+I.shadowDarkness=y.shadowDarkness;I.shadowBias=y.shadowCascadeBias[O];I.shadowMapWidth=y.shadowCascadeWidth[O];I.shadowMapHeight=y.shadowCascadeHeight[O];I.pointsWorld=[];I.pointsFrustum=[];E=I.pointsWorld;B=I.pointsFrustum;for(var C=0;8>C;C++)E[C]=new THREE.Vector3,B[C]=new THREE.Vector3;E=y.shadowCascadeNearZ[O];y=y.shadowCascadeFarZ[O];B[0].set(-1,-1,E);B[1].set(1,-1,E);B[2].set(-1,1,E);B[3].set(1,1,E);B[4].set(-1,-1,y);B[5].set(1,-1,y);B[6].set(-1,1,y);B[7].set(1,1,y);I.originalCamera=w;B=new THREE.Gyroscope;
|
|
|
+B.position.copy(x.shadowCascadeOffset);B.add(I);B.add(I.target);w.add(B);x.shadowCascadeArray[F]=I;console.log("Created virtualLight",I)}O=x;E=F;y=O.shadowCascadeArray[E];y.position.copy(O.position);y.target.position.copy(O.target.position);y.lookAt(y.target);y.shadowCameraVisible=O.shadowCameraVisible;y.shadowDarkness=O.shadowDarkness;y.shadowBias=O.shadowCascadeBias[E];B=O.shadowCascadeNearZ[E];O=O.shadowCascadeFarZ[E];y=y.pointsFrustum;y[0].z=B;y[1].z=B;y[2].z=B;y[3].z=B;y[4].z=O;y[5].z=O;y[6].z=
|
|
|
+O;y[7].z=O;R[G]=I;G++}else R[G]=x,G++;u=0;for(z=R.length;u<z;u++){x=R[u];x.shadowMap||(F=THREE.LinearFilter,c.shadowMapType===THREE.PCFSoftShadowMap&&(F=THREE.NearestFilter),x.shadowMap=new THREE.WebGLRenderTarget(x.shadowMapWidth,x.shadowMapHeight,{minFilter:F,magFilter:F,format:THREE.RGBAFormat}),x.shadowMapSize=new THREE.Vector2(x.shadowMapWidth,x.shadowMapHeight),x.shadowMatrix=new THREE.Matrix4);if(!x.shadowCamera){if(x instanceof THREE.SpotLight)x.shadowCamera=new THREE.PerspectiveCamera(x.shadowCameraFov,
|
|
|
x.shadowMapWidth/x.shadowMapHeight,x.shadowCameraNear,x.shadowCameraFar);else if(x instanceof THREE.DirectionalLight)x.shadowCamera=new THREE.OrthographicCamera(x.shadowCameraLeft,x.shadowCameraRight,x.shadowCameraTop,x.shadowCameraBottom,x.shadowCameraNear,x.shadowCameraFar);else{console.error("Unsupported light type for shadow");continue}e.add(x.shadowCamera);!0===e.autoUpdate&&e.updateMatrixWorld()}x.shadowCameraVisible&&!x.cameraHelper&&(x.cameraHelper=new THREE.CameraHelper(x.shadowCamera),x.shadowCamera.add(x.cameraHelper));
|
|
|
-if(x.isVirtual&&K.originalCamera==w){C=w;F=x.shadowCamera;B=x.pointsFrustum;y=x.pointsWorld;r.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);for(S=0;8>S;S++)D=y[S],D.copy(B[S]),D.unproject(C),D.applyMatrix4(F.matrixWorldInverse),D.x<r.x&&(r.x=D.x),D.x>t.x&&(t.x=D.x),D.y<r.y&&(r.y=D.y),D.y>t.y&&(t.y=D.y),D.z<r.z&&(r.z=D.z),D.z>t.z&&(t.z=D.z);F.left=r.x;F.right=t.x;F.top=t.y;F.bottom=r.y;F.updateProjectionMatrix()}F=x.shadowMap;B=x.shadowMatrix;C=x.shadowCamera;C.position.setFromMatrixPosition(x.matrixWorld);
|
|
|
-p.setFromMatrixPosition(x.target.matrixWorld);C.lookAt(p);C.updateMatrixWorld();C.matrixWorldInverse.getInverse(C.matrixWorld);x.cameraHelper&&(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();B.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B.multiply(C.projectionMatrix);B.multiply(C.matrixWorldInverse);q.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(F);c.clear();s.length=0;a(e,e,C);x=0;for(F=s.length;x<F;x++)y=
|
|
|
-s[x],B=y.object,y=y.buffer,S=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,D=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&S.morphTargets,Q=B instanceof THREE.SkinnedMesh&&S.skinning,D=B.customDepthMaterial?B.customDepthMaterial:Q?D?m:k:D?h:f,c.setMaterialFaces(S),y instanceof THREE.BufferGeometry?c.renderBufferDirect(C,d,null,D,y,B):c.renderBuffer(C,d,null,D,y,B);x=0;for(F=g.length;x<F;x++)y=g[x],B=y.object,B.visible&&B.castShadow&&(B._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,
|
|
|
-B.matrixWorld),c.renderImmediateObject(C,d,null,f,B))}u=c.getClearColor();z=c.getClearAlpha();b.clearColor(u.r,u.g,u.b,z);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK);c.resetGLState()}};
|
|
|
-THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,m,n,q,r,t,p,s,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,z,x,F=[],C,B,y,D,J;this.init=function(w){u=w.context;z=w;C=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);B=new Uint16Array([0,1,2,0,2,3]);y=u.createBuffer();D=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,y);u.bufferData(u.ARRAY_BUFFER,C,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,D);u.bufferData(u.ELEMENT_ARRAY_BUFFER,B,u.STATIC_DRAW);w=u.createProgram();
|
|
|
-var F=u.createShader(u.VERTEX_SHADER),Q=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(F,["precision "+z.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
|
-u.shaderSource(Q,["precision "+z.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
|
-u.compileShader(F);u.compileShader(Q);u.attachShader(w,F);u.attachShader(w,Q);u.linkProgram(w);J=w;s=u.getAttribLocation(J,"position");v=u.getAttribLocation(J,"uv");a=u.getUniformLocation(J,"uvOffset");b=u.getUniformLocation(J,"uvScale");c=u.getUniformLocation(J,"rotation");d=u.getUniformLocation(J,"scale");e=u.getUniformLocation(J,"color");g=u.getUniformLocation(J,"map");f=u.getUniformLocation(J,"opacity");h=u.getUniformLocation(J,"modelViewMatrix");k=u.getUniformLocation(J,"projectionMatrix");m=
|
|
|
-u.getUniformLocation(J,"fogType");n=u.getUniformLocation(J,"fogDensity");q=u.getUniformLocation(J,"fogNear");r=u.getUniformLocation(J,"fogFar");t=u.getUniformLocation(J,"fogColor");p=u.getUniformLocation(J,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;F=w.getContext("2d");F.fillStyle="white";F.fillRect(0,0,8,8);x=new THREE.Texture(w);x.needsUpdate=!0};this.render=function(B,C,Q,da){F.length=0;B.traverseVisible(function(a){a instanceof THREE.Sprite&&F.push(a)});if(0!==F.length){u.useProgram(J);
|
|
|
-u.enableVertexAttribArray(s);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,y);u.vertexAttribPointer(s,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,D);u.uniformMatrix4fv(k,!1,C.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(g,0);da=Q=0;var V=B.fog;V?(u.uniform3f(t,V.color.r,V.color.g,V.color.b),V instanceof THREE.Fog?(u.uniform1f(q,V.near),u.uniform1f(r,V.far),u.uniform1i(m,
|
|
|
-1),da=Q=1):V instanceof THREE.FogExp2&&(u.uniform1f(n,V.density),u.uniform1i(m,2),da=Q=2)):(u.uniform1i(m,0),da=Q=0);for(var V=0,R=F.length;V<R;V++){var G=F[V],N=G.material;G._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,G.matrixWorld);G.z=-G._modelViewMatrix.elements[14]}F.sort(w);C=[];V=0;for(R=F.length;V<R;V++)G=F[V],N=G.material,u.uniform1f(p,N.alphaTest),u.uniformMatrix4fv(h,!1,G._modelViewMatrix.elements),C[0]=G.scale.x,C[1]=G.scale.y,G=0,B.fog&&N.fog&&(G=da),Q!==G&&(u.uniform1i(m,
|
|
|
-G),Q=G),null!==N.map?(u.uniform2f(a,N.map.offset.x,N.map.offset.y),u.uniform2f(b,N.map.repeat.x,N.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(f,N.opacity),u.uniform3f(e,N.color.r,N.color.g,N.color.b),u.uniform1f(c,N.rotation),u.uniform2fv(d,C),z.setBlending(N.blending,N.blendEquation,N.blendSrc,N.blendDst),z.setDepthTest(N.depthTest),z.setDepthWrite(N.depthWrite),N.map&&N.map.image&&N.map.image.width?z.setTexture(N.map,0):z.setTexture(x,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,
|
|
|
+if(x.isVirtual&&I.originalCamera==w){F=w;G=x.shadowCamera;B=x.pointsFrustum;y=x.pointsWorld;q.set(Infinity,Infinity,Infinity);t.set(-Infinity,-Infinity,-Infinity);for(O=0;8>O;O++)E=y[O],E.copy(B[O]),E.unproject(F),E.applyMatrix4(G.matrixWorldInverse),E.x<q.x&&(q.x=E.x),E.x>t.x&&(t.x=E.x),E.y<q.y&&(q.y=E.y),E.y>t.y&&(t.y=E.y),E.z<q.z&&(q.z=E.z),E.z>t.z&&(t.z=E.z);G.left=q.x;G.right=t.x;G.top=t.y;G.bottom=q.y;G.updateProjectionMatrix()}G=x.shadowMap;B=x.shadowMatrix;F=x.shadowCamera;F.position.setFromMatrixPosition(x.matrixWorld);
|
|
|
+s.setFromMatrixPosition(x.target.matrixWorld);F.lookAt(s);F.updateMatrixWorld();F.matrixWorldInverse.getInverse(F.matrixWorld);x.cameraHelper&&(x.cameraHelper.visible=x.shadowCameraVisible);x.shadowCameraVisible&&x.cameraHelper.update();B.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);B.multiply(F.projectionMatrix);B.multiply(F.matrixWorldInverse);m.multiplyMatrices(F.projectionMatrix,F.matrixWorldInverse);p.setFromMatrix(m);c.setRenderTarget(G);c.clear();r.length=0;a(e,e,F);x=0;for(G=r.length;x<G;x++)y=
|
|
|
+r[x],B=y.object,y=y.buffer,O=B.material instanceof THREE.MeshFaceMaterial?B.material.materials[0]:B.material,E=void 0!==B.geometry.morphTargets&&0<B.geometry.morphTargets.length&&O.morphTargets,C=B instanceof THREE.SkinnedMesh&&O.skinning,E=B.customDepthMaterial?B.customDepthMaterial:C?E?n:k:E?h:f,c.setMaterialFaces(O),y instanceof THREE.BufferGeometry?c.renderBufferDirect(F,d,null,E,y,B):c.renderBuffer(F,d,null,E,y,B);x=0;for(G=g.length;x<G;x++)y=g[x],B=y.object,B.visible&&B.castShadow&&(B._modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,
|
|
|
+B.matrixWorld),c.renderImmediateObject(F,d,null,f,B))}u=c.getClearColor();z=c.getClearAlpha();b.clearColor(u.r,u.g,u.b,z);b.enable(b.BLEND);c.shadowMapCullFace===THREE.CullFaceFront&&b.cullFace(b.BACK);c.resetGLState()}};
|
|
|
+THREE.SpritePlugin=function(){var a,b,c,d,e,g,f,h,k,n,p,m,q,t,s,r,v;function w(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var u,z,x,G=[],F,B,y;this.init=function(w){u=w.context;z=w;w=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]);var G=new Uint16Array([0,1,2,0,2,3]);F=u.createBuffer();B=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,F);u.bufferData(u.ARRAY_BUFFER,w,u.STATIC_DRAW);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,B);u.bufferData(u.ELEMENT_ARRAY_BUFFER,G,u.STATIC_DRAW);w=u.createProgram();
|
|
|
+var G=u.createShader(u.VERTEX_SHADER),I=u.createShader(u.FRAGMENT_SHADER);u.shaderSource(G,["precision "+z.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
|
|
|
+u.shaderSource(I,["precision "+z.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
|
|
|
+u.compileShader(G);u.compileShader(I);u.attachShader(w,G);u.attachShader(w,I);u.linkProgram(w);y=w;r=u.getAttribLocation(y,"position");v=u.getAttribLocation(y,"uv");a=u.getUniformLocation(y,"uvOffset");b=u.getUniformLocation(y,"uvScale");c=u.getUniformLocation(y,"rotation");d=u.getUniformLocation(y,"scale");e=u.getUniformLocation(y,"color");g=u.getUniformLocation(y,"map");f=u.getUniformLocation(y,"opacity");h=u.getUniformLocation(y,"modelViewMatrix");k=u.getUniformLocation(y,"projectionMatrix");n=
|
|
|
+u.getUniformLocation(y,"fogType");p=u.getUniformLocation(y,"fogDensity");m=u.getUniformLocation(y,"fogNear");q=u.getUniformLocation(y,"fogFar");t=u.getUniformLocation(y,"fogColor");s=u.getUniformLocation(y,"alphaTest");w=document.createElement("canvas");w.width=8;w.height=8;G=w.getContext("2d");G.fillStyle="white";G.fillRect(0,0,8,8);x=new THREE.Texture(w);x.needsUpdate=!0};this.render=function(E,R,I,O){G.length=0;E.traverseVisible(function(a){a instanceof THREE.Sprite&&G.push(a)});if(0!==G.length){u.useProgram(y);
|
|
|
+u.enableVertexAttribArray(r);u.enableVertexAttribArray(v);u.disable(u.CULL_FACE);u.enable(u.BLEND);u.bindBuffer(u.ARRAY_BUFFER,F);u.vertexAttribPointer(r,2,u.FLOAT,!1,16,0);u.vertexAttribPointer(v,2,u.FLOAT,!1,16,8);u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,B);u.uniformMatrix4fv(k,!1,R.projectionMatrix.elements);u.activeTexture(u.TEXTURE0);u.uniform1i(g,0);O=I=0;var C=E.fog;C?(u.uniform3f(t,C.color.r,C.color.g,C.color.b),C instanceof THREE.Fog?(u.uniform1f(m,C.near),u.uniform1f(q,C.far),u.uniform1i(n,1),
|
|
|
+O=I=1):C instanceof THREE.FogExp2&&(u.uniform1f(p,C.density),u.uniform1i(n,2),O=I=2)):(u.uniform1i(n,0),O=I=0);for(var C=0,W=G.length;C<W;C++){var U=G[C],Q=U.material;U._modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,U.matrixWorld);U.z=-U._modelViewMatrix.elements[14]}G.sort(w);R=[];C=0;for(W=G.length;C<W;C++)U=G[C],Q=U.material,u.uniform1f(s,Q.alphaTest),u.uniformMatrix4fv(h,!1,U._modelViewMatrix.elements),R[0]=U.scale.x,R[1]=U.scale.y,U=0,E.fog&&Q.fog&&(U=O),I!==U&&(u.uniform1i(n,U),I=U),
|
|
|
+null!==Q.map?(u.uniform2f(a,Q.map.offset.x,Q.map.offset.y),u.uniform2f(b,Q.map.repeat.x,Q.map.repeat.y)):(u.uniform2f(a,0,0),u.uniform2f(b,1,1)),u.uniform1f(f,Q.opacity),u.uniform3f(e,Q.color.r,Q.color.g,Q.color.b),u.uniform1f(c,Q.rotation),u.uniform2fv(d,R),z.setBlending(Q.blending,Q.blendEquation,Q.blendSrc,Q.blendDst),z.setDepthTest(Q.depthTest),z.setDepthWrite(Q.depthWrite),Q.map&&Q.map.image&&Q.map.image.width?z.setTexture(Q.map,0):z.setTexture(x,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,
|
|
|
0);u.enable(u.CULL_FACE);z.resetGLState()}}};
|
|
|
-THREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&(!1===c.frustumCulled||!0===n.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);r.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,g,f,h,k,m,n=new THREE.Frustum,q=new THREE.Matrix4,r=[];this.init=function(a,n,q,r){b=a.context;c=a;d=n;e=q;g=r;a=THREE.ShaderLib.depthRGBA;
|
|
|
-n=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,skinning:!0});m=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:n,morphTargets:!0,skinning:!0});f._shadowPass=
|
|
|
-!0;h._shadowPass=!0;k._shadowPass=!0;m._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,p){var s,v,w,u,z;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();p.matrixWorldInverse.getInverse(p.matrixWorld);q.multiplyMatrices(p.projectionMatrix,p.matrixWorldInverse);n.setFromMatrix(q);c.setRenderTarget(this.renderTarget);c.clear();r.length=0;a(e,e,p);var x;s=0;for(v=r.length;s<v;s++)w=r[s],z=w.object,w=w.buffer,
|
|
|
-z instanceof THREE.PointCloud&&!z.customDepthMaterial||((x=z.material instanceof THREE.MeshFaceMaterial?z.material.materials[0]:z.material)&&c.setMaterialFaces(z.material),u=void 0!==z.geometry.morphTargets&&0<z.geometry.morphTargets.length&&x.morphTargets,x=z instanceof THREE.SkinnedMesh&&x.skinning,u=z.customDepthMaterial?z.customDepthMaterial:x?u?m:k:u?h:f,w instanceof THREE.BufferGeometry?c.renderBufferDirect(p,d,null,u,w,z):c.renderBuffer(p,d,null,u,w,z));s=0;for(v=g.length;s<v;s++)w=g[s],z=
|
|
|
-w.object,z.visible&&(z._modelViewMatrix.multiplyMatrices(p.matrixWorldInverse,z.matrixWorld),c.renderImmediateObject(p,d,null,f,z));s=c.getClearColor();v=c.getClearAlpha();b.clearColor(s.r,s.g,s.b,v);b.enable(b.BLEND)}};
|
|
|
+THREE.DepthPassPlugin=function(){function a(b,c,d){if(c.visible){var f=e[c.id];if(f&&(!1===c.frustumCulled||!0===p.intersectsObject(c)))for(var g=0,h=f.length;g<h;g++){var k=f[g];c._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,c.matrixWorld);q.push(k)}g=0;for(h=c.children.length;g<h;g++)a(b,c.children[g],d)}}this.enabled=!1;this.renderTarget=null;var b,c,d,e,g,f,h,k,n,p=new THREE.Frustum,m=new THREE.Matrix4,q=[];this.init=function(a,m,p,q){b=a.context;c=a;d=m;e=p;g=q;a=THREE.ShaderLib.depthRGBA;
|
|
|
+m=THREE.UniformsUtils.clone(a.uniforms);f=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m});h=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m,morphTargets:!0});k=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m,skinning:!0});n=new THREE.ShaderMaterial({fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:m,morphTargets:!0,skinning:!0});f._shadowPass=
|
|
|
+!0;h._shadowPass=!0;k._shadowPass=!0;n._shadowPass=!0};this.render=function(a,b){this.enabled&&this.update(a,b)};this.update=function(e,s){var r,v,w,u,z;b.clearColor(1,1,1,1);b.disable(b.BLEND);c.setDepthTest(!0);!0===e.autoUpdate&&e.updateMatrixWorld();s.matrixWorldInverse.getInverse(s.matrixWorld);m.multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse);p.setFromMatrix(m);c.setRenderTarget(this.renderTarget);c.clear();q.length=0;a(e,e,s);var x;r=0;for(v=q.length;r<v;r++)w=q[r],z=w.object,w=w.buffer,
|
|
|
+z instanceof THREE.PointCloud&&!z.customDepthMaterial||((x=z.material instanceof THREE.MeshFaceMaterial?z.material.materials[0]:z.material)&&c.setMaterialFaces(z.material),u=void 0!==z.geometry.morphTargets&&0<z.geometry.morphTargets.length&&x.morphTargets,x=z instanceof THREE.SkinnedMesh&&x.skinning,u=z.customDepthMaterial?z.customDepthMaterial:x?u?n:k:u?h:f,w instanceof THREE.BufferGeometry?c.renderBufferDirect(s,d,null,u,w,z):c.renderBuffer(s,d,null,u,w,z));r=0;for(v=g.length;r<v;r++)w=g[r],z=
|
|
|
+w.object,z.visible&&(z._modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,z.matrixWorld),c.renderImmediateObject(s,d,null,f,z));r=c.getClearColor();v=c.getClearAlpha();b.clearColor(r.r,r.g,r.b,v);b.enable(b.BLEND)}};
|
|
|
THREE.ShaderFlares={lensFlareVertexTexture:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
|
|
|
lensFlare:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
|
|
|
fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}};
|