|
@@ -194,7 +194,7 @@ void 0!==e.duration&&(g.duration=e.duration),void 0!==e.time&&(g.time=e.time),vo
|
|
|
g.castShadow=e.castShadow,g.receiveShadow=e.receiveShadow,a.add(g),M.objects[c]=g}else"DirectionalLight"===e.type||"PointLight"===e.type||"AmbientLight"===e.type?(R=void 0!==e.color?e.color:16777215,P=void 0!==e.intensity?e.intensity:1,"DirectionalLight"===e.type?(u=e.direction,G=new THREE.DirectionalLight(R,P),G.position.set(u[0],u[1],u[2]),G.position.normalize()):"PointLight"===e.type?(u=e.position,z=e.distance,G=new THREE.PointLight(R,P,z),G.position.set(u[0],u[1],u[2])):"AmbientLight"===e.type&&
|
|
|
(G=new THREE.AmbientLight(R)),a.add(G),G.name=c,M.lights[c]=G,M.objects[c]=G):"PerspectiveCamera"===e.type||"OrthographicCamera"===e.type?("PerspectiveCamera"===e.type?I=new THREE.PerspectiveCamera(e.fov,e.aspect,e.near,e.far):"OrthographicCamera"===e.type&&(I=new THREE.OrthographicCamera(v.left,v.right,v.top,v.bottom,v.near,v.far)),u=e.position,x=e.target,F=e.up,I.position.set(u[0],u[1],u[2]),I.target=new THREE.Vector3(x[0],x[1],x[2]),F&&I.up.set(F[0],F[1],F[2]),a.add(I),I.name=c,M.cameras[c]=I,
|
|
|
M.objects[c]=I):(u=e.position,t=e.rotation,E=e.quaternion,A=e.scale,E=0,g=new THREE.Object3D,g.name=c,g.position.set(u[0],u[1],u[2]),E?(g.quaternion.set(E[0],E[1],E[2],E[3]),g.useQuaternion=!0):g.rotation.set(t[0],t[1],t[2]),g.scale.set(A[0],A[1],A[2]),g.visible=void 0!==e.visible?e.visible:!1,a.add(g),M.objects[c]=g,M.empties[c]=g);if(g){if(void 0!==e.properties)for(var n in e.properties)g.properties[n]=e.properties[n];void 0!==e.children&&f(g,e.children)}}}function g(a){return function(b){M.geometries[a]=
|
|
|
-b;e();Q-=1;m.onLoadComplete();j()}}function h(a,b,c,d){return function(f){var g;f.content?g=f.content:f.dae&&(g=f.scene);f=g;g=d.position;var h=d.rotation,i=d.quaternion,l=d.scale;f.position.set(g[0],g[1],g[2]);i?(f.quaternion.set(i[0],i[1],i[2],i[3]),f.useQuaternion=!0):f.rotation.set(h[0],h[1],h[2]);f.scale.set(l[0],l[1],l[2]);c&&f.traverse(function(a){a.material=c});b.add(f);M.objects[a]=f;e();Q-=1;m.onLoadComplete();j()}}function i(a){return function(b){M.geometries[a]=b}}function j(){m.callbackProgress({totalModels:oa,
|
|
|
+b;e();Q-=1;m.onLoadComplete();j()}}function h(a,b,c,d){return function(f){var f=f.content?f.content:f.dae?f.scene:f,g=d.position,h=d.rotation,i=d.quaternion,l=d.scale;f.position.set(g[0],g[1],g[2]);i?(f.quaternion.set(i[0],i[1],i[2],i[3]),f.useQuaternion=!0):f.rotation.set(h[0],h[1],h[2]);f.scale.set(l[0],l[1],l[2]);c&&f.traverse(function(a){a.material=c});b.add(f);M.objects[a]=f;e();Q-=1;m.onLoadComplete();j()}}function i(a){return function(b){M.geometries[a]=b}}function j(){m.callbackProgress({totalModels:oa,
|
|
|
totalTextures:N,loadedModels:oa-Q,loadedTextures:N-Y},M);m.onLoadProgress();0===Q&&0===Y&&b(M)}var m=this,n=THREE.Loader.prototype.extractUrlBase(c),l,p,o,q,r,s,z,u,t,E,A,v,x,B,F,H,J,I,L,C,G,R,P,Q,Y,oa,N,M,da=a,S;for(S in this.geometryHandlerMap)a=this.geometryHandlerMap[S].loaderClass,this.geometryHandlerMap[S].loaderObject=new a;for(S in this.hierarchyHandlerMap)a=this.hierarchyHandlerMap[S].loaderClass,this.hierarchyHandlerMap[S].loaderObject=new a;Y=Q=0;M={scene:new THREE.Scene,geometries:{},
|
|
|
materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(da.transform&&(S=da.transform.position,a=da.transform.rotation,c=da.transform.scale,S&&M.scene.position.set(S[0],S[1],S[2]),a&&M.scene.rotation.set(a[0],a[1],a[2]),c&&M.scene.scale.set(c[0],c[1],c[2]),S||a||c))M.scene.updateMatrix(),M.scene.updateMatrixWorld();S=function(a){return function(){Y-=a;j();m.onLoadComplete()}};for(o in da.fogs)a=da.fogs[o],"linear"===a.type?L=new THREE.Fog(0,a.near,a.far):"exp2"===a.type&&(L=
|
|
|
new THREE.FogExp2(0,a.density)),v=a.color,L.color.setRGB(v[0],v[1],v[2]),M.fogs[o]=L;for(l in da.geometries)r=da.geometries[l],r.type in this.geometryHandlerMap&&(Q+=1,m.onLoadStart());for(var K in da.objects)o=da.objects[K],o.type&&o.type in this.hierarchyHandlerMap&&(Q+=1,m.onLoadStart());oa=Q;for(l in da.geometries)if(r=da.geometries[l],"cube"===r.type)H=new THREE.CubeGeometry(r.width,r.height,r.depth,r.widthSegments,r.heightSegments,r.depthSegments,null,r.flipped,r.sides),M.geometries[l]=H;else if("plane"===
|