|
@@ -262,9 +262,9 @@ THREE.AnimationClip.prototype={constructor:THREE.AnimationClip,getAt:function(a)
|
|
|
THREE.AnimationClip.CreateFromMorphTargetSequence=function(a,b,c){for(var d=b.length,e=[],g=0;g<d;g++){var f=[];f.push({time:(g+d-1)%d,value:0});f.push({time:g,value:1});f.push({time:(g+1)%d,value:0});f.sort(THREE.KeyframeTrack.keyComparer);0===f[0].time&&f.push({time:d,value:f[0].value});e.push((new THREE.NumberKeyframeTrack(".morphTargetInfluences["+b[g].name+"]",f)).scale(1/c))}return new THREE.AnimationClip(a,-1,e)};
|
|
|
THREE.AnimationClip.findByName=function(a,b){for(var c=0;c<a.length;c++)if(a[c].name===b)return a[c];return null};THREE.AnimationClip.CreateClipsFromMorphTargetSequences=function(a,b){for(var c={},d=/^([\w-]*?)([\d]+)$/,e=0,g=a.length;e<g;e++){var f=a[e],h=f.name.match(d);if(h&&1<h.length){var l=h[1];(h=c[l])||(c[l]=h=[]);h.push(f)}}d=[];for(l in c)d.push(THREE.AnimationClip.CreateFromMorphTargetSequence(l,c[l],b));return d};
|
|
|
THREE.AnimationClip.parse=function(a){for(var b=[],c=0;c<a.tracks.length;c++)b.push(THREE.KeyframeTrack.parse(a.tracks[c]).scale(1/a.fps));return new THREE.AnimationClip(a.name,a.duration,b)};
|
|
|
-THREE.AnimationClip.parseAnimation=function(a,b,c){if(!a)return console.error(" no animation in JSONLoader data"),null;var d=function(a,b,c,d,e){for(var g=[],f=0;f<b.length;f++){var h=b[f];void 0!==h[c]&&g.push({time:h.time,value:e(h)})}return 0<g.length?new d(a,g):null},e=[],g=a.name||"default",f=a.length||-1,h=a.fps||30;a=a.hierarchy||[];for(var l=0;l<a.length;l++){var k=a[l].keys;if(k&&0!=k.length)if(k[0].morphTargets){for(var f={},m=0;m<k.length;m++)if(k[m].morphTargets)for(var p=0;p<k[m].morphTargets.length;p++)f[k[m].morphTargets[p]]=
|
|
|
--1;for(var n in f){for(var q=[],p=0;p<k[m].morphTargets.length;p++){var s=k[m];q.push({time:s.time,value:s.morphTarget===n?1:0})}e.push(new THREE.NumberKeyframeTrack(c+".morphTargetInfluence["+n+"]",q))}f=f.length*(h||1)}else m=c+".bones["+b[l].name+"]",(p=d(m+".position",k,"pos",THREE.VectorKeyframeTrack,function(a){return(new THREE.Vector3).fromArray(a.pos)}))&&e.push(p),(p=d(m+".quaternion",k,"rot",THREE.QuaternionKeyframeTrack,function(a){return a.rot.slerp?a.rot.clone():(new THREE.Quaternion).fromArray(a.rot)}))&&
|
|
|
-e.push(p),(k=d(m+".scale",k,"scl",THREE.VectorKeyframeTrack,function(a){return(new THREE.Vector3).fromArray(a.scl)}))&&e.push(k)}return 0===e.length?null:new THREE.AnimationClip(g,f,e)};THREE.AnimationMixer=function(a){this.root=a;this.time=0;this.timeScale=1;this.actions=[];this.propertyBindingMap={}};
|
|
|
+THREE.AnimationClip.parseAnimation=function(a,b){if(!a)return console.error(" no animation in JSONLoader data"),null;for(var c=function(a,b,c,d,e){for(var g=[],f=0;f<b.length;f++){var h=b[f];void 0!==h[c]&&g.push({time:h.time,value:e(h)})}return 0<g.length?new d(a,g):null},d=[],e=a.name||"default",g=a.length||-1,f=a.fps||30,h=a.hierarchy||[],l=0;l<h.length;l++){var k=h[l].keys;if(k&&0!=k.length)if(k[0].morphTargets){for(var g={},m=0;m<k.length;m++)if(k[m].morphTargets)for(var p=0;p<k[m].morphTargets.length;p++)g[k[m].morphTargets[p]]=
|
|
|
+-1;for(var n in g){for(var q=[],p=0;p<k[m].morphTargets.length;p++){var s=k[m];q.push({time:s.time,value:s.morphTarget===n?1:0})}d.push(new THREE.NumberKeyframeTrack(".morphTargetInfluence["+n+"]",q))}g=g.length*(f||1)}else m=".bones["+b[l].name+"]",(p=c(m+".position",k,"pos",THREE.VectorKeyframeTrack,function(a){return(new THREE.Vector3).fromArray(a.pos)}))&&d.push(p),(p=c(m+".quaternion",k,"rot",THREE.QuaternionKeyframeTrack,function(a){return a.rot.slerp?a.rot.clone():(new THREE.Quaternion).fromArray(a.rot)}))&&
|
|
|
+d.push(p),(k=c(m+".scale",k,"scl",THREE.VectorKeyframeTrack,function(a){return(new THREE.Vector3).fromArray(a.scl)}))&&d.push(k)}return 0===d.length?null:new THREE.AnimationClip(e,g,d)};THREE.AnimationMixer=function(a){this.root=a;this.time=0;this.timeScale=1;this.actions=[];this.propertyBindingMap={}};
|
|
|
THREE.AnimationMixer.prototype={constructor:THREE.AnimationMixer,addAction:function(a){this.actions.push(a);a.init(this.time);a.mixer=this;for(var b=a.clip.tracks,c=a.localRoot||this.root,d=0;d<b.length;d++){var e=b[d],g=c.uuid+"-"+e.name,f=this.propertyBindingMap[g];void 0===f&&(f=new THREE.PropertyBinding(c,e.name),this.propertyBindingMap[g]=f);a.propertyBindings.push(f);f.referenceCount+=1}},removeAllActions:function(){for(var a=0;a<this.actions.length;a++)this.actions[a].mixer=null;for(var b in this.propertyBindingMap)this.propertyBindingMap[b].unbind();
|
|
|
this.actions=[];this.propertyBindingMap={};return this},removeAction:function(a){var b=this.actions.indexOf(a);-1!==b&&(this.actions.splice(b,1),a.mixer=null);b=a.localRoot||this.root;a=a.clip.tracks;for(var c=0;c<a.length;c++){var d=b.uuid+"-"+a[c].name,e=this.propertyBindingMap[d];e.referenceCount-=1;0>=e.referenceCount&&(e.unbind(),delete this.propertyBindingMap[d])}return this},findActionByName:function(a){for(var b=0;b<this.actions.length;b++)if(this.actions[b].name===a)return this.actions[b];
|
|
|
return null},play:function(a,b){a.startTime=this.time;this.addAction(a);return this},fadeOut:function(a,b){var c=[];c.push({time:this.time,value:1});c.push({time:this.time+b,value:0});a.weight=new THREE.NumberKeyframeTrack("weight",c);return this},fadeIn:function(a,b){var c=[];c.push({time:this.time,value:0});c.push({time:this.time+b,value:1});a.weight=new THREE.NumberKeyframeTrack("weight",c);return this},warp:function(a,b,c,d){var e=[];e.push({time:this.time,value:b});e.push({time:this.time+d,value:c});
|
|
@@ -367,9 +367,9 @@ parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=THREE.Animati
|
|
|
parseTextures:function(a,b){function c(a){if("number"===typeof a)return a;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a);return THREE[a]}var d={};if(void 0!==a)for(var e=0,g=a.length;e<g;e++){var f=a[e];void 0===f.image&&console.warn('THREE.ObjectLoader: No "image" specified for',f.uuid);void 0===b[f.image]&&console.warn("THREE.ObjectLoader: Undefined image",f.image);var h=new THREE.Texture(b[f.image]);h.needsUpdate=!0;h.uuid=f.uuid;void 0!==f.name&&(h.name=
|
|
|
f.name);void 0!==f.mapping&&(h.mapping=c(f.mapping));void 0!==f.offset&&(h.offset=new THREE.Vector2(f.offset[0],f.offset[1]));void 0!==f.repeat&&(h.repeat=new THREE.Vector2(f.repeat[0],f.repeat[1]));void 0!==f.minFilter&&(h.minFilter=c(f.minFilter));void 0!==f.magFilter&&(h.magFilter=c(f.magFilter));void 0!==f.anisotropy&&(h.anisotropy=f.anisotropy);Array.isArray(f.wrap)&&(h.wrapS=c(f.wrap[0]),h.wrapT=c(f.wrap[1]));d[f.uuid]=h}return d},parseObject:function(){var a=new THREE.Matrix4;return function(b,
|
|
|
c,d){function e(a){void 0===c[a]&&console.warn("THREE.ObjectLoader: Undefined geometry",a);return c[a]}function g(a){if(void 0!==a)return void 0===d[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),d[a]}var f;switch(b.type){case "Scene":f=new THREE.Scene;break;case "PerspectiveCamera":f=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,b.far);break;case "OrthographicCamera":f=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":f=new THREE.AmbientLight(b.color);
|
|
|
-break;case "DirectionalLight":f=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":f=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case "SpotLight":f=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case "HemisphereLight":f=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case "Mesh":f=new THREE.Mesh(e(b.geometry),g(b.material));break;case "LOD":f=new THREE.LOD;break;case "Line":f=new THREE.Line(e(b.geometry),
|
|
|
-g(b.material),b.mode);break;case "PointCloud":case "Points":f=new THREE.Points(e(b.geometry),g(b.material));break;case "Sprite":f=new THREE.Sprite(g(b.material));break;case "Group":f=new THREE.Group;break;default:f=new THREE.Object3D}f.uuid=b.uuid;void 0!==b.name&&(f.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(f.position,f.quaternion,f.scale)):(void 0!==b.position&&f.position.fromArray(b.position),void 0!==b.rotation&&f.rotation.fromArray(b.rotation),void 0!==b.scale&&f.scale.fromArray(b.scale));
|
|
|
-void 0!==b.castShadow&&(f.castShadow=b.castShadow);void 0!==b.receiveShadow&&(f.receiveShadow=b.receiveShadow);void 0!==b.visible&&(f.visible=b.visible);void 0!==b.userData&&(f.userData=b.userData);if(void 0!==b.children)for(var h in b.children)f.add(this.parseObject(b.children[h],c,d));if("LOD"===b.type){b=b.levels;for(var l=0;l<b.length;l++){var k=b[l];h=f.getObjectByProperty("uuid",k.object);void 0!==h&&f.addLevel(h,k.distance)}}return f}}()};
|
|
|
+break;case "DirectionalLight":f=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":f=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case "SpotLight":f=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case "HemisphereLight":f=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case "Mesh":f=e(b.geometry);var h=g(b.material);f=f.bones&&0<f.bones.length?new THREE.SkinnedMesh(f,h):new THREE.Mesh(f,h);break;case "LOD":f=
|
|
|
+new THREE.LOD;break;case "Line":f=new THREE.Line(e(b.geometry),g(b.material),b.mode);break;case "PointCloud":case "Points":f=new THREE.Points(e(b.geometry),g(b.material));break;case "Sprite":f=new THREE.Sprite(g(b.material));break;case "Group":f=new THREE.Group;break;default:f=new THREE.Object3D}f.uuid=b.uuid;void 0!==b.name&&(f.name=b.name);void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(f.position,f.quaternion,f.scale)):(void 0!==b.position&&f.position.fromArray(b.position),void 0!==b.rotation&&
|
|
|
+f.rotation.fromArray(b.rotation),void 0!==b.scale&&f.scale.fromArray(b.scale));void 0!==b.castShadow&&(f.castShadow=b.castShadow);void 0!==b.receiveShadow&&(f.receiveShadow=b.receiveShadow);void 0!==b.visible&&(f.visible=b.visible);void 0!==b.userData&&(f.userData=b.userData);if(void 0!==b.children)for(var l in b.children)f.add(this.parseObject(b.children[l],c,d));if("LOD"===b.type)for(b=b.levels,h=0;h<b.length;h++){var k=b[h];l=f.getObjectByProperty("uuid",k.object);void 0!==l&&f.addLevel(l,k.distance)}return f}}()};
|
|
|
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.Texture,g=new THREE.ImageLoader(this.manager);g.setCrossOrigin(this.crossOrigin);g.setPath(this.path);g.load(a,function(a){e.image=a;e.needsUpdate=!0;void 0!==b&&b(e)},c,d);return e},setCrossOrigin:function(a){this.crossOrigin=a},setPath:function(a){this.path=a}};
|
|
|
THREE.CubeTextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager};
|
|
|
THREE.CubeTextureLoader.prototype={constructor:THREE.CubeTextureLoader,load:function(a,b,c,d){function e(c){f.load(a[c],function(a){g.images[c]=a;h++;6===h&&(g.needsUpdate=!0,b&&b(g))},void 0,d)}var g=new THREE.CubeTexture([]),f=new THREE.ImageLoader;f.setCrossOrigin(this.crossOrigin);f.setPath(this.path);var h=0;for(c=0;c<a.length;++c)e(c);return g},setCrossOrigin:function(a){this.crossOrigin=a},setPath:function(a){this.path=a}};
|