|
@@ -491,11 +491,11 @@ a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.l
|
|
|
(this.faceVertexUvs[0]=f);g&&(this.faceVertexUvs[1]=g)},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!==h[b])return h[b];h[b]=l.length/3;l.push(a.x,a.y,a.z);return h[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=q.length;q.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==t[b])return t[b];t[b]=m.length/2;m.push(a.x,
|
|
|
a.y);return t[b]}var e={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var f=this.parameters,g;for(g in f)void 0!==f[g]&&(e[g]=f[g]);return e}f=[];for(g=0;g<this.vertices.length;g++){var k=this.vertices[g];f.push(k.x,k.y,k.z)}var k=[],l=[],h={},q=[],p={},m=[],t={};for(g=0;g<this.faces.length;g++){var u=this.faces[g],r=void 0!==this.faceVertexUvs[0][g],z=0<u.normal.length(),w=0<u.vertexNormals.length,
|
|
|
x=1!==u.color.r||1!==u.color.g||1!==u.color.b,N=0<u.vertexColors.length,y=0,y=a(y,0,0),y=a(y,1,!0),y=a(y,2,!1),y=a(y,3,r),y=a(y,4,z),y=a(y,5,w),y=a(y,6,x),y=a(y,7,N);k.push(y);k.push(u.a,u.b,u.c);k.push(u.materialIndex);r&&(r=this.faceVertexUvs[0][g],k.push(d(r[0]),d(r[1]),d(r[2])));z&&k.push(b(u.normal));w&&(z=u.vertexNormals,k.push(b(z[0]),b(z[1]),b(z[2])));x&&k.push(c(u.color));N&&(u=u.vertexColors,k.push(c(u[0]),c(u[1]),c(u[2])))}e.data={};e.data.vertices=f;e.data.normals=l;0<q.length&&(e.data.colors=
|
|
|
-q);0<m.length&&(e.data.uvs=[m]);e.data.faces=k;return e},clone:function(){return(new T).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],k=[],h=0,n=g.length;h<
|
|
|
-n;h++)k.push(g[h].clone());this.faceVertexUvs[c].push(k)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var wc=0;Object.assign(nd.prototype,na.prototype,{computeBoundingBox:T.prototype.computeBoundingBox,computeBoundingSphere:T.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},
|
|
|
-computeGroups:function(a){var b,c=[],d;a=a.faces;for(var e=0;e<a.length;e++){var f=a[e];f.materialIndex!==d&&(d=f.materialIndex,void 0!==b&&(b.count=3*e-b.start,c.push(b)),b={start:3*e,materialIndex:d})}void 0!==b&&(b.count=3*e-b.start,c.push(b));this.groups=c},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,k=g.length,h;if(0<k){h=[];for(var n=0;n<k;n++)h[n]=[];this.morphTargets.position=h}var q=a.morphNormals,p=q.length,
|
|
|
-m;if(0<p){m=[];for(n=0;n<p;n++)m[n]=[];this.morphTargets.normal=m}for(var t=a.skinIndices,u=a.skinWeights,r=t.length===c.length,z=u.length===c.length,n=0;n<b.length;n++){var w=b[n];this.vertices.push(c[w.a],c[w.b],c[w.c]);var x=w.vertexNormals;3===x.length?this.normals.push(x[0],x[1],x[2]):(x=w.normal,this.normals.push(x,x,x));x=w.vertexColors;3===x.length?this.colors.push(x[0],x[1],x[2]):(x=w.color,this.colors.push(x,x,x));!0===e&&(x=d[0][n],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
|
|
|
-n),this.uvs.push(new B,new B,new B)));!0===f&&(x=d[1][n],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",n),this.uvs2.push(new B,new B,new B)));for(x=0;x<k;x++){var N=g[x].vertices;h[x].push(N[w.a],N[w.b],N[w.c])}for(x=0;x<p;x++)N=q[x].vertexNormals[n],m[x].push(N.a,N.b,N.c);r&&this.skinIndices.push(t[w.a],t[w.b],t[w.c]);z&&this.skinWeights.push(u[w.a],u[w.b],u[w.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;
|
|
|
+q);0<m.length&&(e.data.uvs=[m]);e.data.faces=k;return e},clone:function(){return(new T).copy(this)},copy:function(a){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];for(var b=a.vertices,c=0,d=b.length;c<d;c++)this.vertices.push(b[c].clone());b=a.faces;c=0;for(d=b.length;c<d;c++)this.faces.push(b[c].clone());c=0;for(d=a.faceVertexUvs.length;c<d;c++){b=a.faceVertexUvs[c];void 0===this.faceVertexUvs[c]&&(this.faceVertexUvs[c]=[]);for(var e=0,f=b.length;e<f;e++){for(var g=b[e],k=[],l=0,h=g.length;l<
|
|
|
+h;l++)k.push(g[l].clone());this.faceVertexUvs[c].push(k)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var wc=0;Object.assign(nd.prototype,na.prototype,{computeBoundingBox:T.prototype.computeBoundingBox,computeBoundingSphere:T.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},
|
|
|
+computeGroups:function(a){var b,c=[],d;a=a.faces;for(var e=0;e<a.length;e++){var f=a[e];f.materialIndex!==d&&(d=f.materialIndex,void 0!==b&&(b.count=3*e-b.start,c.push(b)),b={start:3*e,materialIndex:d})}void 0!==b&&(b.count=3*e-b.start,c.push(b));this.groups=c},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,f=d[1]&&0<d[1].length,g=a.morphTargets,k=g.length,l;if(0<k){l=[];for(var h=0;h<k;h++)l[h]=[];this.morphTargets.position=l}var q=a.morphNormals,p=q.length,
|
|
|
+m;if(0<p){m=[];for(h=0;h<p;h++)m[h]=[];this.morphTargets.normal=m}for(var t=a.skinIndices,u=a.skinWeights,r=t.length===c.length,z=u.length===c.length,h=0;h<b.length;h++){var w=b[h];this.vertices.push(c[w.a],c[w.b],c[w.c]);var x=w.vertexNormals;3===x.length?this.normals.push(x[0],x[1],x[2]):(x=w.normal,this.normals.push(x,x,x));x=w.vertexColors;3===x.length?this.colors.push(x[0],x[1],x[2]):(x=w.color,this.colors.push(x,x,x));!0===e&&(x=d[0][h],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",
|
|
|
+h),this.uvs.push(new B,new B,new B)));!0===f&&(x=d[1][h],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new B,new B,new B)));for(x=0;x<k;x++){var N=g[x].vertices;l[x].push(N[w.a],N[w.b],N[w.c])}for(x=0;x<p;x++)N=q[x].vertexNormals[h],m[x].push(N.a,N.b,N.c);r&&this.skinIndices.push(t[w.a],t[w.b],t[w.c]);z&&this.skinWeights.push(u[w.a],u[w.b],u[w.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;
|
|
|
this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Object.assign(H.prototype,na.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){this.index=a},addAttribute:function(a,b,c){if(!1===(b&&b.isBufferAttribute)&&!1===(b&&b.isInterleavedBufferAttribute))console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
|
|
|
this.addAttribute(a,new C(b,c));else if("index"===a)console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b);else return this.attributes[a]=b,this},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=
|
|
|
b},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 ra).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a;return function(b){void 0===a&&(a=new I);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===
|
|
@@ -598,11 +598,11 @@ DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return ne
|
|
|
this.InterpolantFactoryMethodSmooth}if(void 0===b){b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(b);console.warn(b)}else this.createInterpolant=b},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},
|
|
|
getValueSize:function(){return this.values.length/this.times.length},shift:function(a){if(0!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]+=a;return this},scale:function(a){if(1!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]*=a;return this},trim:function(a,b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]<a;)++e;for(;-1!==f&&c[f]>b;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),d=this.getValueSize(),this.times=h.AnimationUtils.arraySlice(c,e,f),this.values=h.AnimationUtils.arraySlice(this.values,
|
|
|
e*d,f*d);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("invalid value size in track",this),a=!1);var c=this.times,b=this.values,d=c.length;0===d&&(console.error("track is empty",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("time is not a valid number",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("out of order keys",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&h.AnimationUtils.isTypedArray(b))for(f=
|
|
|
-0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("value is not a valid number",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=1,e=1,f=a.length-1;e<=f;++e){var g=!1,k=a[e];if(k!==a[e+1]&&(1!==e||k!==k[0]))for(var l=e*c,n=l-c,q=l+c,k=0;k!==c;++k){var p=b[l+k];if(p!==b[n+k]||p!==b[q+k]){g=!0;break}}if(g){if(e!==d)for(a[d]=a[e],g=e*c,l=d*c,k=0;k!==c;++k)b[l+k]=b[g+k];++d}}d!==a.length&&(this.times=h.AnimationUtils.arraySlice(a,0,d),
|
|
|
-this.values=h.AnimationUtils.arraySlice(b,0,d*c));return this}};Eb.prototype=Object.assign(Object.create(Sa),{constructor:Eb,ValueTypeName:"vector"});Nc.prototype=Object.assign(Object.create(ja.prototype),{constructor:Nc,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)ha.slerpFlat(e,0,f,a-g,f,a,b);return e}});dc.prototype=Object.assign(Object.create(Sa),{constructor:dc,ValueTypeName:"quaternion",DefaultInterpolation:2301,
|
|
|
-InterpolantFactoryMethodLinear:function(a){return new Nc(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});Fb.prototype=Object.assign(Object.create(Sa),{constructor:Fb,ValueTypeName:"number"});Oc.prototype=Object.assign(Object.create(Sa),{constructor:Oc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Pc.prototype=Object.assign(Object.create(Sa),{constructor:Pc,
|
|
|
-ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Qc.prototype=Object.assign(Object.create(Sa),{constructor:Qc,ValueTypeName:"color"});eb.prototype=Sa;Sa.constructor=eb;Object.assign(eb,{parse:function(a){if(void 0===a.type)throw Error("track type undefined, can not parse");var b=eb._getTrackTypeForValueTypeName(a.type);if(void 0===a.times){var c=[],d=[];h.AnimationUtils.flattenJSON(a.keys,c,d,"value");
|
|
|
-a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)},toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{var b={name:a.name,times:h.AnimationUtils.convertArray(a.times,Array),values:h.AnimationUtils.convertArray(a.values,Array)},c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b},_getTrackTypeForValueTypeName:function(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return Fb;
|
|
|
+0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("value is not a valid number",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;g<f;++g){var k=!1,l=a[g];if(l!==a[g+1]&&(1!==g||l!==l[0]))if(d)k=!0;else for(var n=g*c,q=n-c,p=n+c,l=0;l!==c;++l){var m=b[n+l];if(m!==b[q+l]||m!==b[p+l]){k=!0;break}}if(k){if(g!==e){a[e]=a[g];for(var k=g*c,t=e*c,l=0;l!==c;++l)b[t+l]=b[k+l]}++e}}a[e++]=
|
|
|
+a[f];k=f*c;for(l=0;l!==c;++l)b[t+l]=b[k+l];e!==a.length&&(this.times=h.AnimationUtils.arraySlice(a,0,e),this.values=h.AnimationUtils.arraySlice(b,0,e*c));return this}};Eb.prototype=Object.assign(Object.create(Sa),{constructor:Eb,ValueTypeName:"vector"});Nc.prototype=Object.assign(Object.create(ja.prototype),{constructor:Nc,interpolate_:function(a,b,c,d){var e=this.resultBuffer,f=this.sampleValues,g=this.valueSize;a*=g;b=(c-b)/(d-b);for(c=a+g;a!==c;a+=4)ha.slerpFlat(e,0,f,a-g,f,a,b);return e}});dc.prototype=
|
|
|
+Object.assign(Object.create(Sa),{constructor:dc,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new Nc(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});Fb.prototype=Object.assign(Object.create(Sa),{constructor:Fb,ValueTypeName:"number"});Oc.prototype=Object.assign(Object.create(Sa),{constructor:Oc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,
|
|
|
+InterpolantFactoryMethodSmooth:void 0});Pc.prototype=Object.assign(Object.create(Sa),{constructor:Pc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Qc.prototype=Object.assign(Object.create(Sa),{constructor:Qc,ValueTypeName:"color"});eb.prototype=Sa;Sa.constructor=eb;Object.assign(eb,{parse:function(a){if(void 0===a.type)throw Error("track type undefined, can not parse");var b=eb._getTrackTypeForValueTypeName(a.type);
|
|
|
+if(void 0===a.times){var c=[],d=[];h.AnimationUtils.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)},toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{var b={name:a.name,times:h.AnimationUtils.convertArray(a.times,Array),values:h.AnimationUtils.convertArray(a.values,Array)},c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b},_getTrackTypeForValueTypeName:function(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return Fb;
|
|
|
case "vector":case "vector2":case "vector3":case "vector4":return Eb;case "color":return Qc;case "quaternion":return dc;case "bool":case "boolean":return Pc;case "string":return Oc}throw Error("Unsupported typeName: "+a);}});sa.prototype={constructor:sa,resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b)var d=this.tracks[b],a=Math.max(a,d.times[d.times.length-1]);this.duration=a},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},
|
|
|
optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}};Object.assign(sa,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||1),e=0,f=c.length;e!==f;++e)b.push(eb.parse(c[e]).scale(d));return new sa(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b};for(var d=0,e=c.length;d!==e;++d)b.push(eb.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,f=[],g=0;g<e;g++){var k=
|
|
|
[],l=[];k.push((g+e-1)%e,g,(g+1)%e);l.push(0,1,0);var n=h.AnimationUtils.getKeyframeOrder(k),k=h.AnimationUtils.sortedArray(k,1,n),l=h.AnimationUtils.sortedArray(l,1,n);d||0!==k[0]||(k.push(e),l.push(l[0]));f.push((new Fb(".morphTargetInfluences["+b[g].name+"]",k,l)).scale(1/c))}return new sa(a,-1,f)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(var d=0;d<c.length;d++)if(c[d].name===b)return c[d];return null},CreateClipsFromMorphTargetSequences:function(a,
|
|
@@ -731,9 +731,9 @@ null!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}});Object.as
|
|
|
q.ValueTypeName,q.getValueSize());++m.referenceCount;this._addInactiveBinding(m,k,p)}f[h]=m;g[h].resultBuffer=m.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},
|
|
|
_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},
|
|
|
get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&a<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,f=e[b];void 0===f?(f={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=f):(b=
|
|
|
-f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);f.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;var c=a._clip.uuid,d=this._actionsByClip,e=d[c],f=e.knownActions,g=f[f.length-1],k=a._byClipCacheIndex;g._byClipCacheIndex=k;f[k]=g;f.pop();a._byClipCacheIndex=null;delete e.actionByRoot[(b._localRoot||this._root).uuid];0===f.length&&delete d[c];this._removeInactiveBindingsForAction(a)},
|
|
|
+f.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);f.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;var c=a._clip.uuid,d=this._actionsByClip,e=d[c],f=e.knownActions,g=f[f.length-1],h=a._byClipCacheIndex;g._byClipCacheIndex=h;f[h]=g;f.pop();a._byClipCacheIndex=null;delete e.actionByRoot[(b._localRoot||this._root).uuid];0===f.length&&delete d[c];this._removeInactiveBindingsForAction(a)},
|
|
|
_removeInactiveBindingsForAction:function(a){a=a._propertyBindings;for(var b=0,c=a.length;b!==c;++b){var d=a[b];0===--d.referenceCount&&this._removeInactiveBinding(d)}},_lendAction:function(a){var b=this._actions,c=a._cacheIndex,d=this._nActiveActions++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackAction:function(a){var b=this._actions,c=a._cacheIndex,d=--this._nActiveActions,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_addInactiveBinding:function(a,b,c){var d=this._bindingsByRootAndName,
|
|
|
-e=d[b],f=this._bindings;void 0===e&&(e={},d[b]=e);e[c]=a;a._cacheIndex=f.length;f.push(a)},_removeInactiveBinding:function(a){var b=this._bindings,c=a.binding,d=c.rootNode.uuid,c=c.path,e=this._bindingsByRootAndName,f=e[d],g=b[b.length-1];a=a._cacheIndex;g._cacheIndex=a;b[a]=g;b.pop();delete f[c];a:{for(var k in f)break a;delete e[d]}},_lendBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackBinding:function(a){var b=
|
|
|
+e=d[b],f=this._bindings;void 0===e&&(e={},d[b]=e);e[c]=a;a._cacheIndex=f.length;f.push(a)},_removeInactiveBinding:function(a){var b=this._bindings,c=a.binding,d=c.rootNode.uuid,c=c.path,e=this._bindingsByRootAndName,f=e[d],g=b[b.length-1];a=a._cacheIndex;g._cacheIndex=a;b[a]=g;b.pop();delete f[c];a:{for(var h in f)break a;delete e[d]}},_lendBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackBinding:function(a){var b=
|
|
|
this._bindings,c=a._cacheIndex,d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new cc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=
|
|
|
d;b[d]=a;e.__cacheIndex=c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1)});Id.prototype={constructor:Id,onUpdate:function(a){this.dynamic=!0;this.onUpdateCallback=a;return this}};kb.prototype=Object.create(H.prototype);kb.prototype.constructor=kb;kb.prototype.isInstancedBufferGeometry=!0;kb.prototype.addGroup=function(a,b,c){this.groups.push({start:a,count:b,instances:c})};kb.prototype.copy=function(a){var b=a.index;null!==b&&this.setIndex(b.clone());var b=a.attributes,c;for(c in b)this.addAttribute(c,
|
|
|
b[c].clone());a=a.groups;c=0;for(b=a.length;c<b;c++){var d=a[c];this.addGroup(d.start,d.count,d.instances)}return this};Jd.prototype={constructor:Jd,isInterleavedBufferAttribute:!0,get length(){console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count.");return this.array.length},get count(){return this.data.count},get array(){return this.data.array},setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=b;return this},setY:function(a,b){this.data.array[a*this.data.stride+
|
|
@@ -745,19 +745,19 @@ b){b&&b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld
|
|
|
[];if(!1===Array.isArray(a))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),c;for(var d=0,e=a.length;d<e;d++)Ld(a[d],this,c,b);c.sort(le);return c}};Md.prototype={constructor:Md,start:function(){this.oldTime=this.startTime=(performance||Date).now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=
|
|
|
(performance||Date).now(),a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}};Nd.prototype={constructor:Nd,set:function(a,b,c){this.radius=a;this.phi=b;this.theta=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius.copy(a.radius);this.phi.copy(a.phi);this.theta.copy(a.theta);return this},makeSafe:function(){this.phi=Math.max(1E-6,Math.min(Math.PI-1E-6,this.phi));return this},setFromVector3:function(a){this.radius=a.length();0===this.radius?
|
|
|
this.phi=this.theta=0:(this.theta=Math.atan2(a.x,a.z),this.phi=Math.acos(h.Math.clamp(a.y/this.radius,-1,1)));return this}};qa.prototype=Object.create(ua.prototype);qa.prototype.constructor=qa;qa.prototype.createAnimation=function(a,b,c,d){b={start:b,end:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)};qa.prototype.autoCreateAnimations=function(a){for(var b=
|
|
|
-/([a-z]+)_?(\d+)/i,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;f<g;f++){var k=e.morphTargets[f].name.match(b);if(k&&1<k.length){var h=k[1];d[h]||(d[h]={start:Infinity,end:-Infinity});k=d[h];f<k.start&&(k.start=f);f>k.end&&(k.end=f);c||(c=h)}}for(h in d)k=d[h],this.createAnimation(h,k.start,k.end,a);this.firstAnimation=c};qa.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};qa.prototype.setAnimationDirectionBackward=function(a){if(a=
|
|
|
+/([a-z]+)_?(\d+)/i,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;f<g;f++){var h=e.morphTargets[f].name.match(b);if(h&&1<h.length){var l=h[1];d[l]||(d[l]={start:Infinity,end:-Infinity});h=d[l];f<h.start&&(h.start=f);f>h.end&&(h.end=f);c||(c=l)}}for(l in d)h=d[l],this.createAnimation(l,h.start,h.end,a);this.firstAnimation=c};qa.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};qa.prototype.setAnimationDirectionBackward=function(a){if(a=
|
|
|
this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};qa.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)};qa.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};qa.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};qa.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};qa.prototype.getAnimationTime=
|
|
|
function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};qa.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};qa.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")};qa.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};qa.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 f=d.start+h.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=
|
|
|
1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);d.currentFrame!==d.lastFrame?(this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g):this.morphTargetInfluences[d.currentFrame]=g}}};gc.prototype=Object.create(D.prototype);gc.prototype.constructor=gc;gc.prototype.isImmediateRenderObject=!0;hc.prototype=Object.create(H.prototype);hc.prototype.constructor=hc;Uc.prototype=Object.create(ba.prototype);
|
|
|
-Uc.prototype.constructor=Uc;ic.prototype=Object.create(ba.prototype);ic.prototype.constructor=ic;ic.prototype.update=function(){var a=new r,b=new r,c=new ra;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var k=g.vertices,h=g.faces,n=g=0,q=h.length;n<q;n++)for(var p=h[n],m=0,r=p.vertexNormals.length;m<r;m++){var u=p.vertexNormals[m];
|
|
|
-a.copy(k[p[d[m]]]).applyMatrix4(e);b.copy(u).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);f.setXYZ(g,a.x,a.y,a.z);g+=1;f.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g&&g.isBufferGeometry)for(d=g.attributes.position,k=g.attributes.normal,m=g=0,r=d.count;m<r;m++)a.set(d.getX(m),d.getY(m),d.getZ(m)).applyMatrix4(e),b.set(k.getX(m),k.getY(m),k.getZ(m)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0;return this}}();
|
|
|
+Uc.prototype.constructor=Uc;ic.prototype=Object.create(ba.prototype);ic.prototype.constructor=ic;ic.prototype.update=function(){var a=new r,b=new r,c=new ra;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f=this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,l=g.faces,n=g=0,q=l.length;n<q;n++)for(var p=l[n],m=0,r=p.vertexNormals.length;m<r;m++){var u=p.vertexNormals[m];
|
|
|
+a.copy(h[p[d[m]]]).applyMatrix4(e);b.copy(u).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);f.setXYZ(g,a.x,a.y,a.z);g+=1;f.setXYZ(g,b.x,b.y,b.z);g+=1}else if(g&&g.isBufferGeometry)for(d=g.attributes.position,h=g.attributes.normal,m=g=0,r=d.count;m<r;m++)a.set(d.getX(m),d.getY(m),d.getZ(m)).applyMatrix4(e),b.set(h.getX(m),h.getY(m),h.getZ(m)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),f.setXYZ(g,a.x,a.y,a.z),g+=1,f.setXYZ(g,b.x,b.y,b.z),g+=1;f.needsUpdate=!0;return this}}();
|
|
|
Lb.prototype=Object.create(D.prototype);Lb.prototype.constructor=Lb;Lb.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};Lb.prototype.update=function(){var a=new r,b=new r;return function(){var c=this.light.distance?this.light.distance:1E3,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)}}();
|
|
|
Mb.prototype=Object.create(ba.prototype);Mb.prototype.constructor=Mb;Mb.prototype.getBoneList=function(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c<a.children.length;c++)b.push.apply(b,this.getBoneList(a.children[c]));return b};Mb.prototype.update=function(){for(var a=this.geometry,b=(new I).getInverse(this.root.matrixWorld),c=new I,d=0,e=0;e<this.bones.length;e++){var f=this.bones[e];f.parent&&f.parent.isBone&&(c.multiplyMatrices(b,f.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,
|
|
|
f.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0;a.computeBoundingSphere()};Nb.prototype=Object.create(H.prototype);Nb.prototype.constructor=Nb;Ob.prototype=Object.create(ua.prototype);Ob.prototype.constructor=Ob;Ob.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};Ob.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)};jc.prototype=Object.create(T.prototype);jc.prototype.constructor=
|
|
|
jc;Pb.prototype=Object.create(D.prototype);Pb.prototype.constructor=Pb;Pb.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()};Pb.prototype.update=function(){var a=new r;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=
|
|
|
!0}}();kc.prototype=Object.create(ba.prototype);kc.prototype.constructor=kc;kc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};lc.prototype=Object.create(ba.prototype);lc.prototype.constructor=lc;lc.prototype.update=function(){var a=new r,b=new r,c=new ra;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);for(var d=this.object.matrixWorld,e=this.geometry.attributes.position,
|
|
|
-f=this.object.geometry,g=f.vertices,f=f.faces,k=0,h=0,n=f.length;h<n;h++){var q=f[h],p=q.normal;a.copy(g[q.a]).add(g[q.b]).add(g[q.c]).divideScalar(3).applyMatrix4(d);b.copy(p).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);e.setXYZ(k,a.x,a.y,a.z);k+=1;e.setXYZ(k,b.x,b.y,b.z);k+=1}e.needsUpdate=!0;return this}}();mc.prototype=Object.create(H.prototype);mc.prototype.constructor=mc;Vc.prototype=Object.create(ba.prototype);Vc.prototype.constructor=Vc;Qb.prototype=Object.create(D.prototype);
|
|
|
+f=this.object.geometry,g=f.vertices,f=f.faces,h=0,l=0,n=f.length;l<n;l++){var q=f[l],p=q.normal;a.copy(g[q.a]).add(g[q.b]).add(g[q.c]).divideScalar(3).applyMatrix4(d);b.copy(p).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);e.setXYZ(h,a.x,a.y,a.z);h+=1;e.setXYZ(h,b.x,b.y,b.z);h+=1}e.needsUpdate=!0;return this}}();mc.prototype=Object.create(H.prototype);mc.prototype.constructor=mc;Vc.prototype=Object.create(ba.prototype);Vc.prototype.constructor=Vc;Qb.prototype=Object.create(D.prototype);
|
|
|
Qb.prototype.constructor=Qb;Qb.prototype.dispose=function(){var a=this.children[0],b=this.children[1];a.geometry.dispose();a.material.dispose();b.geometry.dispose();b.material.dispose()};Qb.prototype.update=function(){var a=new r,b=new r,c=new r;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,a);var d=this.children[0],e=this.children[1];d.lookAt(c);d.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
|
|
|
e.lookAt(c);e.scale.z=c.length()}}();nc.prototype=Object.create(ba.prototype);nc.prototype.constructor=nc;nc.prototype.update=function(){function a(a,g,h,l){d.set(g,h,l).unproject(e);a=c[a];if(void 0!==a)for(g=0,h=a.length;g<h;g++)b.vertices[a[g]].copy(d)}var b,c,d=new r,e=new ma;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);a("f2",1,
|
|
|
-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",.7,1.1,-1);a("u2",-.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);b.verticesNeedUpdate=!0}}();Rb.prototype=Object.create(T.prototype);Rb.prototype.constructor=Rb;oc.prototype=Object.create(ua.prototype);oc.prototype.constructor=oc;oc.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)};
|