From e7e47b1f889657c41f42ce65eee91e783d029aae Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Sat, 26 Feb 2011 09:18:10 +0000 Subject: [PATCH] More reformating and clean up. --- build/Three.js | 41 ++- build/custom/ThreeCanvas.js | 24 +- build/custom/ThreeDOM.js | 17 +- build/custom/ThreeSVG.js | 17 +- build/custom/ThreeWebGL.js | 26 +- examples/canvas_performance.html | 8 +- examples/canvas_sandbox.html | 9 +- examples/misc_uqbiquity_test.html | 9 +- src/core/Color.js | 22 +- src/core/Face3.js | 2 +- src/core/Face4.js | 2 +- src/core/Quaternion.js | 311 +++++++----------- src/core/Ray.js | 4 +- src/core/UV.js | 31 +- src/core/Vector2.js | 104 ++++-- src/core/Vector4.js | 131 +++++--- src/core/Vertex.js | 3 +- src/lights/AmbientLight.js | 4 + src/lights/DirectionalLight.js | 4 + src/lights/Light.js | 7 +- src/lights/PointLight.js | 4 + src/materials/Mappings.js | 14 + .../mappings/CubeReflectionMapping.js | 9 - .../mappings/CubeRefractionMapping.js | 9 - .../mappings/LatitudeReflectionMapping.js | 9 - .../mappings/LatitudeRefractionMapping.js | 9 - .../mappings/SphericalReflectionMapping.js | 9 - .../mappings/SphericalRefractionMapping.js | 9 - src/materials/mappings/UVMapping.js | 9 - src/scenes/Scene.js | 6 +- utils/build.py | 24 +- 31 files changed, 403 insertions(+), 484 deletions(-) create mode 100644 src/materials/Mappings.js delete mode 100644 src/materials/mappings/CubeReflectionMapping.js delete mode 100644 src/materials/mappings/CubeRefractionMapping.js delete mode 100644 src/materials/mappings/LatitudeReflectionMapping.js delete mode 100644 src/materials/mappings/LatitudeRefractionMapping.js delete mode 100644 src/materials/mappings/SphericalReflectionMapping.js delete mode 100644 src/materials/mappings/SphericalRefractionMapping.js delete mode 100644 src/materials/mappings/UVMapping.js diff --git a/build/Three.js b/build/Three.js index 9d210ddc..7d345c70 100755 --- a/build/Three.js +++ b/build/Three.js @@ -2,16 +2,15 @@ var THREE=THREE||{};THREE.Color=function(a){this.setHex(a)}; THREE.Color.prototype={autoUpdate:!0,setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,c){var d,f,g,h,k,j;if(c==0)d=f=g=0;else{h=Math.floor(a*6);k=a*6-h;a=c*(1-b);j=c*(1-b*k);b=c*(1-b*(1-k));switch(h){case 1:d=j;f=c;g=a;break;case 2:d=a;f=c;g=b;break;case 3:d=a;f=j;g=c;break;case 4:d=b;f=a;g=c;break;case 5:d=c;f=a;g=j;break;case 6:case 0:d=c;f=b;g=a}}this.r=d;this.g=f;this.b=g;if(this.autoUpdate){this.updateHex(); this.updateStyleString()}},setHex:function(a){this.hex=~~a&16777215;if(this.autoUpdate){this.updateRGBA();this.updateStyleString()}},updateHex:function(){this.hex=~~(this.r*255)<<16^~~(this.g*255)<<8^~~(this.b*255)},updateRGBA:function(){this.r=(this.hex>>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ -this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; +this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.set(a||0,b||0)}; +THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/ +this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a, b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/ a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a= -this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1}; -THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; -return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; -THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)}; +THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x* +a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,f=[];a=0;for(b=d.length;a0&&G>0&&e+G<1}var c,d,f,g,h,k,j,m,n,w, u,p=a.geometry,x=p.vertices,A=[];c=0;for(d=p.faces.length;c=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(f),h=Math.sqrt(1-f*f);if(Math.abs(h)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}f=Math.sin((1-d)*g)/h;d=Math.sin(d*g)/h;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}; -THREE.Vertex=function(a,b){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=b||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=!0};THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}}; -THREE.Face3=function(a,b,c,d,f){this.a=a;this.b=b;this.c=c;this.centroid=new THREE.Vector3;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.materials=f instanceof Array?f:[f]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; -THREE.Face4=function(a,b,c,d,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=g instanceof Array?g:[g]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,b){this.u=a||0;this.v=b||0}; -THREE.UV.prototype={copy:function(a){this.u=a.u;this.v=a.v},toString:function(){return"THREE.UV ("+this.u+", "+this.v+")"}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.geometryChunks={};this.hasTangents=!1}; +Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}return!0},addChild:function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a)}},removeChild:function(a){var b=this.children.indexOf(a);if(b!==-1){this.children.splice(b,1);a.parent=undefined}}};THREE.Object3DCounter={value:0};THREE.Quaternion=function(a,b,c,d){this.set(a||0,b||0,c||0,d!==undefined?d:1)}; +THREE.Quaternion.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setFromEuler:function(a){var b=0.5*Math.PI/360,c=a.x*b,d=a.y*b,f=a.z*b;a=Math.cos(d);d=Math.sin(d);b=Math.cos(-f);f=Math.sin(-f);var g=Math.cos(c);c=Math.sin(c);var h=a*b,k=d*f;this.w=h*g-k*c;this.x=h*c+k*g;this.y=d*b*g+a*f*c;this.z=a*f*g-d*b*c;return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x*=-1;this.y*= +-1;this.z*=-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a==0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x*=a;this.y*=a;this.z*=a;this.w*=a}return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,f=this.w,g=a.x,h=a.y,k=a.z;a=a.w;this.x=b*a+f*g+c*k-d*h;this.y=c*a+f*h+d*g-b*k;this.z=d*a+f*k+b*h-c*g;this.w=f*a-b*g-c*h-d*k;return this}, +multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,g=this.x,h=this.y,k=this.z,j=this.w,m=j*c+h*f-k*d,n=j*d+k*c-g*f,w=j*f+g*d-h*c;c=-g*c-h*d-k*f;b.x=m*j+c*-g+n*-k-w*-h;b.y=n*j+c*-h+w*-g-m*-k;b.z=w*j+c*-k+m*-h-n*-g;return b},slerp:function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(Math.abs(f)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(f),h=Math.sqrt(1-f*f);if(Math.abs(h)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}f=Math.sin((1- +d)*g)/h;d=Math.sin(d*g)/h;c.w=a.w*f+b.w*d;c.x=a.x*f+b.x*d;c.y=a.y*f+b.y*d;c.z=a.z*f+b.z*d;return c}};THREE.Vertex=function(a,b){this.position=a||new THREE.Vector3;this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.normal=b||new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.normalScreen=new THREE.Vector3;this.tangent=new THREE.Vector4;this.__visible=!0}; +THREE.Vertex.prototype={toString:function(){return"THREE.Vertex ( position: "+this.position+", normal: "+this.normal+" )"}};THREE.Face3=function(a,b,c,d,f){this.a=a;this.b=b;this.c=c;this.centroid=new THREE.Vector3;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.materials=f instanceof Array?f:[f]};THREE.Face3.prototype={toString:function(){return"THREE.Face3 ( "+this.a+", "+this.b+", "+this.c+" )"}}; +THREE.Face4=function(a,b,c,d,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.centroid=new THREE.Vector3;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.materials=g instanceof Array?g:[g]};THREE.Face4.prototype={toString:function(){return"THREE.Face4 ( "+this.a+", "+this.b+", "+this.c+" "+this.d+" )"}};THREE.UV=function(a,b){this.set(a||0,b||0)}; +THREE.UV.prototype={set:function(a,b){this.u=a;this.v=b;return this},copy:function(a){this.set(a.u,a.v);return this},toString:function(){return"THREE.UV ("+this.u+", "+this.v+")"}};THREE.Geometry=function(){this.id="Geometry"+THREE.GeometryIdCounter++;this.vertices=[];this.faces=[];this.uvs=[];this.uvs2=[];this.colors=[];this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.geometryChunks={};this.hasTangents=!1}; THREE.Geometry.prototype={computeCentroids:function(){var a,b,c;a=0;for(b=this.faces.length;aid: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
linewidth: "+this.linewidth+"
linecap: "+this.linecap+"
linejoin: "+this.linejoin+"
vertex_colors: "+this.vertex_colors+"
)"}}; @@ -127,10 +125,9 @@ THREE.Texture=function(a,b,c,d,f,g){this.image=a;this.mapping=b!==undefined?b:ne THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; THREE.RenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrap_s=c.wrap_s!==undefined?c.wrap_s:THREE.ClampToEdgeWrapping;this.wrap_t=c.wrap_t!==undefined?c.wrap_t:THREE.ClampToEdgeWrapping;this.mag_filter=c.mag_filter!==undefined?c.mag_filter:THREE.LinearFilter;this.min_filter=c.min_filter!==undefined?c.min_filter:THREE.LinearMipMapLinearFilter;this.format=c.format!==undefined?c.format:THREE.RGBFormat;this.type=c.type!==undefined?c.type:THREE.UnsignedByteType}; -var Uniforms={clone:function(a){var b,c,d,f={};for(b in a){f[b]={};for(c in a[b]){d=a[b][c];f[b][c]=d instanceof THREE.Color||d instanceof THREE.Vector3||d instanceof THREE.Texture?d.clone():d}}return f},merge:function(a){var b,c,d,f={};for(b=0;b>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ -this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; +this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.set(a||0,b||0)}; +THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/ +this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a, b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/ a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a= -this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1}; -THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; -return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; -THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)}; +THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x* +a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,f=[];a=0;for(b=d.length;a0&&r>0&&F+r<1}var c,d,f,e,h,j,g,i,m,n, o,q=a.geometry,s=q.vertices,t=[];c=0;for(d=q.faces.length;c-this.near)return!1;if(h+e<-this.far)return!1;h-=e;var j=this.projectionMatrix,g=1/(j.n43*h),i=g*this.screenCenterX,m=(f.n11*b+f.n12*c+f.n13*d+f.n14)*j.n11*i;e=j.n11*e*i;if(m+e<-this.screenCenterX)return!1;if(m-e>this.screenCenterX)return!1;b=(f.n21*b+f.n22*c+f.n23*d+f.n24)*j.n22*g*this.screenCenterY; if(b+e<-this.screenCenterY)return!1;if(b-e>this.screenCenterY)return!1;a.screenPosition.set(m,b,h,e);return!0};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight; THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=b||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,b){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=b||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.FlatShading=0;THREE.SmoothShading=1; -THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0}; +THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){}; THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depth_test=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertex_colors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.linewidth!==undefined)this.linewidth= a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}}; THREE.LineBasicMaterial.prototype={toString:function(){return"THREE.LineBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
linewidth: "+this.linewidth+"
linecap: "+this.linecap+"
linejoin: "+this.linejoin+"
vertex_colors: "+this.vertex_colors+"
)"}}; @@ -101,9 +100,8 @@ THREE.ParticleCircleMaterial=function(a){this.id=THREE.MaterialCounter.value++;t THREE.ParticleCircleMaterial.prototype={toString:function(){return"THREE.ParticleCircleMaterial (
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
)"}}; THREE.Texture=function(a,b,c,d,f,e){this.image=a;this.mapping=b!==undefined?b:new THREE.UVMapping;this.wrap_s=c!==undefined?c:THREE.ClampToEdgeWrapping;this.wrap_t=d!==undefined?d:THREE.ClampToEdgeWrapping;this.mag_filter=f!==undefined?f:THREE.LinearFilter;this.min_filter=e!==undefined?e:THREE.LinearMipMapLinearFilter;this.needsUpdate=!1}; THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; -THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20;THREE.CubeReflectionMapping=function(){}; -THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){};THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.matrixAutoUpdate=!1};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle; -THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=c!=undefined?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line; +THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; +THREE.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.matrixAutoUpdate=!1};THREE.Particle.prototype=new THREE.Object3D;THREE.Particle.prototype.constructor=THREE.Particle;THREE.Line=function(a,b,c){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=c!=undefined?c:THREE.LineStrip};THREE.LineStrip=0;THREE.LinePieces=1;THREE.Line.prototype=new THREE.Object3D;THREE.Line.prototype.constructor=THREE.Line; THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b&&b.length?b:[b];this.flipSided=!1;this.doubleSided=!1;this.overdraw=!1;if(this.geometry){this.geometry.boundingSphere||this.geometry.computeBoundingSphere();this.boundRadius=a.boundingSphere.radius}};THREE.Mesh.prototype=new THREE.Object3D;THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.supr=THREE.Object3D.prototype; THREE.Scene=function(){THREE.Object3D.call(this);this.objects=[];this.lights=[];this.sounds=[];this.fog=null};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.addChild=function(a){this.supr.addChild.call(this,a);this.addChildRecurse(a)}; THREE.Scene.prototype.addChildRecurse=function(a){if(a instanceof THREE.Light)this.lights.indexOf(a)===-1&&this.lights.push(a);else if(a instanceof THREE.Sound3D)this.sounds.indexOf(a)===-1&&this.sounds.push(a);else a instanceof THREE.Camera||a instanceof THREE.Bone||this.objects.indexOf(a)===-1&&this.objects.push(a);for(var b=0;b>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ -this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; +this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.set(a||0,b||0)}; +THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/ +this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a, b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,e=this.z;this.set(c*a.z-e*a.y,e*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/ a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a= -this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,e){this.x=a||0;this.y=b||0;this.z=c||0;this.w=e||1}; -THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; -return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; -THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,e){this.set(a||0,b||0,c||0,e||1)}; +THREE.Vector4.prototype={set:function(a,b,c,e){this.x=a;this.y=b;this.z=c;this.w=e;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x* +a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var b,c,e=a.objects,d=[];a=0;for(b=e.length;a0&&r>0&&G+r<1}var c,e,d,f,g,i,h,j,m,n, l,o=a.geometry,p=o.vertices,q=[];c=0;for(e=o.faces.length;c>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ -this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; +this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,b){this.set(a||0,b||0)}; +THREE.Vector2.prototype={set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/ +this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,b,c){this.set(a||0,b||0,c||0)}; THREE.Vector3.prototype={set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a, b){this.set(a.y*b.z-a.z*b.y,a.z*b.x-a.x*b.z,a.x*b.y-a.y*b.x);return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.set(c*a.z-d*a.y,d*a.x-b*a.z,b*a.y-c*a.x);return this},multiply:function(a,b){this.set(a.x*b.x,a.y*b.y,a.z*b.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/ a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a= -this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d||1}; -THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; -return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; -THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; +this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,b,c,d){this.set(a||0,b||0,c||0,d||1)}; +THREE.Vector4.prototype={set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,b){this.set(a.x+b.x,a.y+b.y,a.z+b.z,a.w+b.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,b){this.set(a.x-b.x,a.y-b.y,a.z-b.z,a.w-b.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x* +a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,b){this.set(this.x+(a.x-this.x)*b,this.y+(a.y-this.y)*b,this.z+(a.z-this.z)*b,this.w+(a.w-this.w)*b)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}};THREE.Ray=function(a,b){this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var b,c,d=a.objects,e=[];a=0;for(b=d.length;a0&&t>0&&C+t<1}var c,d,e,f,g,i,h,k,n,m, l,o=a.geometry,q=o.vertices,s=[];c=0;for(d=o.faces.length;c>16&255)/255;this.g=(this.hex>>8&255)/255;this.b=(this.hex&255)/255},updateStyleString:function(){this.__styleString="rgb("+~~(this.r*255)+","+~~(this.g*255)+","+~~(this.b*255)+")"},clone:function(){return new THREE.Color(this.hex)},toString:function(){return"THREE.Color ( r: "+ -this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,c){this.x=a||0;this.y=c||0}; -THREE.Vector2.prototype={set:function(a,c){this.x=a;this.y=c;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},unit:function(){this.multiplyScalar(1/this.length());return this},length:function(){return Math.sqrt(this.x* -this.x+this.y*this.y)},lengthSq:function(){return this.x*this.x+this.y*this.y},negate:function(){this.x=-this.x;this.y=-this.y;return this},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,c,d){this.set(a||0,c||0,d||0)}; +this.r+", g: "+this.g+", b: "+this.b+", hex: "+this.hex+" )"}};THREE.Vector2=function(a,c){this.set(a||0,c||0)}; +THREE.Vector2.prototype={set:function(a,c){this.x=a;this.y=c;return this},copy:function(a){this.set(a.x,a.y);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a);return this},negate:function(){this.set(-this.x,-this.y);return this},unit:function(){this.multiplyScalar(1/ +this.length());return this},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y},clone:function(){return new THREE.Vector2(this.x,this.y)},toString:function(){return"THREE.Vector2 ("+this.x+", "+this.y+")"}};THREE.Vector3=function(a,c,d){this.set(a||0,c||0,d||0)}; THREE.Vector3.prototype={set:function(a,c,d){this.x=a;this.y=c;this.z=d;return this},copy:function(a){this.set(a.x,a.y,a.z);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y,a.z+c.z);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z);return this},addScalar:function(a){this.set(this.x+a,this.y+a,this.z+a);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y,a.z-c.z);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z);return this},cross:function(a, c){this.set(a.y*c.z-a.z*c.y,a.z*c.x-a.x*c.z,a.x*c.y-a.y*c.x);return this},crossSelf:function(a){var c=this.x,d=this.y,f=this.z;this.set(d*a.z-f*a.y,f*a.x-c*a.z,c*a.y-d*a.x);return this},multiply:function(a,c){this.set(a.x*c.x,a.y*c.y,a.z*c.z);return this},multiplySelf:function(a){this.set(this.x*a.x,this.y*a.y,this.z*a.z);return this},multiplyScalar:function(a){this.set(this.x*a,this.y*a,this.z*a);return this},divideSelf:function(a){this.set(this.x/a.x,this.y/a.y,this.z/a.z);return this},divideScalar:function(a){this.set(this.x/ a,this.y/a,this.z/a);return this},negate:function(){this.set(-this.x,-this.y,-this.z);return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var c=this.x-a.x,d=this.y-a.y;a=this.z-a.z;return c*c+d*d+a*a},length:function(){return Math.sqrt(this.lengthSq())},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},lengthManhattan:function(){return this.x+this.y+this.z},normalize:function(){var a= -this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,c,d,f){this.x=a||0;this.y=c||0;this.z=d||0;this.w=f||1}; -THREE.Vector4.prototype={set:function(a,c,d,f){this.x=a;this.y=c;this.z=d;this.w=f;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w||1;return this},add:function(a,c){this.x=a.x+c.x;this.y=a.y+c.y;this.z=a.z+c.z;this.w=a.w+c.w;return this},addSelf:function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},sub:function(a,c){this.x=a.x-c.x;this.y=a.y-c.y;this.z=a.z-c.z;this.w=a.w-c.w;return this},subSelf:function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w; -return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},divideScalar:function(a){this.x/=a;this.y/=a;this.z/=a;this.w/=a;return this},lerpSelf:function(a,c){this.x+=(a.x-this.x)*c;this.y+=(a.y-this.y)*c;this.z+=(a.z-this.z)*c;this.w+=(a.w-this.w)*c},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}}; -THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3}; +this.length();a>0?this.multiplyScalar(1/a):this.set(0,0,0);return this},setLength:function(a){return this.normalize().multiplyScalar(a)},isZero:function(){return Math.abs(this.x)<1.0E-4&&Math.abs(this.y)<1.0E-4&&Math.abs(this.z)<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)},toString:function(){return"THREE.Vector3 ( "+this.x+", "+this.y+", "+this.z+" )"}};THREE.Vector4=function(a,c,d,f){this.set(a||0,c||0,d||0,f||1)}; +THREE.Vector4.prototype={set:function(a,c,d,f){this.x=a;this.y=c;this.z=d;this.w=f;return this},copy:function(a){this.set(a.x,a.y,a.z,a.w||1);return this},add:function(a,c){this.set(a.x+c.x,a.y+c.y,a.z+c.z,a.w+c.w);return this},addSelf:function(a){this.set(this.x+a.x,this.y+a.y,this.z+a.z,this.w+a.w);return this},sub:function(a,c){this.set(a.x-c.x,a.y-c.y,a.z-c.z,a.w-c.w);return this},subSelf:function(a){this.set(this.x-a.x,this.y-a.y,this.z-a.z,this.w-a.w);return this},multiplyScalar:function(a){this.set(this.x* +a,this.y*a,this.z*a,this.w*a);return this},divideScalar:function(a){this.set(this.x/a,this.y/a,this.z/a,this.w/a);return this},lerpSelf:function(a,c){this.set(this.x+(a.x-this.x)*c,this.y+(a.y-this.y)*c,this.z+(a.z-this.z)*c,this.w+(a.w-this.w)*c)},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)},toString:function(){return"THREE.Vector4 ("+this.x+", "+this.y+", "+this.z+", "+this.w+")"}};THREE.Ray=function(a,c){this.origin=a||new THREE.Vector3;this.direction=c||new THREE.Vector3}; THREE.Ray.prototype={intersectScene:function(a){var c,d,f=a.objects,g=[];a=0;for(c=f.length;a0&&K>0&&b+K<1}var d,f,g,j,k,o,i,t,w,x, z,A=a.geometry,E=A.vertices,H=[];d=0;for(f=A.faces.length;d-this.near)return!1;if(k+j<-this.far)return!1;k-=j;var o=this.projectionMatrix,i=1/(o.n43*k),t=i*this.screenCenterX,w=(g.n11*c+g.n12*d+g.n13*f+g.n14)*o.n11*t;j=o.n11*j*t;if(w+j<-this.screenCenterX)return!1;if(w-j>this.screenCenterX)return!1;c=(g.n21*c+g.n22*d+g.n23*f+g.n24)*o.n22*i*this.screenCenterY; if(c+j<-this.screenCenterY)return!1;if(c-j>this.screenCenterY)return!1;a.screenPosition.set(w,c,k,j);return!0};THREE.Light=function(a){THREE.Object3D.call(this);this.color=new THREE.Color(a)};THREE.Light.prototype=new THREE.Object3D;THREE.Light.prototype.constructor=THREE.Light;THREE.Light.prototype.supr=THREE.Object3D.prototype;THREE.AmbientLight=function(a){THREE.Light.call(this,a)};THREE.AmbientLight.prototype=new THREE.Light;THREE.AmbientLight.prototype.constructor=THREE.AmbientLight; THREE.DirectionalLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3(0,1,0);this.intensity=c||1};THREE.DirectionalLight.prototype=new THREE.Light;THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight;THREE.PointLight=function(a,c){THREE.Light.call(this,a);this.position=new THREE.Vector3;this.intensity=c||1};THREE.PointLight.prototype=new THREE.Light;THREE.PointLight.prototype.constructor=THREE.PointLight;THREE.FlatShading=0;THREE.SmoothShading=1; -THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0}; +THREE.NormalBlending=0;THREE.AdditiveBlending=1;THREE.SubtractiveBlending=2;THREE.BillboardBlending=3;THREE.ReverseSubtractiveBlending=4;THREE.MaterialCounter={value:0};THREE.CubeReflectionMapping=function(){};THREE.CubeRefractionMapping=function(){};THREE.LatitudeReflectionMapping=function(){};THREE.LatitudeRefractionMapping=function(){};THREE.SphericalReflectionMapping=function(){};THREE.SphericalRefractionMapping=function(){};THREE.UVMapping=function(){}; THREE.LineBasicMaterial=function(a){this.id=THREE.MaterialCounter.value++;this.color=new THREE.Color(16777215);this.opacity=1;this.blending=THREE.NormalBlending;this.depth_test=!0;this.linewidth=1;this.linejoin=this.linecap="round";this.vertex_colors=!1;if(a){a.color!==undefined&&this.color.setHex(a.color);if(a.opacity!==undefined)this.opacity=a.opacity;if(a.blending!==undefined)this.blending=a.blending;if(a.depth_test!==undefined)this.depth_test=a.depth_test;if(a.linewidth!==undefined)this.linewidth= a.linewidth;if(a.linecap!==undefined)this.linecap=a.linecap;if(a.linejoin!==undefined)this.linejoin=a.linejoin;if(a.vertex_colors!==undefined)this.vertex_colors=a.vertex_colors}}; THREE.LineBasicMaterial.prototype={toString:function(){return"THREE.LineBasicMaterial (
id: "+this.id+"
color: "+this.color+"
opacity: "+this.opacity+"
blending: "+this.blending+"
depth_test: "+this.depth_test+"
linewidth: "+this.linewidth+"
linecap: "+this.linecap+"
linejoin: "+this.linejoin+"
vertex_colors: "+this.vertex_colors+"
)"}}; @@ -107,10 +106,9 @@ THREE.Texture=function(a,c,d,f,g,j){this.image=a;this.mapping=c!==undefined?c:ne THREE.Texture.prototype={clone:function(){return new THREE.Texture(this.image,this.mapping,this.wrap_s,this.wrap_t,this.mag_filter,this.min_filter)},toString:function(){return"THREE.Texture (
image: "+this.image+"
wrap_s: "+this.wrap_s+"
wrap_t: "+this.wrap_t+"
mag_filter: "+this.mag_filter+"
min_filter: "+this.min_filter+"
)"}};THREE.MultiplyOperation=0;THREE.MixOperation=1;THREE.RepeatWrapping=0;THREE.ClampToEdgeWrapping=1;THREE.MirroredRepeatWrapping=2; THREE.NearestFilter=3;THREE.NearestMipMapNearestFilter=4;THREE.NearestMipMapLinearFilter=5;THREE.LinearFilter=6;THREE.LinearMipMapNearestFilter=7;THREE.LinearMipMapLinearFilter=8;THREE.ByteType=9;THREE.UnsignedByteType=10;THREE.ShortType=11;THREE.UnsignedShortType=12;THREE.IntType=13;THREE.UnsignedIntType=14;THREE.FloatType=15;THREE.AlphaFormat=16;THREE.RGBFormat=17;THREE.RGBAFormat=18;THREE.LuminanceFormat=19;THREE.LuminanceAlphaFormat=20; THREE.RenderTarget=function(a,c,d){this.width=a;this.height=c;d=d||{};this.wrap_s=d.wrap_s!==undefined?d.wrap_s:THREE.ClampToEdgeWrapping;this.wrap_t=d.wrap_t!==undefined?d.wrap_t:THREE.ClampToEdgeWrapping;this.mag_filter=d.mag_filter!==undefined?d.mag_filter:THREE.LinearFilter;this.min_filter=d.min_filter!==undefined?d.min_filter:THREE.LinearMipMapLinearFilter;this.format=d.format!==undefined?d.format:THREE.RGBFormat;this.type=d.type!==undefined?d.type:THREE.UnsignedByteType}; -var Uniforms={clone:function(a){var c,d,f,g={};for(c in a){g[c]={};for(d in a[c]){f=a[c][d];g[c][d]=f instanceof THREE.Color||f instanceof THREE.Vector3||f instanceof THREE.Texture?f.clone():f}}return g},merge:function(a){var c,d,f,g={};for(c=0;c + @@ -55,13 +56,6 @@ - - - - - - - diff --git a/examples/canvas_sandbox.html b/examples/canvas_sandbox.html index 11a6635b..718a2011 100644 --- a/examples/canvas_sandbox.html +++ b/examples/canvas_sandbox.html @@ -35,11 +35,13 @@ + + @@ -54,13 +56,6 @@ - - - - - - - diff --git a/examples/misc_uqbiquity_test.html b/examples/misc_uqbiquity_test.html index 0cc490d8..f9c67dae 100644 --- a/examples/misc_uqbiquity_test.html +++ b/examples/misc_uqbiquity_test.html @@ -36,11 +36,13 @@ + + @@ -55,13 +57,6 @@ - - - - - - - diff --git a/src/core/Color.js b/src/core/Color.js index 1559f6a4..0d90159d 100644 --- a/src/core/Color.js +++ b/src/core/Color.js @@ -10,9 +10,9 @@ THREE.Color = function ( hex ) { THREE.Color.prototype = { - autoUpdate: true, + autoUpdate : true, - setRGB: function ( r, g, b ) { + setRGB : function ( r, g, b ) { this.r = r; this.g = g; @@ -27,7 +27,7 @@ THREE.Color.prototype = { }, - setHSV: function ( h, s, v ) { + setHSV : function ( h, s, v ) { // based on MochiKit implementation by Bob Ippolito // h,s,v ranges are < 0.0 - 1.0 > @@ -73,7 +73,7 @@ THREE.Color.prototype = { }, - setHex: function ( hex ) { + setHex : function ( hex ) { this.hex = ( ~~ hex ) & 0xffffff; @@ -86,13 +86,13 @@ THREE.Color.prototype = { }, - updateHex: function () { + updateHex : function () { - this.hex = ~~( this.r * 255 ) << 16 ^ ~~( this.g * 255 ) << 8 ^ ~~( this.b * 255 ); + this.hex = ~~ ( this.r * 255 ) << 16 ^ ~~ ( this.g * 255 ) << 8 ^ ~~ ( this.b * 255 ); }, - updateRGBA: function () { + updateRGBA : function () { this.r = ( this.hex >> 16 & 255 ) / 255; this.g = ( this.hex >> 8 & 255 ) / 255; @@ -100,19 +100,19 @@ THREE.Color.prototype = { }, - updateStyleString: function () { + updateStyleString : function () { - this.__styleString = 'rgb(' + ~~( this.r * 255 ) + ',' + ~~( this.g * 255 ) + ',' + ~~( this.b * 255 ) + ')'; + this.__styleString = 'rgb(' + ~~ ( this.r * 255 ) + ',' + ~~ ( this.g * 255 ) + ',' + ~~ ( this.b * 255 ) + ')'; }, - clone: function () { + clone : function () { return new THREE.Color( this.hex ); }, - toString: function () { + toString : function () { return 'THREE.Color ( r: ' + this.r + ', g: ' + this.g + ', b: ' + this.b + ', hex: ' + this.hex + ' )'; diff --git a/src/core/Face3.js b/src/core/Face3.js index 8b3efd84..f6b9eec7 100644 --- a/src/core/Face3.js +++ b/src/core/Face3.js @@ -18,7 +18,7 @@ THREE.Face3 = function ( a, b, c, normal, materials ) { THREE.Face3.prototype = { - toString: function () { + toString : function () { return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )'; diff --git a/src/core/Face4.js b/src/core/Face4.js index cc1b0c2f..d127e86d 100644 --- a/src/core/Face4.js +++ b/src/core/Face4.js @@ -20,7 +20,7 @@ THREE.Face4 = function ( a, b, c, d, normal, materials ) { THREE.Face4.prototype = { - toString: function () { + toString : function () { return 'THREE.Face4 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' ' + this.d + ' )'; diff --git a/src/core/Quaternion.js b/src/core/Quaternion.js index 505b1c5a..d4310948 100644 --- a/src/core/Quaternion.js +++ b/src/core/Quaternion.js @@ -4,33 +4,37 @@ THREE.Quaternion = function( x, y, z, w ) { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w !== undefined ? w : 1; - -}; + this.set( + x || 0, + y || 0, + z || 0, + w !== undefined ? w : 1 -THREE.Quaternion.prototype.set = function( x, y, z, w ) { - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; + ); }; +THREE.Quaternion.prototype = { -THREE.Quaternion.prototype.setFromEuler = function( vec3 ) { - - var c = 0.5 * Math.PI / 360, // 0.5 is an optimization + set : function ( x, y, z, w ) { + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + + }, + + setFromEuler : function ( vec3 ) { + + var c = 0.5 * Math.PI / 360, // 0.5 is an optimization x = vec3.x * c, y = vec3.y * c, z = vec3.z * c, - + c1 = Math.cos( y ), s1 = Math.sin( y ), c2 = Math.cos( -z ), @@ -39,230 +43,139 @@ THREE.Quaternion.prototype.setFromEuler = function( vec3 ) { s3 = Math.sin( x ), c1c2 = c1 * c2, s1s2 = s1 * s2; - - this.w = c1c2 * c3 - s1s2 * s3; - this.x = c1c2 * s3 + s1s2 * c3; - this.y = s1 * c2 * c3 + c1 * s2 * s3; - this.z = c1 * s2 * c3 - s1 * c2 * s3; - return this; + this.w = c1c2 * c3 - s1s2 * s3; + this.x = c1c2 * s3 + s1s2 * c3; + this.y = s1 * c2 * c3 + c1 * s2 * s3; + this.z = c1 * s2 * c3 - s1 * c2 * s3; -}; + return this; + }, -THREE.Quaternion.prototype.calculateW = function() { + calculateW : function () { - this.w = -Math.sqrt( Math.abs( 1.0 - this.x * this.x - this.y * this.y - this.z * this.z ) ); + this.w = - Math.sqrt( Math.abs( 1.0 - this.x * this.x - this.y * this.y - this.z * this.z ) ); - return this; + return this; -}; + }, + inverse : function () { -THREE.Quaternion.prototype.inverse = function() { + this.x *= -1; + this.y *= -1; + this.z *= -1; - this.x *= -1; - this.y *= -1; - this.z *= -1; + return this; - return this; + }, -}; + length : function () { + return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); -THREE.Quaternion.prototype.length = function() { + }, - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); + normalize : function () { -}; + var l = Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); + if ( l == 0 ) { -THREE.Quaternion.prototype.normalize = function() { - - var len = Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - - if ( len == 0 ) { - - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - - } else { - - len = 1 / len; - - this.x = this.x * len; - this.y = this.y * len; - this.z = this.z * len; - this.w = this.w * len; - - } - - return this; + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; -}; + } else { + l = 1 / l; -THREE.Quaternion.prototype.multiplySelf = function( quat2 ) { - - var qax = this.x, qay = this.y, qaz = this.z, qaw = this.w, + this.x = this.x * l; + this.y = this.y * l; + this.z = this.z * l; + this.w = this.w * l; + + } + + return this; + + }, + + multiplySelf : function ( quat2 ) { + + var qax = this.x, qay = this.y, qaz = this.z, qaw = this.w, qbx = quat2.x, qby = quat2.y, qbz = quat2.z, qbw = quat2.w; - - this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - return this; + this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; + this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; + this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; + this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; -}; + return this; + }, -THREE.Quaternion.prototype.multiplyVector3 = function( vec, dest ) { - - if( !dest ) { dest = vec; } - - var x = vec.x, y = vec.y, z = vec.z, - qx = this.x, qy = this.y, qz = this.z, qw = this.w; + multiplyVector3 : function ( vec, dest ) { - // calculate quat * vec - - var ix = qw * x + qy * z - qz * y, - iy = qw * y + qz * x - qx * z, - iz = qw * z + qx * y - qy * x, - iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - - dest.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - dest.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - dest.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return dest; + if( !dest ) { dest = vec; } -}; + var x = vec.x, y = vec.y, z = vec.z, + qx = this.x, qy = this.y, qz = this.z, qw = this.w; + // calculate quat * vec -THREE.Quaternion.prototype.toMatrix3 = function( matrix3 ) { - -/* todo: create a proper Matrix3 first - - var x = quat[0], y = quat[1], z = quat[2], w = quat[3]; + var ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z; - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; + // calculate result * inverse quat - var xx = x*x2; - var xy = x*y2; - var xz = x*z2; + dest.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + dest.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + dest.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - var yy = y*y2; - var yz = y*z2; - var zz = z*z2; + return dest; - var wx = w*x2; - var wy = w*y2; - var wz = w*z2; + }, - dest[0] = 1 - (yy + zz); - dest[1] = xy - wz; - dest[2] = xz + wy; + slerp : function ( qa, qb, qm, t ) { - dest[3] = xy + wz; - dest[4] = 1 - (xx + zz); - dest[5] = yz - wx; + var cosHalfTheta = qa.w * qb.w + qa.x * qb.x + qa.y * qb.y + qa.z * qb.z; - dest[6] = xz - wy; - dest[7] = yz + wx; - dest[8] = 1 - (xx + yy); - - return dest;*/ -}; + if ( Math.abs( cosHalfTheta ) >= 1.0 ) { -THREE.Quaternion.prototype.toMatrix4 = function( matrix4 ) { - -/* todo: this is implemented in Matrix4.setFromQuaternion + qm.w = qa.w; qm.x = qa.x; qm.y = qa.y; qm.z = qa.z; + return qm; - var x = quat[0], y = quat[1], z = quat[2], w = quat[3]; + } - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x*x2; - var xy = x*y2; - var xz = x*z2; - - var yy = y*y2; - var yz = y*z2; - var zz = z*z2; - - var wx = w*x2; - var wy = w*y2; - var wz = w*z2; - - dest[0] = 1 - (yy + zz); - dest[1] = xy - wz; - dest[2] = xz + wy; - dest[3] = 0; - - dest[4] = xy + wz; - dest[5] = 1 - (xx + zz); - dest[6] = yz - wx; - dest[7] = 0; - - dest[8] = xz - wy; - dest[9] = yz + wx; - dest[10] = 1 - (xx + yy); - dest[11] = 0; - - dest[12] = 0; - dest[13] = 0; - dest[14] = 0; - dest[15] = 1; - - */ -}; - -THREE.Quaternion.slerp = function( qa, qb, qm, t ) { - - - var cosHalfTheta = qa.w * qb.w + qa.x * qb.x + qa.y * qb.y + qa.z * qb.z; - - if( Math.abs( cosHalfTheta ) >= 1.0) { - - qm.w = qa.w; qm.x = qa.x; qm.y = qa.y; qm.z = qa.z; - return qm; - - } - - var halfTheta = Math.acos( cosHalfTheta ), + var halfTheta = Math.acos( cosHalfTheta ), sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta ); - if( Math.abs( sinHalfTheta ) < 0.001 ) { - - qm.w = 0.5 * ( qa.w + qb.w ); - qm.x = 0.5 * ( qa.x + qb.x ); - qm.y = 0.5 * ( qa.y + qb.y ); - qm.z = 0.5 * ( qa.z + qb.z ); - + if ( Math.abs( sinHalfTheta ) < 0.001 ) { + + qm.w = 0.5 * ( qa.w + qb.w ); + qm.x = 0.5 * ( qa.x + qb.x ); + qm.y = 0.5 * ( qa.y + qb.y ); + qm.z = 0.5 * ( qa.z + qb.z ); + + return qm; + + } + + var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, + ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; + + qm.w = ( qa.w * ratioA + qb.w * ratioB ); + qm.x = ( qa.x * ratioA + qb.x * ratioB ); + qm.y = ( qa.y * ratioA + qb.y * ratioB ); + qm.z = ( qa.z * ratioA + qb.z * ratioB ); + return qm; } - - var ratioA = Math.sin( (1 - t) * halfTheta ) / sinHalfTheta, - ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; - - qm.w = ( qa.w * ratioA + qb.w * ratioB ); - qm.x = ( qa.x * ratioA + qb.x * ratioB ); - qm.y = ( qa.y * ratioA + qb.y * ratioB ); - qm.z = ( qa.z * ratioA + qb.z * ratioB ); - - return qm; - -}; - - +} diff --git a/src/core/Ray.js b/src/core/Ray.js index be7457bf..9d9a987e 100644 --- a/src/core/Ray.js +++ b/src/core/Ray.js @@ -11,7 +11,7 @@ THREE.Ray = function ( origin, direction ) { THREE.Ray.prototype = { - intersectScene: function ( scene ) { + intersectScene : function ( scene ) { var i, l, object, objects = scene.objects, @@ -35,7 +35,7 @@ THREE.Ray.prototype = { }, - intersectObject: function ( object ) { + intersectObject : function ( object ) { var f, fl, face, a, b, c, d, normal, dot, scalar, diff --git a/src/core/UV.js b/src/core/UV.js index 5d7f3be5..9ff24876 100644 --- a/src/core/UV.js +++ b/src/core/UV.js @@ -4,21 +4,40 @@ THREE.UV = function ( u, v ) { - this.u = u || 0; - this.v = v || 0; + this.set( + + u || 0, + v || 0 + + ); }; THREE.UV.prototype = { - copy: function ( uv ) { + set : function ( u, v ) { - this.u = uv.u; - this.v = uv.v; + this.u = u; + this.v = v; + + return this; }, - toString: function () { + copy : function ( uv ) { + + this.set( + + uv.u, + uv.v + + ); + + return this; + + }, + + toString : function () { return 'THREE.UV (' + this.u + ', ' + this.v + ')'; diff --git a/src/core/Vector2.js b/src/core/Vector2.js index 40d8a83f..e19f8c9e 100644 --- a/src/core/Vector2.js +++ b/src/core/Vector2.js @@ -5,14 +5,18 @@ THREE.Vector2 = function ( x, y ) { - this.x = x || 0; - this.y = y || 0; + this.set( + + x || 0, + y || 0 + + ); }; THREE.Vector2.prototype = { - set: function ( x, y ) { + set : function ( x, y ) { this.x = x; this.y = y; @@ -21,61 +25,98 @@ THREE.Vector2.prototype = { }, - copy: function ( v ) { + copy : function ( v ) { - this.x = v.x; - this.y = v.y; + this.set( + + v.x, + v.y + + ); return this; }, - addSelf: function ( v ) { + addSelf : function ( v ) { - this.x += v.x; - this.y += v.y; + this.set( + + this.x + v.x, + this.y + v.y + + ); return this; }, - add: function ( v1, v2 ) { + add : function ( v1, v2 ) { - this.x = v1.x + v2.x; - this.y = v1.y + v2.y; + this.set( + + v1.x + v2.x, + v1.y + v2.y + + ); return this; }, - subSelf: function ( v ) { + subSelf : function ( v ) { - this.x -= v.x; - this.y -= v.y; + this.set( + + this.x - v.x, + this.y - v.y + + ); return this; }, - sub: function ( v1, v2 ) { + sub : function ( v1, v2 ) { - this.x = v1.x - v2.x; - this.y = v1.y - v2.y; + this.set( + + v1.x - v2.x, + v1.y - v2.y + + ); return this; }, - multiplyScalar: function ( s ) { + multiplyScalar : function ( s ) { - this.x *= s; - this.y *= s; + this.set( + + this.x * s, + this.y * s + + ); return this; }, - unit: function () { + negate : function() { + + this.set( + + - this.x, + - this.y + + ); + + return this; + + }, + + unit : function () { this.multiplyScalar( 1 / this.length() ); @@ -83,34 +124,25 @@ THREE.Vector2.prototype = { }, - length: function () { + length : function () { - return Math.sqrt( this.x * this.x + this.y * this.y ); + return Math.sqrt( this.lengthSq() ); }, - lengthSq: function () { + lengthSq : function () { return this.x * this.x + this.y * this.y; }, - negate: function() { - - this.x = - this.x; - this.y = - this.y; - - return this; - - }, - - clone: function () { + clone : function () { return new THREE.Vector2( this.x, this.y ); }, - toString: function () { + toString : function () { return 'THREE.Vector2 (' + this.x + ', ' + this.y + ')'; diff --git a/src/core/Vector4.js b/src/core/Vector4.js index 08ae6d77..31f8c595 100644 --- a/src/core/Vector4.js +++ b/src/core/Vector4.js @@ -6,17 +6,20 @@ THREE.Vector4 = function ( x, y, z, w ) { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - //this.w = w !== undefined ? w : 1; - this.w = w || 1; + this.set( + + x || 0, + y || 0, + z || 0, + w || 1 + + ); }; THREE.Vector4.prototype = { - set: function ( x, y, z, w ) { + set : function ( x, y, z, w ) { this.x = x; this.y = y; @@ -27,99 +30,131 @@ THREE.Vector4.prototype = { }, - copy: function ( v ) { + copy : function ( v ) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = v.w || 1.0; + this.set( + + v.x, + v.y, + v.z, + v.w || 1.0 + + ); return this; }, - add: function ( v1, v2 ) { + add : function ( v1, v2 ) { - this.x = v1.x + v2.x; - this.y = v1.y + v2.y; - this.z = v1.z + v2.z; - this.w = v1.w + v2.w; + this.set( + + v1.x + v2.x, + v1.y + v2.y, + v1.z + v2.z, + v1.w + v2.w + + ); return this; }, - addSelf: function ( v ) { + addSelf : function ( v ) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this.set( + + this.x + v.x, + this.y + v.y, + this.z + v.z, + this.w + v.w + + ); return this; }, - sub: function ( v1, v2 ) { + sub : function ( v1, v2 ) { - this.x = v1.x - v2.x; - this.y = v1.y - v2.y; - this.z = v1.z - v2.z; - this.w = v1.w - v2.w; + this.set( + + v1.x - v2.x, + v1.y - v2.y, + v1.z - v2.z, + v1.w - v2.w + + ); return this; }, - subSelf: function ( v ) { + subSelf : function ( v ) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this.set( + + this.x - v.x, + this.y - v.y, + this.z - v.z, + this.w - v.w + + ); return this; }, - multiplyScalar: function ( s ) { + multiplyScalar : function ( s ) { - this.x *= s; - this.y *= s; - this.z *= s; - this.w *= s; + this.set( + + this.x * s, + this.y * s, + this.z * s, + this.w * s + + ); return this; }, - divideScalar: function ( s ) { + divideScalar : function ( s ) { - this.x /= s; - this.y /= s; - this.z /= s; - this.w /= s; + this.set( + + this.x / s, + this.y / s, + this.z / s, + this.w / s + + ); return this; }, - lerpSelf: function ( v, alpha ) { + lerpSelf : function ( v, alpha ) { - this.x = this.x + (v.x - this.x) * alpha; - this.y = this.y + (v.y - this.y) * alpha; - this.z = this.z + (v.z - this.z) * alpha; - this.w = this.w + (v.w - this.w) * alpha; + this.set( + + this.x + (v.x - this.x) * alpha, + this.y + (v.y - this.y) * alpha, + this.z + (v.z - this.z) * alpha, + this.w + (v.w - this.w) * alpha + + ); }, - clone: function () { + clone : function () { return new THREE.Vector4( this.x, this.y, this.z, this.w ); }, - toString: function () { + toString : function () { return 'THREE.Vector4 (' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')'; diff --git a/src/core/Vertex.js b/src/core/Vertex.js index 0665c422..e7b10212 100644 --- a/src/core/Vertex.js +++ b/src/core/Vertex.js @@ -20,8 +20,9 @@ THREE.Vertex = function ( position, normal ) { THREE.Vertex.prototype = { - toString: function () { + toString : function () { return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )'; } + }; diff --git a/src/lights/AmbientLight.js b/src/lights/AmbientLight.js index ac99cfff..ad2e644c 100644 --- a/src/lights/AmbientLight.js +++ b/src/lights/AmbientLight.js @@ -1,3 +1,7 @@ +/** + * @author mr.doob / http://mrdoob.com/ + */ + THREE.AmbientLight = function ( hex ) { THREE.Light.call( this, hex ); diff --git a/src/lights/DirectionalLight.js b/src/lights/DirectionalLight.js index 5f94f58d..74633ed8 100644 --- a/src/lights/DirectionalLight.js +++ b/src/lights/DirectionalLight.js @@ -1,3 +1,7 @@ +/** + * @author mr.doob / http://mrdoob.com/ + */ + THREE.DirectionalLight = function ( hex, intensity ) { THREE.Light.call( this, hex ); diff --git a/src/lights/Light.js b/src/lights/Light.js index d465ec24..b6db323d 100644 --- a/src/lights/Light.js +++ b/src/lights/Light.js @@ -6,12 +6,11 @@ THREE.Light = function ( hex ) { THREE.Object3D.call( this ); - + this.color = new THREE.Color( hex ); }; -THREE.Light.prototype = new THREE.Object3D(); +THREE.Light.prototype = new THREE.Object3D(); THREE.Light.prototype.constructor = THREE.Light; -THREE.Light.prototype.supr = THREE.Object3D.prototype; - +THREE.Light.prototype.supr = THREE.Object3D.prototype; diff --git a/src/lights/PointLight.js b/src/lights/PointLight.js index e59007bf..ab462866 100644 --- a/src/lights/PointLight.js +++ b/src/lights/PointLight.js @@ -1,3 +1,7 @@ +/** + * @author mr.doob / http://mrdoob.com/ + */ + THREE.PointLight = function ( hex, intensity ) { THREE.Light.call( this, hex ); diff --git a/src/materials/Mappings.js b/src/materials/Mappings.js new file mode 100644 index 00000000..b32d281d --- /dev/null +++ b/src/materials/Mappings.js @@ -0,0 +1,14 @@ +/** + * @author mr.doob / http://mrdoob.com/ + */ + +THREE.CubeReflectionMapping = function () {}; +THREE.CubeRefractionMapping = function () {}; + +THREE.LatitudeReflectionMapping = function () {}; +THREE.LatitudeRefractionMapping = function () {}; + +THREE.SphericalReflectionMapping = function () {}; +THREE.SphericalRefractionMapping = function () {}; + +THREE.UVMapping = function () {}; diff --git a/src/materials/mappings/CubeReflectionMapping.js b/src/materials/mappings/CubeReflectionMapping.js deleted file mode 100644 index b3c1983c..00000000 --- a/src/materials/mappings/CubeReflectionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.CubeReflectionMapping = function () { - - - -}; diff --git a/src/materials/mappings/CubeRefractionMapping.js b/src/materials/mappings/CubeRefractionMapping.js deleted file mode 100644 index c7ba3a6b..00000000 --- a/src/materials/mappings/CubeRefractionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.CubeRefractionMapping = function () { - - - -}; diff --git a/src/materials/mappings/LatitudeReflectionMapping.js b/src/materials/mappings/LatitudeReflectionMapping.js deleted file mode 100644 index 6e3aec61..00000000 --- a/src/materials/mappings/LatitudeReflectionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.LatitudeReflectionMapping = function () { - - - -}; diff --git a/src/materials/mappings/LatitudeRefractionMapping.js b/src/materials/mappings/LatitudeRefractionMapping.js deleted file mode 100644 index cc0beeb8..00000000 --- a/src/materials/mappings/LatitudeRefractionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.LatitudeRefractionMapping = function () { - - - -}; diff --git a/src/materials/mappings/SphericalReflectionMapping.js b/src/materials/mappings/SphericalReflectionMapping.js deleted file mode 100644 index 7376c45c..00000000 --- a/src/materials/mappings/SphericalReflectionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.SphericalReflectionMapping = function () { - - - -}; diff --git a/src/materials/mappings/SphericalRefractionMapping.js b/src/materials/mappings/SphericalRefractionMapping.js deleted file mode 100644 index d0f610d3..00000000 --- a/src/materials/mappings/SphericalRefractionMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.SphericalRefractionMapping = function () { - - - -}; diff --git a/src/materials/mappings/UVMapping.js b/src/materials/mappings/UVMapping.js deleted file mode 100644 index f2751757..00000000 --- a/src/materials/mappings/UVMapping.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.UVMapping = function () { - - - -}; diff --git a/src/scenes/Scene.js b/src/scenes/Scene.js index cfeba372..70bdbcaf 100644 --- a/src/scenes/Scene.js +++ b/src/scenes/Scene.js @@ -112,7 +112,7 @@ THREE.Scene.prototype.removeChildRecurse = function( child ) { } -THREE.Scene.prototype.addObject = THREE.Scene.prototype.addChild; +THREE.Scene.prototype.addObject = THREE.Scene.prototype.addChild; THREE.Scene.prototype.removeObject = THREE.Scene.prototype.removeChild; -THREE.Scene.prototype.addLight = THREE.Scene.prototype.addChild; -THREE.Scene.prototype.removeLight = THREE.Scene.prototype.removeChild; +THREE.Scene.prototype.addLight = THREE.Scene.prototype.addChild; +THREE.Scene.prototype.removeLight = THREE.Scene.prototype.removeChild; diff --git a/utils/build.py b/utils/build.py index 349437b7..5c188b7d 100644 --- a/utils/build.py +++ b/utils/build.py @@ -37,6 +37,7 @@ COMMON_FILES = [ 'lights/DirectionalLight.js', 'lights/PointLight.js', 'materials/Material.js', +'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -51,13 +52,6 @@ COMMON_FILES = [ 'materials/Texture.js', 'materials/RenderTarget.js', 'materials/Uniforms.js', -'materials/mappings/CubeReflectionMapping.js', -'materials/mappings/CubeRefractionMapping.js', -'materials/mappings/LatitudeReflectionMapping.js', -'materials/mappings/LatitudeRefractionMapping.js', -'materials/mappings/SphericalReflectionMapping.js', -'materials/mappings/SphericalRefractionMapping.js', -'materials/mappings/UVMapping.js', 'objects/Particle.js', 'objects/ParticleSystem.js', 'objects/Line.js', @@ -186,6 +180,7 @@ CANVAS_FILES = [ 'lights/DirectionalLight.js', 'lights/PointLight.js', 'materials/Material.js', +'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -196,13 +191,6 @@ CANVAS_FILES = [ 'materials/ParticleBasicMaterial.js', 'materials/ParticleCircleMaterial.js', 'materials/Texture.js', -'materials/mappings/CubeReflectionMapping.js', -'materials/mappings/CubeRefractionMapping.js', -'materials/mappings/LatitudeReflectionMapping.js', -'materials/mappings/LatitudeRefractionMapping.js', -'materials/mappings/SphericalReflectionMapping.js', -'materials/mappings/SphericalRefractionMapping.js', -'materials/mappings/UVMapping.js', 'objects/Particle.js', 'objects/Line.js', 'objects/Mesh.js', @@ -237,6 +225,7 @@ WEBGL_FILES = [ 'lights/DirectionalLight.js', 'lights/PointLight.js', 'materials/Material.js', +'materials/Mappings.js', 'materials/LineBasicMaterial.js', 'materials/MeshBasicMaterial.js', 'materials/MeshLambertMaterial.js', @@ -250,13 +239,6 @@ WEBGL_FILES = [ 'materials/Texture.js', 'materials/RenderTarget.js', 'materials/Uniforms.js', -'materials/mappings/CubeReflectionMapping.js', -'materials/mappings/CubeRefractionMapping.js', -'materials/mappings/LatitudeReflectionMapping.js', -'materials/mappings/LatitudeRefractionMapping.js', -'materials/mappings/SphericalReflectionMapping.js', -'materials/mappings/SphericalRefractionMapping.js', -'materials/mappings/UVMapping.js', 'objects/Particle.js', 'objects/ParticleSystem.js', 'objects/Line.js',