|
@@ -231,8 +231,8 @@ e=0,f=a.length;e<f;e++){var h,g=a[e];switch(g.type){case "PlaneGeometry":h=new T
|
|
new THREE.SphereGeometry(g.radius,g.widthSegments,g.heightSegments,g.phiStart,g.phiLength,g.thetaStart,g.thetaLength);break;case "IcosahedronGeometry":h=new THREE.IcosahedronGeometry(g.radius,g.detail);break;case "TorusGeometry":h=new THREE.TorusGeometry(g.radius,g.tube,g.radialSegments,g.tubularSegments,g.arc);break;case "TorusKnotGeometry":h=new THREE.TorusKnotGeometry(g.radius,g.tube,g.radialSegments,g.tubularSegments,g.p,g.q,g.heightScale);break;case "BufferGeometry":h=d.parse(g.data);break;case "Geometry":h=
|
|
new THREE.SphereGeometry(g.radius,g.widthSegments,g.heightSegments,g.phiStart,g.phiLength,g.thetaStart,g.thetaLength);break;case "IcosahedronGeometry":h=new THREE.IcosahedronGeometry(g.radius,g.detail);break;case "TorusGeometry":h=new THREE.TorusGeometry(g.radius,g.tube,g.radialSegments,g.tubularSegments,g.arc);break;case "TorusKnotGeometry":h=new THREE.TorusKnotGeometry(g.radius,g.tube,g.radialSegments,g.tubularSegments,g.p,g.q,g.heightScale);break;case "BufferGeometry":h=d.parse(g.data);break;case "Geometry":h=
|
|
c.parse(g.data).geometry}h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);b[g.uuid]=h}return b},parseMaterials:function(a){var b={};if(void 0!==a)for(var c=new THREE.MaterialLoader,d=0,e=a.length;d<e;d++){var f=a[d],h=c.parse(f);h.uuid=f.uuid;void 0!==f.name&&(h.name=f.name);b[f.uuid]=h}return b},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;switch(b.type){case "Scene":e=new THREE.Scene;break;case "PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,
|
|
c.parse(g.data).geometry}h.uuid=g.uuid;void 0!==g.name&&(h.name=g.name);b[g.uuid]=h}return b},parseMaterials:function(a){var b={};if(void 0!==a)for(var c=new THREE.MaterialLoader,d=0,e=a.length;d<e;d++){var f=a[d],h=c.parse(f);h.uuid=f.uuid;void 0!==f.name&&(h.name=f.name);b[f.uuid]=h}return b},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;switch(b.type){case "Scene":e=new THREE.Scene;break;case "PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,
|
|
b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,
|
|
b.far);break;case "OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case "AmbientLight":e=new THREE.AmbientLight(b.color);break;case "DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case "PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance);break;case "SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent);break;case "HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,
|
|
-b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);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);if(void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
|
|
|
|
|
|
+b.intensity);break;case "Mesh":e=c[b.geometry];var f=d[b.material];void 0===e&&console.error("THREE.ObjectLoader: Undefined geometry "+b.geometry);void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Mesh(e,f);break;case "Sprite":f=d[b.material];void 0===f&&console.error("THREE.ObjectLoader: Undefined material "+b.material);e=new THREE.Sprite(f);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);if(void 0!==b.children)for(var h in b.children)e.add(this.parseObject(b.children[h],c,d));return e}}()};THREE.SceneLoader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};this.callbackSync=function(){};this.callbackProgress=function(){};this.geometryHandlers={};this.hierarchyHandlers={};this.addGeometryHandler("ascii",THREE.JSONLoader)};
|
|
THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(y.scene,
|
|
THREE.SceneLoader.prototype={constructor:THREE.SceneLoader,load:function(a,b){var c=this,d=new THREE.XHRLoader(c.manager);d.setCrossOrigin(this.crossOrigin);d.load(a,function(d){c.parse(JSON.parse(d),b,a)})},setCrossOrigin:function(a){this.crossOrigin=a},addGeometryHandler:function(a,b){this.geometryHandlers[a]={loaderClass:b}},addHierarchyHandler:function(a,b){this.hierarchyHandlers[a]={loaderClass:b}},parse:function(a,b,c){function d(a,b){return"relativeToHTML"==b?a:n+"/"+a}function e(){f(y.scene,
|
|
x.objects)}function f(a,b){var c,e,h,i,k,m;for(m in b){var n=y.objects[m],p=b[m];if(void 0===n){if(p.type&&p.type in l.hierarchyHandlers){if(void 0===p.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var t={},v;for(v in p)v in c||(t[v]=p[v]);r=y.materials[p.material];p.loading=!0;c=l.hierarchyHandlers[p.type].loaderObject;c.options?c.load(d(p.url,x.urlBaseType),g(m,a,r,p)):c.load(d(p.url,x.urlBaseType),g(m,
|
|
x.objects)}function f(a,b){var c,e,h,i,k,m;for(m in b){var n=y.objects[m],p=b[m];if(void 0===n){if(p.type&&p.type in l.hierarchyHandlers){if(void 0===p.loading){c={type:1,url:1,material:1,position:1,rotation:1,scale:1,visible:1,children:1,userData:1,skin:1,morph:1,mirroredLoop:1,duration:1};var t={},v;for(v in p)v in c||(t[v]=p[v]);r=y.materials[p.material];p.loading=!0;c=l.hierarchyHandlers[p.type].loaderObject;c.options?c.load(d(p.url,x.urlBaseType),g(m,a,r,p)):c.load(d(p.url,x.urlBaseType),g(m,
|
|
a,r,p),t)}}else if(void 0!==p.geometry){if(s=y.geometries[p.geometry]){n=!1;r=y.materials[p.material];n=r instanceof THREE.ShaderMaterial;e=p.position;h=p.rotation;i=p.scale;c=p.matrix;k=p.quaternion;p.material||(r=new THREE.MeshFaceMaterial(y.face_materials[p.geometry]));r instanceof THREE.MeshFaceMaterial&&0===r.materials.length&&(r=new THREE.MeshFaceMaterial(y.face_materials[p.geometry]));if(r instanceof THREE.MeshFaceMaterial)for(t=0;t<r.materials.length;t++)n=n||r.materials[t]instanceof THREE.ShaderMaterial;
|
|
a,r,p),t)}}else if(void 0!==p.geometry){if(s=y.geometries[p.geometry]){n=!1;r=y.materials[p.material];n=r instanceof THREE.ShaderMaterial;e=p.position;h=p.rotation;i=p.scale;c=p.matrix;k=p.quaternion;p.material||(r=new THREE.MeshFaceMaterial(y.face_materials[p.geometry]));r instanceof THREE.MeshFaceMaterial&&0===r.materials.length&&(r=new THREE.MeshFaceMaterial(y.face_materials[p.geometry]));if(r instanceof THREE.MeshFaceMaterial)for(t=0;t<r.materials.length;t++)n=n||r.materials[t]instanceof THREE.ShaderMaterial;
|
|
@@ -273,7 +273,7 @@ a.specularMap=this.specularMap;a.envMap=this.envMap;a.combine=this.combine;a.ref
|
|
THREE.ParticleSystemMaterial.prototype.clone=function(){var a=new THREE.ParticleSystemMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleBasicMaterial=THREE.ParticleSystemMaterial;THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.defines={};this.attributes=null;this.shading=THREE.SmoothShading;this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName="position";this.setValues(a)};
|
|
THREE.ParticleSystemMaterial.prototype.clone=function(){var a=new THREE.ParticleSystemMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.size=this.size;a.sizeAttenuation=this.sizeAttenuation;a.vertexColors=this.vertexColors;a.fog=this.fog;return a};THREE.ParticleBasicMaterial=THREE.ParticleSystemMaterial;THREE.ShaderMaterial=function(a){THREE.Material.call(this);this.vertexShader=this.fragmentShader="void main() {}";this.uniforms={};this.defines={};this.attributes=null;this.shading=THREE.SmoothShading;this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName="position";this.setValues(a)};
|
|
THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
THREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;THREE.Material.prototype.clone.call(this,a);a.fragmentShader=this.fragmentShader;a.vertexShader=this.vertexShader;a.uniforms=THREE.UniformsUtils.clone(this.uniforms);a.attributes=this.attributes;a.defines=this.defines;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.fog=this.fog;a.lights=this.lights;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=
|
|
THREE.ShaderMaterial.prototype.clone=function(){var a=new THREE.ShaderMaterial;THREE.Material.prototype.clone.call(this,a);a.fragmentShader=this.fragmentShader;a.vertexShader=this.vertexShader;a.uniforms=THREE.UniformsUtils.clone(this.uniforms);a.attributes=this.attributes;a.defines=this.defines;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.fog=this.fog;a.lights=this.lights;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=
|
|
-this.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.SpriteMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=new THREE.Texture;this.sizeAttenuation=this.depthTest=!0;this.rotation=0;this.fog=!1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1);this.setValues(a)};THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
|
|
|
|
+this.morphTargets;a.morphNormals=this.morphNormals;return a};THREE.SpriteMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.map=null;this.sizeAttenuation=this.depthTest=!0;this.rotation=0;this.fog=!1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1);this.setValues(a)};THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);
|
|
THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.rotation=this.rotation;a.uvOffset.copy(this.uvOffset);a.uvScale.copy(this.uvScale);a.fog=this.fog;return a};THREE.SpriteCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setValues(a)};THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteCanvasMaterial.prototype.clone=function(){var a=new THREE.SpriteCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};THREE.ParticleCanvasMaterial=THREE.SpriteCanvasMaterial;THREE.Texture=function(a,b,c,d,e,f,h,g,i){this.id=THREE.TextureIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.image=a;this.mipmaps=[];this.mapping=void 0!==b?b:new THREE.UVMapping;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==i?i:1;this.format=void 0!==h?h:THREE.RGBAFormat;this.type=void 0!==g?g:THREE.UnsignedByteType;
|
|
THREE.SpriteMaterial.prototype.clone=function(){var a=new THREE.SpriteMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.rotation=this.rotation;a.uvOffset.copy(this.uvOffset);a.uvScale.copy(this.uvScale);a.fog=this.fog;return a};THREE.SpriteCanvasMaterial=function(a){THREE.Material.call(this);this.color=new THREE.Color(16777215);this.program=function(){};this.setValues(a)};THREE.SpriteCanvasMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteCanvasMaterial.prototype.clone=function(){var a=new THREE.SpriteCanvasMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.program=this.program;return a};THREE.ParticleCanvasMaterial=THREE.SpriteCanvasMaterial;THREE.Texture=function(a,b,c,d,e,f,h,g,i){this.id=THREE.TextureIdCount++;this.uuid=THREE.Math.generateUUID();this.name="";this.image=a;this.mipmaps=[];this.mapping=void 0!==b?b:new THREE.UVMapping;this.wrapS=void 0!==c?c:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==d?d:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==e?e:THREE.LinearFilter;this.minFilter=void 0!==f?f:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==i?i:1;this.format=void 0!==h?h:THREE.RGBAFormat;this.type=void 0!==g?g: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};
|
|
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.prototype={constructor:THREE.Texture,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=
|
|
THREE.Texture.prototype={constructor:THREE.Texture,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=
|
|
@@ -307,17 +307,17 @@ void 0!==F.mozDash?function(a){F.mozDash=null!==a[0]?a:null}:function(){});this.
|
|
G.width=y;G.height=D;1!==this.devicePixelRatio&&!1!==c&&(G.style.width=a+"px",G.style.height=b+"px");va.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J));la.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J));z=1;I=0;na=ia=S=N=A=null};this.setClearColor=function(a,b){B.set(a);M=void 0!==b?b:1;la.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,
|
|
G.width=y;G.height=D;1!==this.devicePixelRatio&&!1!==c&&(G.style.width=a+"px",G.style.height=b+"px");va.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J));la.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J));z=1;I=0;na=ia=S=N=A=null};this.setClearColor=function(a,b){B.set(a);M=void 0!==b?b:1;la.set(new THREE.Vector2(-x,-J),new THREE.Vector2(x,J))};this.setClearColorHex=function(a,b){console.warn("DEPRECATED: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,
|
|
b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){F.setTransform(1,0,0,-1,x,J);!1===la.empty()&&(la.intersect(va),la.expandByScalar(2),1>M&&F.clearRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0),0<M&&(k(THREE.NormalBlending),i(1),r("rgba("+Math.floor(255*B.r)+","+Math.floor(255*B.g)+","+Math.floor(255*B.b)+","+M+")"),F.fillRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0)),la.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
b)};this.getMaxAnisotropy=function(){return 0};this.clear=function(){F.setTransform(1,0,0,-1,x,J);!1===la.empty()&&(la.intersect(va),la.expandByScalar(2),1>M&&F.clearRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0),0<M&&(k(THREE.NormalBlending),i(1),r("rgba("+Math.floor(255*B.r)+","+Math.floor(255*B.g)+","+Math.floor(255*B.b)+","+M+")"),F.fillRect(la.min.x|0,la.min.y|0,la.max.x-la.min.x|0,la.max.y-la.min.y|0)),la.makeEmpty())};this.render=function(a,j){if(!1===j instanceof THREE.Camera)console.error("THREE.CanvasRenderer.render: camera is not an instance of THREE.Camera.");
|
|
else{!0===this.autoClear&&this.clear();F.setTransform(1,0,0,-1,x,J);t.info.render.vertices=0;t.info.render.faces=0;u=E.projectScene(a,j,this.sortObjects,this.sortElements);v=u.elements;w=u.lights;Q=j;gb.setRGB(0,0,0);ra.setRGB(0,0,0);ea.setRGB(0,0,0);for(var y=0,G=w.length;y<G;y++){var B=w[y],D=B.color;B instanceof THREE.AmbientLight?gb.add(D):B instanceof THREE.DirectionalLight?ra.add(D):B instanceof THREE.PointLight&&ea.add(D)}y=0;for(G=v.length;y<G;y++){var A=v[y],z=A.material;if(!(void 0===z||
|
|
else{!0===this.autoClear&&this.clear();F.setTransform(1,0,0,-1,x,J);t.info.render.vertices=0;t.info.render.faces=0;u=E.projectScene(a,j,this.sortObjects,this.sortElements);v=u.elements;w=u.lights;Q=j;gb.setRGB(0,0,0);ra.setRGB(0,0,0);ea.setRGB(0,0,0);for(var y=0,G=w.length;y<G;y++){var B=w[y],D=B.color;B instanceof THREE.AmbientLight?gb.add(D):B instanceof THREE.DirectionalLight?ra.add(D):B instanceof THREE.PointLight&&ea.add(D)}y=0;for(G=v.length;y<G;y++){var A=v[y],z=A.material;if(!(void 0===z||
|
|
-!1===z.visible)){Ea.makeEmpty();if(A instanceof THREE.RenderableSprite){R=A;R.x*=x;R.y*=J;var B=R,D=A,I=z;i(I.opacity);k(I.blending);A=D.scale.x*x;z=D.scale.y*J;Ea.min.set(B.x-0.5*A,B.y-0.5*z);Ea.max.set(B.x+0.5*A,B.y+0.5*z);!1===va.isIntersectionBox(Ea)?Ea.makeEmpty():I instanceof THREE.SpriteMaterial||I instanceof THREE.ParticleSystemMaterial?(void 0!==I.map.image?(D=I.map.image,F.save(),F.translate(B.x,B.y),F.rotate(-I.rotation),F.scale(A,-z),F.drawImage(D,0,0,D.width,D.height,-0.5,-0.5,1,1)):
|
|
|
|
-(r(I.color.getStyle()),F.save(),F.translate(B.x,B.y),F.rotate(-D.rotation),F.scale(A,z),F.fillRect(-0.5,-0.5,1,1)),F.restore()):I instanceof THREE.SpriteCanvasMaterial&&(s(I.color.getStyle()),r(I.color.getStyle()),F.save(),F.translate(B.x,B.y),F.rotate(-D.rotation),F.scale(A,z),I.program(F),F.restore())}else if(A instanceof THREE.RenderableLine){if(R=A.v1,K=A.v2,R.positionScreen.x*=x,R.positionScreen.y*=J,K.positionScreen.x*=x,K.positionScreen.y*=J,Ea.setFromPoints([R.positionScreen,K.positionScreen]),
|
|
|
|
-!0===va.isIntersectionBox(Ea))if(B=R,D=K,I=A,A=z,i(A.opacity),k(A.blending),F.beginPath(),F.moveTo(B.positionScreen.x,B.positionScreen.y),F.lineTo(D.positionScreen.x,D.positionScreen.y),A instanceof THREE.LineBasicMaterial){m(A.linewidth);l(A.linecap);n(A.linejoin);if(A.vertexColors!==THREE.VertexColors)s(A.color.getStyle());else if(z=I.vertexColors[0].getStyle(),I=I.vertexColors[1].getStyle(),z===I)s(z);else{try{var M=F.createLinearGradient(B.positionScreen.x,B.positionScreen.y,D.positionScreen.x,
|
|
|
|
-D.positionScreen.y);M.addColorStop(0,z);M.addColorStop(1,I)}catch(C){M=z}s(M)}F.stroke();Ea.expandByScalar(2*A.linewidth)}else A instanceof THREE.LineDashedMaterial&&(m(A.linewidth),l(A.linecap),n(A.linejoin),s(A.color.getStyle()),q(A.dashSize,A.gapSize),F.stroke(),Ea.expandByScalar(2*A.linewidth),q(null,null))}else if(A instanceof THREE.RenderableFace3){R=A.v1;K=A.v2;ca=A.v3;if(-1>R.positionScreen.z||1<R.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>ca.positionScreen.z||
|
|
|
|
-1<ca.positionScreen.z)continue;R.positionScreen.x*=x;R.positionScreen.y*=J;K.positionScreen.x*=x;K.positionScreen.y*=J;ca.positionScreen.x*=x;ca.positionScreen.y*=J;0<z.overdraw&&(g(R.positionScreen,K.positionScreen,z.overdraw),g(K.positionScreen,ca.positionScreen,z.overdraw),g(ca.positionScreen,R.positionScreen,z.overdraw));Ea.setFromPoints([R.positionScreen,K.positionScreen,ca.positionScreen]);if(!0===va.isIntersectionBox(Ea)){B=R;D=K;I=ca;t.info.render.vertices+=3;t.info.render.faces++;i(z.opacity);
|
|
|
|
-k(z.blending);wa=B.positionScreen.x;Ba=B.positionScreen.y;P=D.positionScreen.x;Aa=D.positionScreen.y;Z=I.positionScreen.x;da=I.positionScreen.y;var S=wa,N=Ba,ia=P,ka=Aa,na=Z,pa=da;F.beginPath();F.moveTo(S,N);F.lineTo(ia,ka);F.lineTo(na,pa);F.closePath();(z instanceof THREE.MeshLambertMaterial||z instanceof THREE.MeshPhongMaterial)&&null===z.map?(sa.copy(z.color),ga.copy(z.emissive),z.vertexColors===THREE.FaceColors&&sa.multiply(A.color),!1===z.wireframe&&z.shading==THREE.SmoothShading&&3==A.vertexNormalsLength?
|
|
|
|
-(ba.copy(gb),$.copy(gb),V.copy(gb),b(A.v1.positionWorld,A.vertexNormalsModel[0],ba),b(A.v2.positionWorld,A.vertexNormalsModel[1],$),b(A.v3.positionWorld,A.vertexNormalsModel[2],V),ba.multiply(sa).add(ga),$.multiply(sa).add(ga),V.multiply(sa).add(ga),ja.addColors($,V).multiplyScalar(0.5),Qa=h(ba,$,V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)):(O.copy(gb),b(A.centroidModel,A.normalModel,O),O.multiply(sa).add(ga),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O))):z instanceof
|
|
|
|
-THREE.MeshBasicMaterial||z instanceof THREE.MeshLambertMaterial||z instanceof THREE.MeshPhongMaterial?null!==z.map?z.map.mapping instanceof THREE.UVMapping&&(xa=A.uvs[0],e(wa,Ba,P,Aa,Z,da,xa[0].x,xa[0].y,xa[1].x,xa[1].y,xa[2].x,xa[2].y,z.map)):null!==z.envMap?z.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ta.copy(A.vertexNormalsModelView[0]),bb=0.5*ta.x+0.5,cb=0.5*ta.y+0.5,ta.copy(A.vertexNormalsModelView[1]),Ma=0.5*ta.x+0.5,fb=0.5*ta.y+0.5,ta.copy(A.vertexNormalsModelView[2]),sb=
|
|
|
|
-0.5*ta.x+0.5,pb=0.5*ta.y+0.5,e(wa,Ba,P,Aa,Z,da,bb,cb,Ma,fb,sb,pb,z.envMap)):(O.copy(z.color),z.vertexColors===THREE.FaceColors&&O.multiply(A.color),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O)):z instanceof THREE.MeshDepthMaterial?(Da=Q.near,Ua=Q.far,ba.r=ba.g=ba.b=1-p(B.positionScreen.z*B.positionScreen.w,Da,Ua),$.r=$.g=$.b=1-p(D.positionScreen.z*D.positionScreen.w,Da,Ua),V.r=V.g=V.b=1-p(I.positionScreen.z*I.positionScreen.w,Da,Ua),ja.addColors($,V).multiplyScalar(0.5),
|
|
|
|
-Qa=h(ba,$,V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)):z instanceof THREE.MeshNormalMaterial&&(B=void 0,z.shading==THREE.FlatShading?(B=A.normalModelView,O.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O)):z.shading==THREE.SmoothShading&&(B=A.vertexNormalsModelView[0],ba.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=A.vertexNormalsModelView[1],$.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),
|
|
|
|
-B=A.vertexNormalsModelView[2],V.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),ja.addColors($,V).multiplyScalar(0.5),Qa=h(ba,$,V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)))}}la.union(Ea)}}F.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
|
|
|
|
+!1===z.visible)){Ea.makeEmpty();if(A instanceof THREE.RenderableSprite){R=A;R.x*=x;R.y*=J;var B=R,D=A,I=z;i(I.opacity);k(I.blending);A=D.scale.x*x;z=D.scale.y*J;Ea.min.set(B.x-0.5*A,B.y-0.5*z);Ea.max.set(B.x+0.5*A,B.y+0.5*z);!1===va.isIntersectionBox(Ea)?Ea.makeEmpty():I instanceof THREE.SpriteMaterial||I instanceof THREE.ParticleSystemMaterial?(null!==I.map?(D=I.map.image,F.save(),F.translate(B.x,B.y),F.rotate(-I.rotation),F.scale(A,-z),F.drawImage(D,0,0,D.width,D.height,-0.5,-0.5,1,1)):(r(I.color.getStyle()),
|
|
|
|
+F.save(),F.translate(B.x,B.y),F.rotate(-D.rotation),F.scale(A,z),F.fillRect(-0.5,-0.5,1,1)),F.restore()):I instanceof THREE.SpriteCanvasMaterial&&(s(I.color.getStyle()),r(I.color.getStyle()),F.save(),F.translate(B.x,B.y),F.rotate(-D.rotation),F.scale(A,z),I.program(F),F.restore())}else if(A instanceof THREE.RenderableLine){if(R=A.v1,K=A.v2,R.positionScreen.x*=x,R.positionScreen.y*=J,K.positionScreen.x*=x,K.positionScreen.y*=J,Ea.setFromPoints([R.positionScreen,K.positionScreen]),!0===va.isIntersectionBox(Ea))if(B=
|
|
|
|
+R,D=K,I=A,A=z,i(A.opacity),k(A.blending),F.beginPath(),F.moveTo(B.positionScreen.x,B.positionScreen.y),F.lineTo(D.positionScreen.x,D.positionScreen.y),A instanceof THREE.LineBasicMaterial){m(A.linewidth);l(A.linecap);n(A.linejoin);if(A.vertexColors!==THREE.VertexColors)s(A.color.getStyle());else if(z=I.vertexColors[0].getStyle(),I=I.vertexColors[1].getStyle(),z===I)s(z);else{try{var M=F.createLinearGradient(B.positionScreen.x,B.positionScreen.y,D.positionScreen.x,D.positionScreen.y);M.addColorStop(0,
|
|
|
|
+z);M.addColorStop(1,I)}catch(C){M=z}s(M)}F.stroke();Ea.expandByScalar(2*A.linewidth)}else A instanceof THREE.LineDashedMaterial&&(m(A.linewidth),l(A.linecap),n(A.linejoin),s(A.color.getStyle()),q(A.dashSize,A.gapSize),F.stroke(),Ea.expandByScalar(2*A.linewidth),q(null,null))}else if(A instanceof THREE.RenderableFace3){R=A.v1;K=A.v2;ca=A.v3;if(-1>R.positionScreen.z||1<R.positionScreen.z)continue;if(-1>K.positionScreen.z||1<K.positionScreen.z)continue;if(-1>ca.positionScreen.z||1<ca.positionScreen.z)continue;
|
|
|
|
+R.positionScreen.x*=x;R.positionScreen.y*=J;K.positionScreen.x*=x;K.positionScreen.y*=J;ca.positionScreen.x*=x;ca.positionScreen.y*=J;0<z.overdraw&&(g(R.positionScreen,K.positionScreen,z.overdraw),g(K.positionScreen,ca.positionScreen,z.overdraw),g(ca.positionScreen,R.positionScreen,z.overdraw));Ea.setFromPoints([R.positionScreen,K.positionScreen,ca.positionScreen]);if(!0===va.isIntersectionBox(Ea)){B=R;D=K;I=ca;t.info.render.vertices+=3;t.info.render.faces++;i(z.opacity);k(z.blending);wa=B.positionScreen.x;
|
|
|
|
+Ba=B.positionScreen.y;P=D.positionScreen.x;Aa=D.positionScreen.y;Z=I.positionScreen.x;da=I.positionScreen.y;var S=wa,N=Ba,ia=P,ka=Aa,na=Z,pa=da;F.beginPath();F.moveTo(S,N);F.lineTo(ia,ka);F.lineTo(na,pa);F.closePath();(z instanceof THREE.MeshLambertMaterial||z instanceof THREE.MeshPhongMaterial)&&null===z.map?(sa.copy(z.color),ga.copy(z.emissive),z.vertexColors===THREE.FaceColors&&sa.multiply(A.color),!1===z.wireframe&&z.shading==THREE.SmoothShading&&3==A.vertexNormalsLength?(ba.copy(gb),$.copy(gb),
|
|
|
|
+V.copy(gb),b(A.v1.positionWorld,A.vertexNormalsModel[0],ba),b(A.v2.positionWorld,A.vertexNormalsModel[1],$),b(A.v3.positionWorld,A.vertexNormalsModel[2],V),ba.multiply(sa).add(ga),$.multiply(sa).add(ga),V.multiply(sa).add(ga),ja.addColors($,V).multiplyScalar(0.5),Qa=h(ba,$,V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)):(O.copy(gb),b(A.centroidModel,A.normalModel,O),O.multiply(sa).add(ga),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O))):z instanceof THREE.MeshBasicMaterial||
|
|
|
|
+z instanceof THREE.MeshLambertMaterial||z instanceof THREE.MeshPhongMaterial?null!==z.map?z.map.mapping instanceof THREE.UVMapping&&(xa=A.uvs[0],e(wa,Ba,P,Aa,Z,da,xa[0].x,xa[0].y,xa[1].x,xa[1].y,xa[2].x,xa[2].y,z.map)):null!==z.envMap?z.envMap.mapping instanceof THREE.SphericalReflectionMapping&&(ta.copy(A.vertexNormalsModelView[0]),bb=0.5*ta.x+0.5,cb=0.5*ta.y+0.5,ta.copy(A.vertexNormalsModelView[1]),Ma=0.5*ta.x+0.5,fb=0.5*ta.y+0.5,ta.copy(A.vertexNormalsModelView[2]),sb=0.5*ta.x+0.5,pb=0.5*ta.y+
|
|
|
|
+0.5,e(wa,Ba,P,Aa,Z,da,bb,cb,Ma,fb,sb,pb,z.envMap)):(O.copy(z.color),z.vertexColors===THREE.FaceColors&&O.multiply(A.color),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O)):z instanceof THREE.MeshDepthMaterial?(Da=Q.near,Ua=Q.far,ba.r=ba.g=ba.b=1-p(B.positionScreen.z*B.positionScreen.w,Da,Ua),$.r=$.g=$.b=1-p(D.positionScreen.z*D.positionScreen.w,Da,Ua),V.r=V.g=V.b=1-p(I.positionScreen.z*I.positionScreen.w,Da,Ua),ja.addColors($,V).multiplyScalar(0.5),Qa=h(ba,$,
|
|
|
|
+V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)):z instanceof THREE.MeshNormalMaterial&&(B=void 0,z.shading==THREE.FlatShading?(B=A.normalModelView,O.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),!0===z.wireframe?c(O,z.wireframeLinewidth,z.wireframeLinecap,z.wireframeLinejoin):d(O)):z.shading==THREE.SmoothShading&&(B=A.vertexNormalsModelView[0],ba.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=A.vertexNormalsModelView[1],$.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),B=A.vertexNormalsModelView[2],
|
|
|
|
+V.setRGB(B.x,B.y,B.z).multiplyScalar(0.5).addScalar(0.5),ja.addColors($,V).multiplyScalar(0.5),Qa=h(ba,$,V,ja),f(wa,Ba,P,Aa,Z,da,0,0,1,0,0,1,Qa)))}}la.union(Ea)}}F.setTransform(1,0,0,1,0,0)}}};THREE.ShaderChunk={fog_pars_fragment:"#ifdef USE_FOG\nuniform vec3 fogColor;\n#ifdef FOG_EXP2\nuniform float fogDensity;\n#else\nuniform float fogNear;\nuniform float fogFar;\n#endif\n#endif",fog_fragment:"#ifdef USE_FOG\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n#ifdef FOG_EXP2\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_fragment:"#ifdef USE_ENVMAP\nuniform float reflectivity;\nuniform samplerCube envMap;\nuniform float flipEnvMap;\nuniform int combine;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nuniform bool useRefract;\nuniform float refractionRatio;\n#else\nvarying vec3 vReflect;\n#endif\n#endif",envmap_fragment:"#ifdef USE_ENVMAP\nvec3 reflectVec;\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\nif ( useRefract ) {\nreflectVec = refract( cameraToVertex, normal, refractionRatio );\n} else { \nreflectVec = reflect( cameraToVertex, normal );\n}\n#else\nreflectVec = vReflect;\n#endif\n#ifdef DOUBLE_SIDED\nfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\nvec4 cubeColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#else\nvec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n#endif\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\nif ( combine == 1 ) {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularStrength * reflectivity );\n} else if ( combine == 2 ) {\ngl_FragColor.xyz += cubeColor.xyz * specularStrength * reflectivity;\n} else {\ngl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * cubeColor.xyz, specularStrength * reflectivity );\n}\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
envmap_pars_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvarying vec3 vReflect;\nuniform float refractionRatio;\nuniform bool useRefract;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n#ifdef USE_SKINNING\nvec4 worldPosition = modelMatrix * skinned;\n#endif\n#if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n#endif\n#if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING )\nvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n#endif\n#endif",
|
|
envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\nworldNormal = normalize( worldNormal );\nvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\nif ( useRefract ) {\nvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n} else {\nvReflect = reflect( cameraToVertex, worldNormal );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
|
|
envmap_vertex:"#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nvec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\nworldNormal = normalize( worldNormal );\nvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\nif ( useRefract ) {\nvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n} else {\nvReflect = reflect( cameraToVertex, worldNormal );\n}\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\nuniform sampler2D map;\n#endif",
|
|
@@ -643,9 +643,9 @@ THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingB
|
|
b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};
|
|
b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()};
|
|
THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);
|
|
THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);
|
|
THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,h,g,i){a.set(h,g,i);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d){h=0;for(g=d.length;h<g;h++)e.geometry.vertices[d[h]].copy(a)}}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d("c",0,0,-1);d("t",0,0,1);d("n1",-1,-1,-1);d("n2",1,-1,-1);d("n3",-1,1,-1);d("n4",1,1,-1);d("f1",-1,-1,1);d("f2",1,-1,1);d("f3",-1,1,1);d("f4",1,1,1);d("u1",
|
|
THREE.CameraHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Camera,c=new THREE.Projector;return function(){function d(d,h,g,i){a.set(h,g,i);c.unprojectVector(a,b);d=e.pointMap[d];if(void 0!==d){h=0;for(g=d.length;h<g;h++)e.geometry.vertices[d[h]].copy(a)}}var e=this;b.projectionMatrix.copy(this.camera.projectionMatrix);d("c",0,0,-1);d("t",0,0,1);d("n1",-1,-1,-1);d("n2",1,-1,-1);d("n3",-1,1,-1);d("n4",1,1,-1);d("f1",-1,-1,1);d("f2",1,-1,1);d("f3",-1,1,1);d("f4",1,1,1);d("u1",
|
|
-0.7,1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;var c=new THREE.PlaneGeometry(b,b),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Mesh(c,d);this.add(this.lightPlane);c=new THREE.Geometry;c.vertices.push(new THREE.Vector3);c.vertices.push(new THREE.Vector3);c.computeLineDistances();
|
|
|
|
-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;return function(){a.getPositionFromMatrix(this.light.matrixWorld).negate();this.lightPlane.lookAt(a);this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.targetLine.geometry.vertices[1].copy(a);this.targetLine.geometry.verticesNeedUpdate=!0;this.targetLine.material.color.copy(this.lightPlane.material.color)}}();THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var a=c||16776960,d=d||1,b=new THREE.Geometry,c=0,e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
|
|
|
+0.7,1.1,-1);d("u2",-0.7,1.1,-1);d("u3",0,2,-1);d("cf1",-1,0,1);d("cf2",1,0,1);d("cf3",0,-1,1);d("cf4",0,1,1);d("cn1",-1,0,-1);d("cn2",1,0,-1);d("cn3",0,-1,-1);d("cn4",0,1,-1);this.geometry.verticesNeedUpdate=!0}}();THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;var b=b||1,c=new THREE.PlaneGeometry(b,b),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);this.lightPlane=new THREE.Mesh(c,d);this.add(this.lightPlane);c=new THREE.Geometry;c.vertices.push(new THREE.Vector3);c.vertices.push(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.getPositionFromMatrix(this.light.matrixWorld);b.getPositionFromMatrix(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.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=b||1;for(var a=c||16776960,d=d||1,b=new THREE.Geometry,c=0,e=this.object.geometry.faces.length;c<e;c++)b.vertices.push(new THREE.Vector3),b.vertices.push(new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces);this.matrixAutoUpdate=!1;this.normalMatrix=new THREE.Matrix3;this.update()};THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype);
|
|
THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var b=this.geometry.vertices,c=this.object.geometry.faces,d=this.object.matrixWorld,e=0,f=c.length;e<f;e++){var h=c[e];a.copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var g=2*e;b[g].copy(h.centroid).applyMatrix4(d);b[g+1].addVectors(b[g],a)}this.geometry.verticesNeedUpdate=
|
|
THREE.FaceNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.object.updateMatrixWorld(!0);this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var b=this.geometry.vertices,c=this.object.geometry.faces,d=this.object.matrixWorld,e=0,f=c.length;e<f;e++){var h=c[e];a.copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size);var g=2*e;b[g].copy(h.centroid).applyMatrix4(d);b[g+1].addVectors(b[g],a)}this.geometry.verticesNeedUpdate=
|
|
!0;return this}}();THREE.GridHelper=function(a,b){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 f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);
|
|
!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 f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)};THREE.GridHelper.prototype=Object.create(THREE.Line.prototype);
|
|
THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);
|
|
THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a);this.color2.set(b);this.geometry.colorsNeedUpdate=!0};THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.light.updateMatrixWorld();this.matrixWorld=a.matrixWorld;this.matrixAutoUpdate=!1;this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(c,d);this.add(this.lightSphere);
|