Browse Source

Object3D::autoUpdateMatrix ⟶ Object3D::matrixAutoUpdate
Object3D::matrixNeedsToUpdate ⟶ Object3D::matrixNeedsUpdate

Mr.doob 14 years ago
parent
commit
106db4c3f8

+ 17 - 17
build/Three.js

@@ -1,7 +1,7 @@
 // Three.js r32 - http://github.com/mrdoob/three.js
-var THREE=THREE||{};THREE.Color=function(a){this.autoUpdate=!0;this.setHex(a)};
-THREE.Color.prototype={setRGB:function(a,b,d){this.r=a;this.g=b;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,d){var e,g,i,l,n,k;if(d==0)e=g=i=0;else{l=Math.floor(a*6);n=a*6-l;a=d*(1-b);k=d*(1-b*n);b=d*(1-b*(1-n));switch(l){case 1:e=k;g=d;i=a;break;case 2:e=a;g=d;i=b;break;case 3:e=a;g=k;i=d;break;case 4:e=b;g=a;i=d;break;case 5:e=d;g=a;i=k;break;case 6:case 0:e=d;g=b;i=a}}this.r=e;this.g=g;this.b=i;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: "+
+var THREE=THREE||{};THREE.Color=function(a){this.setHex(a)};
+THREE.Color.prototype={autoUpdate:!0,setRGB:function(a,b,d){this.r=a;this.g=b;this.b=d;if(this.autoUpdate){this.updateHex();this.updateStyleString()}},setHSV:function(a,b,d){var e,g,i,l,n,k;if(d==0)e=g=i=0;else{l=Math.floor(a*6);n=a*6-l;a=d*(1-b);k=d*(1-b*n);b=d*(1-b*(1-n));switch(l){case 1:e=k;g=d;i=a;break;case 2:e=a;g=d;i=b;break;case 3:e=a;g=k;i=d;break;case 4:e=b;g=a;i=d;break;case 5:e=d;g=a;i=k;break;case 6:case 0:e=d;g=b;i=a}}this.r=e;this.g=g;this.b=i;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,d){this.x=a||0;this.y=b||0;this.z=d||0};
@@ -67,19 +67,19 @@ z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,d=this.
 this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,d=this.vertices.length;b<d;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},sortFacesByMaterial:function(){function a(s){var w=[];b=0;for(d=s.length;b<d;b++)s[b]==undefined?w.push("undefined"):w.push(s[b].id);return w.join("_")}var b,d,e,g,i,l,n,k,o={};e=0;for(g=this.faces.length;e<g;e++){i=this.faces[e];
 l=i.materials;n=a(l);o[n]==undefined&&(o[n]={hash:n,counter:0});k=o[n].hash+"_"+o[n].counter;this.geometryChunks[k]==undefined&&(this.geometryChunks[k]={faces:[],materials:l,vertices:0});i=i instanceof THREE.Face3?3:4;if(this.geometryChunks[k].vertices+i>65535){o[n].counter+=1;k=o[n].hash+"_"+o[n].counter;this.geometryChunks[k]==undefined&&(this.geometryChunks[k]={faces:[],materials:l,vertices:0})}this.geometryChunks[k].faces.push(e);this.geometryChunks[k].vertices+=i}},toString:function(){return"THREE.Geometry ( vertices: "+
 this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}};THREE.GeometryIdCounter=0;
-THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.visible=!0;this.autoUpdateMatrix=!0;this.matrixNeedsToUpdate=!0;this.parent=undefined;this.children=[];this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.localMatrix=new THREE.Matrix4;this.globalMatrix=new THREE.Matrix4;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.screenPosition=new THREE.Vector4;this.boundRadius=0;this.boundRadiusScale=1;this.rotationMatrix=
-new THREE.Matrix4};THREE.Object3D.prototype.update=function(a,b,d){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var e=this.children.length;for(a=0;a<e;a++)this.children[a].update(this.globalMatrix,b,d)}};
+THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.visible=!0;this.matrixAutoUpdate=!0;this.matrixNeedsUpdate=!0;this.parent=undefined;this.children=[];this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.localMatrix=new THREE.Matrix4;this.globalMatrix=new THREE.Matrix4;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.screenPosition=new THREE.Vector4;this.boundRadius=0;this.boundRadiusScale=1;this.rotationMatrix=
+new THREE.Matrix4};THREE.Object3D.prototype.update=function(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var e=this.children.length;for(a=0;a<e;a++)this.children[a].update(this.globalMatrix,b,d)}};
 THREE.Object3D.prototype.updateMatrix=function(){this.localMatrix.setPosition(this.position);if(this.useQuaternion){if(this.quaternion.isDirty){this.localMatrix.setRotationFromQuaternion(this.quaternion);this.quaternion.isDirty=!1}}else this.localMatrix.setRotationFromEuler(this.rotation);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1){this.localMatrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}return!0};
-THREE.Object3D.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a)}};THREE.Object3D.prototype.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.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.autoUpdateMatrix=!1};THREE.Particle.prototype=new THREE.Object3D;
+THREE.Object3D.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a)}};THREE.Object3D.prototype.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.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.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;THREE.Line=function(a,b,d){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.type=d!=undefined?d: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.Mesh.prototype.update=function(a,b,d){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,d)}};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;
+THREE.Mesh.prototype.update=function(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,d)}};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(a,b,d){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.skinMatrix.multiply(a,this.localMatrix):this.skinMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var e,g=this.children.length;if(this.hasNoneBoneChildren){this.globalMatrix.multiply(this.skin.globalMatrix,this.skinMatrix);for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,d):a.update(this.globalMatrix,!0,d)}}else for(e=
-0;e<g;e++)this.children[e].update(this.skinMatrix,b,d)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
+THREE.Bone.prototype.update=function(a,b,d){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.skinMatrix.multiply(a,this.localMatrix):this.skinMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var e,g=this.children.length;if(this.hasNoneBoneChildren){this.globalMatrix.multiply(this.skin.globalMatrix,this.skinMatrix);for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.skinMatrix,b,d):a.update(this.globalMatrix,!0,d)}}else for(e=0;e<
+g;e++)this.children[e].update(this.skinMatrix,b,d)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var d,e,g,i,l,n;if(this.geometry.bones!==undefined){for(d=0;d<this.geometry.bones.length;d++){g=this.geometry.bones[d];i=g.pos;l=g.rotq;n=g.scl;e=this.addBone();e.name=g.name;e.position.set(i[0],i[1],i[2]);e.quaternion.set(l[0],l[1],l[2],l[3]);n!==undefined?e.scale.set(n[0],n[1],n[2]):e.scale.set(1,1,1)}for(d=0;d<this.bones.length;d++){g=this.geometry.bones[d];e=this.bones[d];
 g.parent===-1?this.addChild(e):this.bones[g.parent].addChild(e)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
-THREE.SkinnedMesh.prototype.update=function(a,b,d){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var e,g=this.children.length;for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,d):a.update(this.globalMatrix,b,d)}}};
+THREE.SkinnedMesh.prototype.update=function(a,b,d){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var e,g=this.children.length;for(e=0;e<g;e++){a=this.children[e];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,d):a.update(this.globalMatrix,b,d)}}};
 THREE.SkinnedMesh.prototype.addBone=function(a){a===undefined&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,b=[],d=0;d<this.bones.length;d++){a=this.bones[d];b.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,d*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var e;for(a=0;a<this.geometry.skinIndices.length;a++){d=this.geometry.vertices[a].position;var g=this.geometry.skinIndices[a].x,i=this.geometry.skinIndices[a].y;
 e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesA.push(b[g].multiplyVector3(e));e=new THREE.Vector3(d.x,d.y,d.z);this.geometry.skinVerticesB.push(b[i].multiplyVector3(e));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){d=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=d;this.geometry.skinWeights[a].y+=d}}}};
@@ -87,16 +87,16 @@ THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materi
 THREE.AnimationHandler=function(){var a=[],b={};b.update=function(d){for(var e=0;e<a.length;e++)a[e].update(d)};b.add=function(d){a.indexOf(d)===-1&&a.push(d)};b.remove=function(d){a.indexOf(d)!==-1&&a.splice(childIndex,1)};b.initData=function(d){if(d.initialized!==!0){for(var e=0;e<d.hierarchy.length;e++)for(var g=0;g<d.hierarchy[e].keys.length;g++){if(d.hierarchy[e].keys[g].time<0)d.hierarchy[e].keys[g].time=0;d.hierarchy[e].keys[g].index=g;if(d.hierarchy[e].keys[g].rot!==undefined&&!(d.hierarchy[e].keys[g].rot instanceof
 THREE.Quaternion)){var i=d.hierarchy[e].keys[g].rot;d.hierarchy[e].keys[g].rot=new THREE.Quaternion(i[0],i[1],i[2],i[3])}}g=parseInt(d.length*d.fps,10);d.JIT={};d.JIT.hierarchy=[];for(e=0;e<d.hierarchy.length;e++)d.JIT.hierarchy.push(Array(g));d.initialized=!0}};return b}();
 THREE.Animation=function(a,b){this.root=a;this.data=b;this.hierarchy=[];this.startTime=0;this.isPlaying=!1;this.loop=!0;this.offset=0;this.data.initialized||THREE.AnimationHandler.initData(this.data);if(a instanceof THREE.SkinnedMesh)for(var d=0;d<this.root.bones.length;d++)this.hierarchy.push(this.root.bones[d])};
-THREE.Animation.prototype.play=function(){if(!this.isPlaying){this.isPlaying=!0;this.startTime=(new Date).getTime()*0.001;for(var a=0;a<this.hierarchy.length;a++){this.hierarchy[a].useQuaternion=!0;this.hierarchy[a].autoUpdateMatrix=!0;if(this.hierarchy[a].prevKey===undefined){this.hierarchy[a].prevKey={pos:0,rot:0,scl:0};this.hierarchy[a].nextKey={pos:0,rot:0,scl:0}}this.hierarchy[a].prevKey.pos=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.rot=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.scl=
+THREE.Animation.prototype.play=function(){if(!this.isPlaying){this.isPlaying=!0;this.startTime=(new Date).getTime()*0.001;for(var a=0;a<this.hierarchy.length;a++){this.hierarchy[a].useQuaternion=!0;this.hierarchy[a].matrixAutoUpdate=!0;if(this.hierarchy[a].prevKey===undefined){this.hierarchy[a].prevKey={pos:0,rot:0,scl:0};this.hierarchy[a].nextKey={pos:0,rot:0,scl:0}}this.hierarchy[a].prevKey.pos=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.rot=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.scl=
 this.data.hierarchy[a].keys[0];this.hierarchy[a].nextKey.pos=this.getNextKeyWith("pos",a,1);this.hierarchy[a].nextKey.rot=this.getNextKeyWith("rot",a,1);this.hierarchy[a].nextKey.scl=this.getNextKeyWith("scl",a,1)}this.update();THREE.AnimationHandler.add(this)}};THREE.Animation.prototype.pause=function(){THREE.AnimationHandler.remove(this)};THREE.Animation.prototype.stop=function(){this.isPlaying=!1;THREE.AnimationHandler.remove(this)};
 THREE.Animation.prototype.update=function(){if(this.isPlaying){var a=["pos","rot","scl"],b,d,e,g,i,l,n=this.data.JIT.hierarchy,k=(new Date).getTime()*0.001-this.startTime+this.offset,o=k;if(k>this.data.length){for(;k>this.data.length;)k-=this.data.length;this.startTime=(new Date).getTime()*0.001-k;k=(new Date).getTime()*0.001-this.startTime}l=Math.min(parseInt(k*this.data.fps),parseInt(this.data.length*this.data.fps));for(var s=0,w=this.hierarchy.length;s<w;s++){i=this.hierarchy[s];if(n[s][l]!==undefined){i.skinMatrix=
-n[s][l];i.autoUpdateMatrix=!1;i.matrixNeedsToUpdate=!1;i.skinMatrix.flattenToArrayOffset(this.root.boneMatrices,s*16)}else for(var u=0;u<3;u++){d=a[u];e=i.prevKey[d];g=i.nextKey[d];if(g.time<o){if(k<o)if(this.loop){e=this.data.hierarchy[s].keys[0];g=this.getNextKeyWith(d,s,1)}else{this.stop();return}else{do{e=g;g=this.getNextKeyWith(d,s,g.index+1)}while(g.time<k)}i.prevKey[d]=e;i.nextKey[d]=g}i.autoUpdateMatrix=!0;i.matrixNeedsToUpdate=!0;b=(k-e.time)/(g.time-e.time);e=e[d];g=g[d];if(d==="rot"){if(b<
+n[s][l];i.matrixAutoUpdate=!1;i.matrixNeedsUpdate=!1;i.skinMatrix.flattenToArrayOffset(this.root.boneMatrices,s*16)}else for(var u=0;u<3;u++){d=a[u];e=i.prevKey[d];g=i.nextKey[d];if(g.time<o){if(k<o)if(this.loop){e=this.data.hierarchy[s].keys[0];g=this.getNextKeyWith(d,s,1)}else{this.stop();return}else{do{e=g;g=this.getNextKeyWith(d,s,g.index+1)}while(g.time<k)}i.prevKey[d]=e;i.nextKey[d]=g}i.matrixAutoUpdate=!0;i.matrixNeedsUpdate=!0;b=(k-e.time)/(g.time-e.time);e=e[d];g=g[d];if(d==="rot"){if(b<
 0||b>1){console.log("Scale out of bounds:"+b);b=b<0?0:1}THREE.Quaternion.slerp(e,g,i.quaternion,b)}else{d=d==="pos"?i.position:i.scale;d.x=e[0]+(g[0]-e[0])*b;d.y=e[1]+(g[1]-e[1])*b;d.z=e[2]+(g[2]-e[2])*b}}}if(n[0][l]===undefined){this.hierarchy[0].update(undefined,!0);for(s=0;s<this.hierarchy.length;s++)n[s][l]=this.hierarchy[s].skinMatrix.clone()}}};THREE.Animation.prototype.updateObject=function(){};
 THREE.Animation.prototype.getNextKeyWith=function(a,b,d){for(var e=this.data.hierarchy[b].keys;d<e.length;d++)if(e[d][a]!==undefined)return e[d];return this.data.hierarchy[b].keys[0]};
 THREE.Camera=function(a,b,d,e,g,i){THREE.Object3D.call(this);this.FOV=a||50;this.aspect=b||1;this.zNear=d||0.1;this.zFar=e||2E3;this.screenCenterY=this.screenCenterX=0;this.target=i||new THREE.Object3D;this.useTarget=!0;this.up=new THREE.Vector3(0,1,0);this.inverseMatrix=new THREE.Matrix4;this.projectionMatrix=null;this.tmpVec=new THREE.Vector3;this.translateX=function(l){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(l);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);
 this.target.position.addSelf(this.tmpVec)};this.translateZ=function(l){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(l);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
 THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.FOV,this.aspect,this.zNear,this.zFar)};
-THREE.Camera.prototype.update=function(a,b,d){if(this.useTarget){this.localMatrix.lookAt(this.position,this.target.position,this.up);a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);THREE.Matrix4.makeInvert(this.globalMatrix,this.inverseMatrix);b=!0}else{this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0;THREE.Matrix4.makeInvert(this.globalMatrix,
+THREE.Camera.prototype.update=function(a,b,d){if(this.useTarget){this.localMatrix.lookAt(this.position,this.target.position,this.up);a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);THREE.Matrix4.makeInvert(this.globalMatrix,this.inverseMatrix);b=!0}else{this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0;THREE.Matrix4.makeInvert(this.globalMatrix,
 this.inverseMatrix)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,d)};
 THREE.Camera.prototype.frustumContains=function(a){var b=a.globalMatrix.n14,d=a.globalMatrix.n24,e=a.globalMatrix.n34,g=this.inverseMatrix,i=a.boundRadius*a.boundRadiusScale,l=g.n31*b+g.n32*d+g.n33*e+g.n34;if(l-i>-this.zNear)return!1;if(l+i<-this.zFar)return!1;l-=i;var n=this.projectionMatrix,k=1/(n.n43*l),o=k*this.screenCenterX,s=(g.n11*b+g.n12*d+g.n13*e+g.n14)*n.n11*o;i=n.n11*i*o;if(s+i<-this.screenCenterX)return!1;if(s-i>this.screenCenterX)return!1;b=(g.n21*b+g.n22*d+g.n23*e+g.n24)*n.n22*k*this.screenCenterY;
 if(b+i<-this.screenCenterY)return!1;if(b-i>this.screenCenterY)return!1;a.screenPosition.set(s,b,l,i);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;
@@ -144,8 +144,8 @@ THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light
 THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,b,d){this.color=new THREE.Color(a);this.near=b||1;this.far=d||1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b||2.5E-4};
 THREE.Projector=function(){function a(T,O){return O.z-T.z}function b(T,O){var ca=0,S=1,ba=T.z+T.w,V=O.z+O.w,D=-T.z+T.w,J=-O.z+O.w;if(ba>=0&&V>=0&&D>=0&&J>=0)return!0;else if(ba<0&&V<0||D<0&&J<0)return!1;else{if(ba<0)ca=Math.max(ca,ba/(ba-V));else V<0&&(S=Math.min(S,ba/(ba-V)));if(D<0)ca=Math.max(ca,D/(D-J));else J<0&&(S=Math.min(S,D/(D-J)));if(S<ca)return!1;else{T.lerpSelf(O,ca);O.lerpSelf(T,1-S);return!0}}}var d,e,g=[],i,l,n,k=[],o,s,w=[],u,x,F=[],I=new THREE.Vector4,H=new THREE.Vector4,r=new THREE.Matrix4,
 Z=new THREE.Matrix4,E=[],L=new THREE.Vector4,c=new THREE.Vector4,ia;this.projectObjects=function(T,O,ca){O=[];var S,ba,V;e=0;ba=T.objects;T=0;for(S=ba.length;T<S;T++){V=ba[T];var D;if(!(D=!V.visible))if(D=V instanceof THREE.Mesh){a:{D=void 0;for(var J=V.globalMatrix,la=-V.geometry.boundingSphere.radius*Math.max(V.scale.x,Math.max(V.scale.y,V.scale.z)),Q=0;Q<6;Q++){D=E[Q].x*J.n14+E[Q].y*J.n24+E[Q].z*J.n34+E[Q].w;if(D<=la){D=!1;break a}}D=!0}D=!D}if(!D){d=g[e]=g[e]||new THREE.RenderableObject;I.copy(V.position);
-r.multiplyVector3(I);d.object=V;d.z=I.z;O.push(d);e++}}ca&&O.sort(a);return O};this.projectScene=function(T,O,ca){var S=[],ba=O.zNear,V=O.zFar,D,J,la,Q,ja,ea,R,ra,wa,f,m,p,j,h,q,t;n=s=x=0;O.autoUpdateMatrix&&O.update();r.multiply(O.projectionMatrix,O.globalMatrix);E[0]=new THREE.Vector4(r.n41-r.n11,r.n42-r.n12,r.n43-r.n13,r.n44-r.n14);E[1]=new THREE.Vector4(r.n41+r.n11,r.n42+r.n12,r.n43+r.n13,r.n44+r.n14);E[2]=new THREE.Vector4(r.n41+r.n21,r.n42+r.n22,r.n43+r.n23,r.n44+r.n24);E[3]=new THREE.Vector4(r.n41-
-r.n21,r.n42-r.n22,r.n43-r.n23,r.n44-r.n24);E[4]=new THREE.Vector4(r.n41-r.n31,r.n42-r.n32,r.n43-r.n33,r.n44-r.n34);E[5]=new THREE.Vector4(r.n41+r.n31,r.n42+r.n32,r.n43+r.n33,r.n44+r.n34);D=0;for(ea=E.length;D<ea;D++){R=E[D];R.divideScalar(Math.sqrt(R.x*R.x+R.y*R.y+R.z*R.z))}T.update(undefined,!1,O);ea=this.projectObjects(T,O,!0);T=0;for(D=ea.length;T<D;T++){R=ea[T].object;if(R.visible){R.autoUpdateMatrix&&R.updateMatrix();ra=R.globalMatrix;ra.extractRotationMatrix(R.rotationMatrix);m=R.rotationMatrix;
+r.multiplyVector3(I);d.object=V;d.z=I.z;O.push(d);e++}}ca&&O.sort(a);return O};this.projectScene=function(T,O,ca){var S=[],ba=O.zNear,V=O.zFar,D,J,la,Q,ja,ea,R,ra,wa,f,m,p,j,h,q,t;n=s=x=0;O.matrixAutoUpdate&&O.update();r.multiply(O.projectionMatrix,O.globalMatrix);E[0]=new THREE.Vector4(r.n41-r.n11,r.n42-r.n12,r.n43-r.n13,r.n44-r.n14);E[1]=new THREE.Vector4(r.n41+r.n11,r.n42+r.n12,r.n43+r.n13,r.n44+r.n14);E[2]=new THREE.Vector4(r.n41+r.n21,r.n42+r.n22,r.n43+r.n23,r.n44+r.n24);E[3]=new THREE.Vector4(r.n41-
+r.n21,r.n42-r.n22,r.n43-r.n23,r.n44-r.n24);E[4]=new THREE.Vector4(r.n41-r.n31,r.n42-r.n32,r.n43-r.n33,r.n44-r.n34);E[5]=new THREE.Vector4(r.n41+r.n31,r.n42+r.n32,r.n43+r.n33,r.n44+r.n34);D=0;for(ea=E.length;D<ea;D++){R=E[D];R.divideScalar(Math.sqrt(R.x*R.x+R.y*R.y+R.z*R.z))}T.update(undefined,!1,O);ea=this.projectObjects(T,O,!0);T=0;for(D=ea.length;T<D;T++){R=ea[T].object;if(R.visible){R.matrixAutoUpdate&&R.updateMatrix();ra=R.globalMatrix;ra.extractRotationMatrix(R.rotationMatrix);m=R.rotationMatrix;
 wa=R.materials;f=R.overdraw;if(R instanceof THREE.Mesh){p=R.geometry;j=p.vertices;J=0;for(la=j.length;J<la;J++){h=j[J];h.positionWorld.copy(h.position);ra.multiplyVector3(h.positionWorld);Q=h.positionScreen;Q.copy(h.positionWorld);r.multiplyVector4(Q);Q.x/=Q.w;Q.y/=Q.w;h.__visible=Q.z>ba&&Q.z<V}p=p.faces;J=0;for(la=p.length;J<la;J++){h=p[J];if(h instanceof THREE.Face3){Q=j[h.a];ja=j[h.b];q=j[h.c];if(Q.__visible&&ja.__visible&&q.__visible&&(R.doubleSided||R.flipSided!=(q.positionScreen.x-Q.positionScreen.x)*
 (ja.positionScreen.y-Q.positionScreen.y)-(q.positionScreen.y-Q.positionScreen.y)*(ja.positionScreen.x-Q.positionScreen.x)<0)){i=k[n]=k[n]||new THREE.RenderableFace3;i.v1.positionWorld.copy(Q.positionWorld);i.v2.positionWorld.copy(ja.positionWorld);i.v3.positionWorld.copy(q.positionWorld);i.v1.positionScreen.copy(Q.positionScreen);i.v2.positionScreen.copy(ja.positionScreen);i.v3.positionScreen.copy(q.positionScreen);i.normalWorld.copy(h.normal);m.multiplyVector3(i.normalWorld);i.centroidWorld.copy(h.centroid);
 ra.multiplyVector3(i.centroidWorld);i.centroidScreen.copy(i.centroidWorld);r.multiplyVector3(i.centroidScreen);q=h.vertexNormals;ia=i.vertexNormalsWorld;Q=0;for(ja=q.length;Q<ja;Q++){t=ia[Q]=ia[Q]||new THREE.Vector3;t.copy(q[Q]);m.multiplyVector3(t)}i.z=i.centroidScreen.z;i.meshMaterials=wa;i.faceMaterials=h.materials;i.overdraw=f;if(R.geometry.uvs[J]){i.uvs[0]=R.geometry.uvs[J][0];i.uvs[1]=R.geometry.uvs[J][1];i.uvs[2]=R.geometry.uvs[J][2]}S.push(i);n++}}else if(h instanceof THREE.Face4){Q=j[h.a];
@@ -225,9 +225,9 @@ p=c.createProgram();h=["#ifdef GL_ES\nprecision highp float;\n#endif","#define M
 "","#define MAX_DIR_LIGHTS "+q.maxDirLights,"#define MAX_POINT_LIGHTS "+q.maxPointLights,q.map?"#define USE_MAP":"",q.env_map?"#define USE_ENVMAP":"",q.light_map?"#define USE_LIGHTMAP":"",q.vertex_colors?"#define USE_COLOR":"",q.skinning?"#define USE_SKINNING":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
 c.attachShader(p,Z("fragment",h+W));c.attachShader(p,Z("vertex",q+m));c.linkProgram(p);c.getProgramParameter(p,c.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+c.getProgramParameter(p,c.VALIDATE_STATUS)+", gl error ["+c.getError()+"]");p.uniforms={};p.attributes={};f.program=p;p=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","uBoneGlobalMatrices"];for(j in f.uniforms)p.push(j);j=f.program;W=0;for(m=p.length;W<
 m;W++){h=p[W];j.uniforms[h]=c.getUniformLocation(j,h)}j=f.program;p=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];W=0;for(m=p.length;W<m;W++){h=p[W];j.attributes[h]=c.getAttribLocation(j,h)}j=f.program.attributes;c.enableVertexAttribArray(j.position);j.color>=0&&c.enableVertexAttribArray(j.color);j.normal>=0&&c.enableVertexAttribArray(j.normal);j.tangent>=0&&c.enableVertexAttribArray(j.tangent);if(f.skinning&&j.skinVertexA>=0&&j.skinVertexB>=
-0&&j.skinIndex>=0&&j.skinWeight>=0){c.enableVertexAttribArray(j.skinVertexA);c.enableVertexAttribArray(j.skinVertexB);c.enableVertexAttribArray(j.skinIndex);c.enableVertexAttribArray(j.skinWeight)}};this.render=function(f,m,p,j){var h,q,t,A,W,G,M,C,aa=f.lights,da=f.fog;m.autoUpdateMatrix&&m.update();m.globalMatrix.flattenToArray(ja);m.projectionMatrix.flattenToArray(la);m.inverseMatrix.flattenToArray(Q);J.multiply(m.projectionMatrix,m.globalMatrix);k(J);THREE.AnimationHandler&&THREE.AnimationHandler.update();
+0&&j.skinIndex>=0&&j.skinWeight>=0){c.enableVertexAttribArray(j.skinVertexA);c.enableVertexAttribArray(j.skinVertexB);c.enableVertexAttribArray(j.skinIndex);c.enableVertexAttribArray(j.skinWeight)}};this.render=function(f,m,p,j){var h,q,t,A,W,G,M,C,aa=f.lights,da=f.fog;m.matrixAutoUpdate&&m.update();m.globalMatrix.flattenToArray(ja);m.projectionMatrix.flattenToArray(la);m.inverseMatrix.flattenToArray(Q);J.multiply(m.projectionMatrix,m.globalMatrix);k(J);THREE.AnimationHandler&&THREE.AnimationHandler.update();
 f.update(undefined,!1,m);this.initWebGLObjects(f,m);r(p,j!==undefined?j:!0);this.autoClear&&this.clear();W=f.__webGLObjects.length;for(j=0;j<W;j++){h=f.__webGLObjects[j];M=h.object;if(M.visible)if(!(M instanceof THREE.Mesh)||o(M)){M.globalMatrix.flattenToArray(M._objectMatrixArray);I(M,m);u(h);h.render=!0;if(this.sortObjects){ea.copy(M.position);J.multiplyVector3(ea);h.z=ea.z}}else h.render=!1;else h.render=!1}this.sortObjects&&f.__webGLObjects.sort(x);G=f.__webGLObjectsImmediate.length;for(j=0;j<
-G;j++){h=f.__webGLObjectsImmediate[j];M=h.object;if(M.visible){M.autoUpdateMatrix&&M.globalMatrix.flattenToArray(M._objectMatrixArray);I(M,m);w(h)}}H(THREE.NormalBlending);for(j=0;j<W;j++){h=f.__webGLObjects[j];if(h.render){M=h.object;C=h.buffer;t=h.opaque;l(M);for(h=0;h<t.count;h++){A=t.list[h];n(A.depth_test);g(m,aa,da,A,C,M)}}}for(j=0;j<G;j++){h=f.__webGLObjectsImmediate[j];M=h.object;if(M.visible){t=h.opaque;l(M);for(h=0;h<t.count;h++){A=t.list[h];n(A.depth_test);q=e(m,aa,da,A,M);M.render(function(ua){i(ua,
+G;j++){h=f.__webGLObjectsImmediate[j];M=h.object;if(M.visible){M.matrixAutoUpdate&&M.globalMatrix.flattenToArray(M._objectMatrixArray);I(M,m);w(h)}}H(THREE.NormalBlending);for(j=0;j<W;j++){h=f.__webGLObjects[j];if(h.render){M=h.object;C=h.buffer;t=h.opaque;l(M);for(h=0;h<t.count;h++){A=t.list[h];n(A.depth_test);g(m,aa,da,A,C,M)}}}for(j=0;j<G;j++){h=f.__webGLObjectsImmediate[j];M=h.object;if(M.visible){t=h.opaque;l(M);for(h=0;h<t.count;h++){A=t.list[h];n(A.depth_test);q=e(m,aa,da,A,M);M.render(function(ua){i(ua,
 q)})}}}for(j=0;j<W;j++){h=f.__webGLObjects[j];if(h.render){M=h.object;C=h.buffer;t=h.transparent;l(M);for(h=0;h<t.count;h++){A=t.list[h];H(A.blending);n(A.depth_test);g(m,aa,da,A,C,M)}}}for(j=0;j<G;j++){h=f.__webGLObjectsImmediate[j];M=h.object;if(M.visible){t=h.transparent;l(M);for(h=0;h<t.count;h++){A=t.list[h];H(A.blending);n(A.depth_test);q=e(m,aa,da,A,M);M.render(function(ua){i(ua,q)})}}}if(p&&p.min_filter!==THREE.NearestFilter&&p.min_filter!==THREE.LinearFilter){c.bindTexture(c.TEXTURE_2D,p.__webGLTexture);
 c.generateMipmap(c.TEXTURE_2D);c.bindTexture(c.TEXTURE_2D,null)}};this.initWebGLObjects=function(f){var m,p,j;if(!f.__webGLObjects){f.__webGLObjects=[];f.__webGLObjectsMap={};f.__webGLObjectsImmediate=[]}m=0;for(p=f.objects.length;m<p;m++){j=f.objects[m];var h=f,q=void 0,t=void 0,A=void 0,W=void 0;t=j.geometry;if(h.__webGLObjectsMap[j.id]==undefined){h.__webGLObjectsMap[j.id]={};j._modelViewMatrix=new THREE.Matrix4;j._normalMatrixArray=new Float32Array(9);j._modelViewMatrixArray=new Float32Array(16);
 j._objectMatrixArray=new Float32Array(16);j.globalMatrix.flattenToArray(j._objectMatrixArray)}W=h.__webGLObjectsMap[j.id];objlist=h.__webGLObjects;if(j instanceof THREE.Mesh){for(q in t.geometryChunks){A=t.geometryChunks[q];if(!A.__webGLVertexBuffer){h=A;h.__webGLVertexBuffer=c.createBuffer();h.__webGLNormalBuffer=c.createBuffer();h.__webGLTangentBuffer=c.createBuffer();h.__webGLColorBuffer=c.createBuffer();h.__webGLUVBuffer=c.createBuffer();h.__webGLUV2Buffer=c.createBuffer();h.__webGLSkinVertexABuffer=

+ 18 - 18
build/ThreeExtras.js

@@ -1,7 +1,7 @@
 // ThreeExtras.js r32 - http://github.com/mrdoob/three.js
-var THREE=THREE||{};THREE.Color=function(a){this.autoUpdate=!0;this.setHex(a)};
-THREE.Color.prototype={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: "+
+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.x=a||0;this.y=b||0;this.z=c||0};
@@ -67,19 +67,19 @@ z:[this.vertices[0].position.z,this.vertices[0].position.z]};for(var b=1,c=this.
 this.boundingBox.z[1])this.boundingBox.z[1]=a.position.z}}},computeBoundingSphere:function(){for(var a=this.boundingSphere===null?0:this.boundingSphere.radius,b=0,c=this.vertices.length;b<c;b++)a=Math.max(a,this.vertices[b].position.length());this.boundingSphere={radius:a}},sortFacesByMaterial:function(){function a(o){var w=[];b=0;for(c=o.length;b<c;b++)o[b]==undefined?w.push("undefined"):w.push(o[b].id);return w.join("_")}var b,c,d,f,g,h,k,j,m={};d=0;for(f=this.faces.length;d<f;d++){g=this.faces[d];
 h=g.materials;k=a(h);m[k]==undefined&&(m[k]={hash:k,counter:0});j=m[k].hash+"_"+m[k].counter;this.geometryChunks[j]==undefined&&(this.geometryChunks[j]={faces:[],materials:h,vertices:0});g=g instanceof THREE.Face3?3:4;if(this.geometryChunks[j].vertices+g>65535){m[k].counter+=1;j=m[k].hash+"_"+m[k].counter;this.geometryChunks[j]==undefined&&(this.geometryChunks[j]={faces:[],materials:h,vertices:0})}this.geometryChunks[j].faces.push(d);this.geometryChunks[j].vertices+=g}},toString:function(){return"THREE.Geometry ( vertices: "+
 this.vertices+", faces: "+this.faces+", uvs: "+this.uvs+" )"}};THREE.GeometryIdCounter=0;
-THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.visible=!0;this.autoUpdateMatrix=!0;this.matrixNeedsToUpdate=!0;this.parent=undefined;this.children=[];this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.localMatrix=new THREE.Matrix4;this.globalMatrix=new THREE.Matrix4;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.screenPosition=new THREE.Vector4;this.boundRadius=0;this.boundRadiusScale=1;this.rotationMatrix=
-new THREE.Matrix4};THREE.Object3D.prototype.update=function(a,b,c){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.globalMatrix,b,c)}};
+THREE.Object3D=function(){this.id=THREE.Object3DCounter.value++;this.visible=!0;this.matrixAutoUpdate=!0;this.matrixNeedsUpdate=!0;this.parent=undefined;this.children=[];this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.scale=new THREE.Vector3(1,1,1);this.localMatrix=new THREE.Matrix4;this.globalMatrix=new THREE.Matrix4;this.quaternion=new THREE.Quaternion;this.useQuaternion=!1;this.screenPosition=new THREE.Vector4;this.boundRadius=0;this.boundRadiusScale=1;this.rotationMatrix=
+new THREE.Matrix4};THREE.Object3D.prototype.update=function(a,b,c){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var d=this.children.length;for(a=0;a<d;a++)this.children[a].update(this.globalMatrix,b,c)}};
 THREE.Object3D.prototype.updateMatrix=function(){this.localMatrix.setPosition(this.position);if(this.useQuaternion){if(this.quaternion.isDirty){this.localMatrix.setRotationFromQuaternion(this.quaternion);this.quaternion.isDirty=!1}}else this.localMatrix.setRotationFromEuler(this.rotation);if(this.scale.x!==1||this.scale.y!==1||this.scale.z!==1){this.localMatrix.scale(this.scale);this.boundRadiusScale=Math.max(this.scale.x,Math.max(this.scale.y,this.scale.z))}return!0};
-THREE.Object3D.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a)}};THREE.Object3D.prototype.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.Particle=function(a){THREE.Object3D.call(this);this.materials=a instanceof Array?a:[a];this.autoUpdateMatrix=!1};THREE.Particle.prototype=new THREE.Object3D;
+THREE.Object3D.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a)}};THREE.Object3D.prototype.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.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.ParticleSystem=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materials=b instanceof Array?b:[b];this.sortParticles=!1};THREE.ParticleSystem.prototype=new THREE.Object3D;THREE.ParticleSystem.prototype.constructor=THREE.ParticleSystem;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.Mesh.prototype.update=function(a,b,c){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,c)}};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;
+THREE.Mesh.prototype.update=function(a,b,c){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,c)}};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a;this.skinMatrix=new THREE.Matrix4;this.hasNoneBoneChildren=!1};THREE.Bone.prototype=new THREE.Object3D;
 THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.supr=THREE.Object3D.prototype;
-THREE.Bone.prototype.update=function(a,b,c){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.skinMatrix.multiply(a,this.localMatrix):this.skinMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var d,f=this.children.length;if(this.hasNoneBoneChildren){this.globalMatrix.multiply(this.skin.globalMatrix,this.skinMatrix);for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.globalMatrix,!0,c)}}else for(d=
-0;d<f;d++)this.children[d].update(this.skinMatrix,b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
+THREE.Bone.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.skinMatrix.multiply(a,this.localMatrix):this.skinMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var d,f=this.children.length;if(this.hasNoneBoneChildren){this.globalMatrix.multiply(this.skin.globalMatrix,this.skinMatrix);for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.skinMatrix,b,c):a.update(this.globalMatrix,!0,c)}}else for(d=0;d<
+f;d++)this.children[d].update(this.skinMatrix,b,c)};THREE.Bone.prototype.addChild=function(a){if(this.children.indexOf(a)===-1){a.parent!==undefined&&a.parent.removeChild(a);a.parent=this;this.children.push(a);if(!(a instanceof THREE.Bone))this.hasNoneBoneChildren=!0}};if(!window.Float32Array)window.Float32Array=Array;
 THREE.SkinnedMesh=function(a,b){THREE.Mesh.call(this,a,b);this.identityMatrix=new THREE.Matrix4;this.bones=[];this.boneMatrices=[];var c,d,f,g,h,k;if(this.geometry.bones!==undefined){for(c=0;c<this.geometry.bones.length;c++){f=this.geometry.bones[c];g=f.pos;h=f.rotq;k=f.scl;d=this.addBone();d.name=f.name;d.position.set(g[0],g[1],g[2]);d.quaternion.set(h[0],h[1],h[2],h[3]);k!==undefined?d.scale.set(k[0],k[1],k[2]):d.scale.set(1,1,1)}for(c=0;c<this.bones.length;c++){f=this.geometry.bones[c];d=this.bones[c];
 f.parent===-1?this.addChild(d):this.bones[f.parent].addChild(d)}this.boneMatrices=new Float32Array(16*this.bones.length);this.pose()}};THREE.SkinnedMesh.prototype=new THREE.Mesh;THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh;
-THREE.SkinnedMesh.prototype.update=function(a,b,c){if(this.visible){this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0}var d,f=this.children.length;for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,c):a.update(this.globalMatrix,b,c)}}};
+THREE.SkinnedMesh.prototype.update=function(a,b,c){if(this.visible){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0}var d,f=this.children.length;for(d=0;d<f;d++){a=this.children[d];a instanceof THREE.Bone?a.update(this.identityMatrix,!1,c):a.update(this.globalMatrix,b,c)}}};
 THREE.SkinnedMesh.prototype.addBone=function(a){a===undefined&&(a=new THREE.Bone(this));this.bones.push(a);return a};
 THREE.SkinnedMesh.prototype.pose=function(){this.update(undefined,!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];b.push(THREE.Matrix4.makeInvert(a.skinMatrix));a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===undefined){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];var d;for(a=0;a<this.geometry.skinIndices.length;a++){c=this.geometry.vertices[a].position;var f=this.geometry.skinIndices[a].x,g=this.geometry.skinIndices[a].y;
 d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(d));d=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[g].multiplyVector3(d));if(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y!==1){c=(1-(this.geometry.skinWeights[a].x+this.geometry.skinWeights[a].y))*0.5;this.geometry.skinWeights[a].x+=c;this.geometry.skinWeights[a].y+=c}}}};
@@ -87,16 +87,16 @@ THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.materi
 THREE.AnimationHandler=function(){var a=[],b={};b.update=function(c){for(var d=0;d<a.length;d++)a[d].update(c)};b.add=function(c){a.indexOf(c)===-1&&a.push(c)};b.remove=function(c){a.indexOf(c)!==-1&&a.splice(childIndex,1)};b.initData=function(c){if(c.initialized!==!0){for(var d=0;d<c.hierarchy.length;d++)for(var f=0;f<c.hierarchy[d].keys.length;f++){if(c.hierarchy[d].keys[f].time<0)c.hierarchy[d].keys[f].time=0;c.hierarchy[d].keys[f].index=f;if(c.hierarchy[d].keys[f].rot!==undefined&&!(c.hierarchy[d].keys[f].rot instanceof
 THREE.Quaternion)){var g=c.hierarchy[d].keys[f].rot;c.hierarchy[d].keys[f].rot=new THREE.Quaternion(g[0],g[1],g[2],g[3])}}f=parseInt(c.length*c.fps,10);c.JIT={};c.JIT.hierarchy=[];for(d=0;d<c.hierarchy.length;d++)c.JIT.hierarchy.push(Array(f));c.initialized=!0}};return b}();
 THREE.Animation=function(a,b){this.root=a;this.data=b;this.hierarchy=[];this.startTime=0;this.isPlaying=!1;this.loop=!0;this.offset=0;this.data.initialized||THREE.AnimationHandler.initData(this.data);if(a instanceof THREE.SkinnedMesh)for(var c=0;c<this.root.bones.length;c++)this.hierarchy.push(this.root.bones[c])};
-THREE.Animation.prototype.play=function(){if(!this.isPlaying){this.isPlaying=!0;this.startTime=(new Date).getTime()*0.001;for(var a=0;a<this.hierarchy.length;a++){this.hierarchy[a].useQuaternion=!0;this.hierarchy[a].autoUpdateMatrix=!0;if(this.hierarchy[a].prevKey===undefined){this.hierarchy[a].prevKey={pos:0,rot:0,scl:0};this.hierarchy[a].nextKey={pos:0,rot:0,scl:0}}this.hierarchy[a].prevKey.pos=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.rot=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.scl=
+THREE.Animation.prototype.play=function(){if(!this.isPlaying){this.isPlaying=!0;this.startTime=(new Date).getTime()*0.001;for(var a=0;a<this.hierarchy.length;a++){this.hierarchy[a].useQuaternion=!0;this.hierarchy[a].matrixAutoUpdate=!0;if(this.hierarchy[a].prevKey===undefined){this.hierarchy[a].prevKey={pos:0,rot:0,scl:0};this.hierarchy[a].nextKey={pos:0,rot:0,scl:0}}this.hierarchy[a].prevKey.pos=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.rot=this.data.hierarchy[a].keys[0];this.hierarchy[a].prevKey.scl=
 this.data.hierarchy[a].keys[0];this.hierarchy[a].nextKey.pos=this.getNextKeyWith("pos",a,1);this.hierarchy[a].nextKey.rot=this.getNextKeyWith("rot",a,1);this.hierarchy[a].nextKey.scl=this.getNextKeyWith("scl",a,1)}this.update();THREE.AnimationHandler.add(this)}};THREE.Animation.prototype.pause=function(){THREE.AnimationHandler.remove(this)};THREE.Animation.prototype.stop=function(){this.isPlaying=!1;THREE.AnimationHandler.remove(this)};
 THREE.Animation.prototype.update=function(){if(this.isPlaying){var a=["pos","rot","scl"],b,c,d,f,g,h,k=this.data.JIT.hierarchy,j=(new Date).getTime()*0.001-this.startTime+this.offset,m=j;if(j>this.data.length){for(;j>this.data.length;)j-=this.data.length;this.startTime=(new Date).getTime()*0.001-j;j=(new Date).getTime()*0.001-this.startTime}h=Math.min(parseInt(j*this.data.fps),parseInt(this.data.length*this.data.fps));for(var o=0,w=this.hierarchy.length;o<w;o++){g=this.hierarchy[o];if(k[o][h]!==undefined){g.skinMatrix=
-k[o][h];g.autoUpdateMatrix=!1;g.matrixNeedsToUpdate=!1;g.skinMatrix.flattenToArrayOffset(this.root.boneMatrices,o*16)}else for(var u=0;u<3;u++){c=a[u];d=g.prevKey[c];f=g.nextKey[c];if(f.time<m){if(j<m)if(this.loop){d=this.data.hierarchy[o].keys[0];f=this.getNextKeyWith(c,o,1)}else{this.stop();return}else{do{d=f;f=this.getNextKeyWith(c,o,f.index+1)}while(f.time<j)}g.prevKey[c]=d;g.nextKey[c]=f}g.autoUpdateMatrix=!0;g.matrixNeedsToUpdate=!0;b=(j-d.time)/(f.time-d.time);d=d[c];f=f[c];if(c==="rot"){if(b<
+k[o][h];g.matrixAutoUpdate=!1;g.matrixNeedsUpdate=!1;g.skinMatrix.flattenToArrayOffset(this.root.boneMatrices,o*16)}else for(var u=0;u<3;u++){c=a[u];d=g.prevKey[c];f=g.nextKey[c];if(f.time<m){if(j<m)if(this.loop){d=this.data.hierarchy[o].keys[0];f=this.getNextKeyWith(c,o,1)}else{this.stop();return}else{do{d=f;f=this.getNextKeyWith(c,o,f.index+1)}while(f.time<j)}g.prevKey[c]=d;g.nextKey[c]=f}g.matrixAutoUpdate=!0;g.matrixNeedsUpdate=!0;b=(j-d.time)/(f.time-d.time);d=d[c];f=f[c];if(c==="rot"){if(b<
 0||b>1){console.log("Scale out of bounds:"+b);b=b<0?0:1}THREE.Quaternion.slerp(d,f,g.quaternion,b)}else{c=c==="pos"?g.position:g.scale;c.x=d[0]+(f[0]-d[0])*b;c.y=d[1]+(f[1]-d[1])*b;c.z=d[2]+(f[2]-d[2])*b}}}if(k[0][h]===undefined){this.hierarchy[0].update(undefined,!0);for(o=0;o<this.hierarchy.length;o++)k[o][h]=this.hierarchy[o].skinMatrix.clone()}}};THREE.Animation.prototype.updateObject=function(){};
 THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys;c<d.length;c++)if(d[c][a]!==undefined)return d[c];return this.data.hierarchy[b].keys[0]};
 THREE.Camera=function(a,b,c,d,f,g){THREE.Object3D.call(this);this.FOV=a||50;this.aspect=b||1;this.zNear=c||0.1;this.zFar=d||2E3;this.screenCenterY=this.screenCenterX=0;this.target=g||new THREE.Object3D;this.useTarget=!0;this.up=new THREE.Vector3(0,1,0);this.inverseMatrix=new THREE.Matrix4;this.projectionMatrix=null;this.tmpVec=new THREE.Vector3;this.translateX=function(h){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(h);this.tmpVec.crossSelf(this.up);this.position.addSelf(this.tmpVec);
 this.target.position.addSelf(this.tmpVec)};this.translateZ=function(h){this.tmpVec.sub(this.target.position,this.position).normalize().multiplyScalar(h);this.position.subSelf(this.tmpVec);this.target.position.subSelf(this.tmpVec)};this.updateProjectionMatrix()};THREE.Camera.prototype=new THREE.Object3D;THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.supr=THREE.Object3D.prototype;
 THREE.Camera.prototype.updateProjectionMatrix=function(){this.projectionMatrix=THREE.Matrix4.makePerspective(this.FOV,this.aspect,this.zNear,this.zFar)};
-THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget){this.localMatrix.lookAt(this.position,this.target.position,this.up);a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);THREE.Matrix4.makeInvert(this.globalMatrix,this.inverseMatrix);b=!0}else{this.autoUpdateMatrix&&(b|=this.updateMatrix());if(b||this.matrixNeedsToUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsToUpdate=!1;b=!0;THREE.Matrix4.makeInvert(this.globalMatrix,
+THREE.Camera.prototype.update=function(a,b,c){if(this.useTarget){this.localMatrix.lookAt(this.position,this.target.position,this.up);a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);THREE.Matrix4.makeInvert(this.globalMatrix,this.inverseMatrix);b=!0}else{this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixNeedsUpdate){a?this.globalMatrix.multiply(a,this.localMatrix):this.globalMatrix.copy(this.localMatrix);this.matrixNeedsUpdate=!1;b=!0;THREE.Matrix4.makeInvert(this.globalMatrix,
 this.inverseMatrix)}}for(a=0;a<this.children.length;a++)this.children[a].update(this.globalMatrix,b,c)};
 THREE.Camera.prototype.frustumContains=function(a){var b=a.globalMatrix.n14,c=a.globalMatrix.n24,d=a.globalMatrix.n34,f=this.inverseMatrix,g=a.boundRadius*a.boundRadiusScale,h=f.n31*b+f.n32*c+f.n33*d+f.n34;if(h-g>-this.zNear)return!1;if(h+g<-this.zFar)return!1;h-=g;var k=this.projectionMatrix,j=1/(k.n43*h),m=j*this.screenCenterX,o=(f.n11*b+f.n12*c+f.n13*d+f.n14)*k.n11*m;g=k.n11*g*m;if(o+g<-this.screenCenterX)return!1;if(o-g>this.screenCenterX)return!1;b=(f.n21*b+f.n22*c+f.n23*d+f.n24)*k.n22*j*this.screenCenterY;
 if(b+g<-this.screenCenterY)return!1;if(b-g>this.screenCenterY)return!1;a.screenPosition.set(o,b,h,g);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;
@@ -144,8 +144,8 @@ THREE.Scene.prototype.removeChildRecurse=function(a){if(a instanceof THREE.Light
 THREE.Scene.prototype.removeLight=THREE.Scene.prototype.removeChild;THREE.Fog=function(a,b,c){this.color=new THREE.Color(a);this.near=b||1;this.far=c||1E3};THREE.FogExp2=function(a,b){this.color=new THREE.Color(a);this.density=b||2.5E-4};
 THREE.Projector=function(){function a(L,M){return M.z-L.z}function b(L,M){var V=0,S=1,Y=L.z+L.w,Z=M.z+M.w,G=-L.z+L.w,U=-M.z+M.w;if(Y>=0&&Z>=0&&G>=0&&U>=0)return!0;else if(Y<0&&Z<0||G<0&&U<0)return!1;else{if(Y<0)V=Math.max(V,Y/(Y-Z));else Z<0&&(S=Math.min(S,Y/(Y-Z)));if(G<0)V=Math.max(V,G/(G-U));else U<0&&(S=Math.min(S,G/(G-U)));if(S<V)return!1;else{L.lerpSelf(M,V);M.lerpSelf(L,1-S);return!0}}}var c,d,f=[],g,h,k,j=[],m,o,w=[],u,t,x=[],A=new THREE.Vector4,F=new THREE.Vector4,v=new THREE.Matrix4,I=new THREE.Matrix4,
 q=[],J=new THREE.Vector4,e=new THREE.Vector4,ba;this.projectObjects=function(L,M,V){M=[];var S,Y,Z;d=0;Y=L.objects;L=0;for(S=Y.length;L<S;L++){Z=Y[L];var G;if(!(G=!Z.visible))if(G=Z instanceof THREE.Mesh){a:{G=void 0;for(var U=Z.globalMatrix,na=-Z.geometry.boundingSphere.radius*Math.max(Z.scale.x,Math.max(Z.scale.y,Z.scale.z)),W=0;W<6;W++){G=q[W].x*U.n14+q[W].y*U.n24+q[W].z*U.n34+q[W].w;if(G<=na){G=!1;break a}}G=!0}G=!G}if(!G){c=f[d]=f[d]||new THREE.RenderableObject;A.copy(Z.position);v.multiplyVector3(A);
-c.object=Z;c.z=A.z;M.push(c);d++}}V&&M.sort(a);return M};this.projectScene=function(L,M,V){var S=[],Y=M.zNear,Z=M.zFar,G,U,na,W,ka,ia,$,ra,ya,l,z,C,p,n,B,H;k=o=t=0;M.autoUpdateMatrix&&M.update();v.multiply(M.projectionMatrix,M.globalMatrix);q[0]=new THREE.Vector4(v.n41-v.n11,v.n42-v.n12,v.n43-v.n13,v.n44-v.n14);q[1]=new THREE.Vector4(v.n41+v.n11,v.n42+v.n12,v.n43+v.n13,v.n44+v.n14);q[2]=new THREE.Vector4(v.n41+v.n21,v.n42+v.n22,v.n43+v.n23,v.n44+v.n24);q[3]=new THREE.Vector4(v.n41-v.n21,v.n42-v.n22,
-v.n43-v.n23,v.n44-v.n24);q[4]=new THREE.Vector4(v.n41-v.n31,v.n42-v.n32,v.n43-v.n33,v.n44-v.n34);q[5]=new THREE.Vector4(v.n41+v.n31,v.n42+v.n32,v.n43+v.n33,v.n44+v.n34);G=0;for(ia=q.length;G<ia;G++){$=q[G];$.divideScalar(Math.sqrt($.x*$.x+$.y*$.y+$.z*$.z))}L.update(undefined,!1,M);ia=this.projectObjects(L,M,!0);L=0;for(G=ia.length;L<G;L++){$=ia[L].object;if($.visible){$.autoUpdateMatrix&&$.updateMatrix();ra=$.globalMatrix;ra.extractRotationMatrix($.rotationMatrix);z=$.rotationMatrix;ya=$.materials;
+c.object=Z;c.z=A.z;M.push(c);d++}}V&&M.sort(a);return M};this.projectScene=function(L,M,V){var S=[],Y=M.zNear,Z=M.zFar,G,U,na,W,ka,ia,$,ra,ya,l,z,C,p,n,B,H;k=o=t=0;M.matrixAutoUpdate&&M.update();v.multiply(M.projectionMatrix,M.globalMatrix);q[0]=new THREE.Vector4(v.n41-v.n11,v.n42-v.n12,v.n43-v.n13,v.n44-v.n14);q[1]=new THREE.Vector4(v.n41+v.n11,v.n42+v.n12,v.n43+v.n13,v.n44+v.n14);q[2]=new THREE.Vector4(v.n41+v.n21,v.n42+v.n22,v.n43+v.n23,v.n44+v.n24);q[3]=new THREE.Vector4(v.n41-v.n21,v.n42-v.n22,
+v.n43-v.n23,v.n44-v.n24);q[4]=new THREE.Vector4(v.n41-v.n31,v.n42-v.n32,v.n43-v.n33,v.n44-v.n34);q[5]=new THREE.Vector4(v.n41+v.n31,v.n42+v.n32,v.n43+v.n33,v.n44+v.n34);G=0;for(ia=q.length;G<ia;G++){$=q[G];$.divideScalar(Math.sqrt($.x*$.x+$.y*$.y+$.z*$.z))}L.update(undefined,!1,M);ia=this.projectObjects(L,M,!0);L=0;for(G=ia.length;L<G;L++){$=ia[L].object;if($.visible){$.matrixAutoUpdate&&$.updateMatrix();ra=$.globalMatrix;ra.extractRotationMatrix($.rotationMatrix);z=$.rotationMatrix;ya=$.materials;
 l=$.overdraw;if($ instanceof THREE.Mesh){C=$.geometry;p=C.vertices;U=0;for(na=p.length;U<na;U++){n=p[U];n.positionWorld.copy(n.position);ra.multiplyVector3(n.positionWorld);W=n.positionScreen;W.copy(n.positionWorld);v.multiplyVector4(W);W.x/=W.w;W.y/=W.w;n.__visible=W.z>Y&&W.z<Z}C=C.faces;U=0;for(na=C.length;U<na;U++){n=C[U];if(n instanceof THREE.Face3){W=p[n.a];ka=p[n.b];B=p[n.c];if(W.__visible&&ka.__visible&&B.__visible&&($.doubleSided||$.flipSided!=(B.positionScreen.x-W.positionScreen.x)*(ka.positionScreen.y-
 W.positionScreen.y)-(B.positionScreen.y-W.positionScreen.y)*(ka.positionScreen.x-W.positionScreen.x)<0)){g=j[k]=j[k]||new THREE.RenderableFace3;g.v1.positionWorld.copy(W.positionWorld);g.v2.positionWorld.copy(ka.positionWorld);g.v3.positionWorld.copy(B.positionWorld);g.v1.positionScreen.copy(W.positionScreen);g.v2.positionScreen.copy(ka.positionScreen);g.v3.positionScreen.copy(B.positionScreen);g.normalWorld.copy(n.normal);z.multiplyVector3(g.normalWorld);g.centroidWorld.copy(n.centroid);ra.multiplyVector3(g.centroidWorld);
 g.centroidScreen.copy(g.centroidWorld);v.multiplyVector3(g.centroidScreen);B=n.vertexNormals;ba=g.vertexNormalsWorld;W=0;for(ka=B.length;W<ka;W++){H=ba[W]=ba[W]||new THREE.Vector3;H.copy(B[W]);z.multiplyVector3(H)}g.z=g.centroidScreen.z;g.meshMaterials=ya;g.faceMaterials=n.materials;g.overdraw=l;if($.geometry.uvs[U]){g.uvs[0]=$.geometry.uvs[U][0];g.uvs[1]=$.geometry.uvs[U][1];g.uvs[2]=$.geometry.uvs[U][2]}S.push(g);k++}}else if(n instanceof THREE.Face4){W=p[n.a];ka=p[n.b];B=p[n.c];H=p[n.d];if(W.__visible&&
@@ -225,9 +225,9 @@ C=e.createProgram();n=["#ifdef GL_ES\nprecision highp float;\n#endif","#define M
 "","#define MAX_DIR_LIGHTS "+B.maxDirLights,"#define MAX_POINT_LIGHTS "+B.maxPointLights,B.map?"#define USE_MAP":"",B.env_map?"#define USE_ENVMAP":"",B.light_map?"#define USE_LIGHTMAP":"",B.vertex_colors?"#define USE_COLOR":"",B.skinning?"#define USE_SKINNING":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nuniform mat4 cameraInverseMatrix;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec3 color;\nattribute vec2 uv;\nattribute vec2 uv2;\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n"].join("\n");
 e.attachShader(C,I("fragment",n+ca));e.attachShader(C,I("vertex",B+z));e.linkProgram(C);e.getProgramParameter(C,e.LINK_STATUS)||alert("Could not initialise shaders\nVALIDATE_STATUS: "+e.getProgramParameter(C,e.VALIDATE_STATUS)+", gl error ["+e.getError()+"]");C.uniforms={};C.attributes={};l.program=C;C=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","cameraInverseMatrix","uBoneGlobalMatrices"];for(p in l.uniforms)C.push(p);p=l.program;ca=0;for(z=C.length;ca<
 z;ca++){n=C[ca];p.uniforms[n]=e.getUniformLocation(p,n)}p=l.program;C=["position","normal","uv","uv2","tangent","color","skinVertexA","skinVertexB","skinIndex","skinWeight"];ca=0;for(z=C.length;ca<z;ca++){n=C[ca];p.attributes[n]=e.getAttribLocation(p,n)}p=l.program.attributes;e.enableVertexAttribArray(p.position);p.color>=0&&e.enableVertexAttribArray(p.color);p.normal>=0&&e.enableVertexAttribArray(p.normal);p.tangent>=0&&e.enableVertexAttribArray(p.tangent);if(l.skinning&&p.skinVertexA>=0&&p.skinVertexB>=
-0&&p.skinIndex>=0&&p.skinWeight>=0){e.enableVertexAttribArray(p.skinVertexA);e.enableVertexAttribArray(p.skinVertexB);e.enableVertexAttribArray(p.skinIndex);e.enableVertexAttribArray(p.skinWeight)}};this.render=function(l,z,C,p){var n,B,H,N,ca,y,E,D,P=l.lights,T=l.fog;z.autoUpdateMatrix&&z.update();z.globalMatrix.flattenToArray(ka);z.projectionMatrix.flattenToArray(na);z.inverseMatrix.flattenToArray(W);U.multiply(z.projectionMatrix,z.globalMatrix);j(U);THREE.AnimationHandler&&THREE.AnimationHandler.update();
+0&&p.skinIndex>=0&&p.skinWeight>=0){e.enableVertexAttribArray(p.skinVertexA);e.enableVertexAttribArray(p.skinVertexB);e.enableVertexAttribArray(p.skinIndex);e.enableVertexAttribArray(p.skinWeight)}};this.render=function(l,z,C,p){var n,B,H,N,ca,y,E,D,P=l.lights,T=l.fog;z.matrixAutoUpdate&&z.update();z.globalMatrix.flattenToArray(ka);z.projectionMatrix.flattenToArray(na);z.inverseMatrix.flattenToArray(W);U.multiply(z.projectionMatrix,z.globalMatrix);j(U);THREE.AnimationHandler&&THREE.AnimationHandler.update();
 l.update(undefined,!1,z);this.initWebGLObjects(l,z);v(C,p!==undefined?p:!0);this.autoClear&&this.clear();ca=l.__webGLObjects.length;for(p=0;p<ca;p++){n=l.__webGLObjects[p];E=n.object;if(E.visible)if(!(E instanceof THREE.Mesh)||m(E)){E.globalMatrix.flattenToArray(E._objectMatrixArray);A(E,z);u(n);n.render=!0;if(this.sortObjects){ia.copy(E.position);U.multiplyVector3(ia);n.z=ia.z}}else n.render=!1;else n.render=!1}this.sortObjects&&l.__webGLObjects.sort(t);y=l.__webGLObjectsImmediate.length;for(p=0;p<
-y;p++){n=l.__webGLObjectsImmediate[p];E=n.object;if(E.visible){E.autoUpdateMatrix&&E.globalMatrix.flattenToArray(E._objectMatrixArray);A(E,z);w(n)}}F(THREE.NormalBlending);for(p=0;p<ca;p++){n=l.__webGLObjects[p];if(n.render){E=n.object;D=n.buffer;H=n.opaque;h(E);for(n=0;n<H.count;n++){N=H.list[n];k(N.depth_test);f(z,P,T,N,D,E)}}}for(p=0;p<y;p++){n=l.__webGLObjectsImmediate[p];E=n.object;if(E.visible){H=n.opaque;h(E);for(n=0;n<H.count;n++){N=H.list[n];k(N.depth_test);B=d(z,P,T,N,E);E.render(function(oa){g(oa,
+y;p++){n=l.__webGLObjectsImmediate[p];E=n.object;if(E.visible){E.matrixAutoUpdate&&E.globalMatrix.flattenToArray(E._objectMatrixArray);A(E,z);w(n)}}F(THREE.NormalBlending);for(p=0;p<ca;p++){n=l.__webGLObjects[p];if(n.render){E=n.object;D=n.buffer;H=n.opaque;h(E);for(n=0;n<H.count;n++){N=H.list[n];k(N.depth_test);f(z,P,T,N,D,E)}}}for(p=0;p<y;p++){n=l.__webGLObjectsImmediate[p];E=n.object;if(E.visible){H=n.opaque;h(E);for(n=0;n<H.count;n++){N=H.list[n];k(N.depth_test);B=d(z,P,T,N,E);E.render(function(oa){g(oa,
 B)})}}}for(p=0;p<ca;p++){n=l.__webGLObjects[p];if(n.render){E=n.object;D=n.buffer;H=n.transparent;h(E);for(n=0;n<H.count;n++){N=H.list[n];F(N.blending);k(N.depth_test);f(z,P,T,N,D,E)}}}for(p=0;p<y;p++){n=l.__webGLObjectsImmediate[p];E=n.object;if(E.visible){H=n.transparent;h(E);for(n=0;n<H.count;n++){N=H.list[n];F(N.blending);k(N.depth_test);B=d(z,P,T,N,E);E.render(function(oa){g(oa,B)})}}}if(C&&C.min_filter!==THREE.NearestFilter&&C.min_filter!==THREE.LinearFilter){e.bindTexture(e.TEXTURE_2D,C.__webGLTexture);
 e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)}};this.initWebGLObjects=function(l){var z,C,p;if(!l.__webGLObjects){l.__webGLObjects=[];l.__webGLObjectsMap={};l.__webGLObjectsImmediate=[]}z=0;for(C=l.objects.length;z<C;z++){p=l.objects[z];var n=l,B=void 0,H=void 0,N=void 0,ca=void 0;H=p.geometry;if(n.__webGLObjectsMap[p.id]==undefined){n.__webGLObjectsMap[p.id]={};p._modelViewMatrix=new THREE.Matrix4;p._normalMatrixArray=new Float32Array(9);p._modelViewMatrixArray=new Float32Array(16);
 p._objectMatrixArray=new Float32Array(16);p.globalMatrix.flattenToArray(p._objectMatrixArray)}ca=n.__webGLObjectsMap[p.id];objlist=n.__webGLObjects;if(p instanceof THREE.Mesh){for(B in H.geometryChunks){N=H.geometryChunks[B];if(!N.__webGLVertexBuffer){n=N;n.__webGLVertexBuffer=e.createBuffer();n.__webGLNormalBuffer=e.createBuffer();n.__webGLTangentBuffer=e.createBuffer();n.__webGLColorBuffer=e.createBuffer();n.__webGLUVBuffer=e.createBuffer();n.__webGLUV2Buffer=e.createBuffer();n.__webGLSkinVertexABuffer=
@@ -278,7 +278,7 @@ THREE.RenderableFace3=function(){this.z=null;this.v1=new THREE.Vertex;this.v2=ne
 THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.Vertex;this.v2=new THREE.Vertex;this.materials=null};
 THREE.Detector={canvas:!!document.createElement("canvas").getContext,webgl:window.Uint8Array!=undefined,workers:!!window.Worker,addGetWebGLMessage:function(a){var b=document.body,c="oldie";if(a){if(a.parent!==undefined)b=a.parent;if(a.id!==undefined)c=a.id}a=document.createElement("center");var d=document.createElement("div");d.innerHTML='Sorry, your browser doesn\'t support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a><br/>\n<br/>\nPlease try in\n<a href="http://www.google.com/chrome">Chrome 9+</a> /\n<a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox 4+</a> /\n<a href="http://nightly.webkit.org/">Safari OSX 10.6+</a>';d.id=
 c;c=d.style;c.fontFamily="monospace";c.fontSize="13px";c.textAlign="center";c.background="#eee";c.color="#000";c.padding="1em";c.width="475px";c.margin="5em auto 0";a.appendChild(d);b.appendChild(a);return d}};
-var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,f=c?b.geometry:b,g=a.vertices,h=f.vertices,k=a.faces,j=f.faces,m=a.uvs;f=f.uvs;c&&b.autoUpdateMatrix&&b.updateMatrix();for(var o=0,w=h.length;o<w;o++){var u=new THREE.Vertex(h[o].position.clone());c&&b.localMatrix.multiplyVector3(u.position);g.push(u)}o=0;for(w=j.length;o<w;o++){h=j[o];var t,x=h.vertexNormals;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+
+var GeometryUtils={merge:function(a,b){var c=b instanceof THREE.Mesh,d=a.vertices.length,f=c?b.geometry:b,g=a.vertices,h=f.vertices,k=a.faces,j=f.faces,m=a.uvs;f=f.uvs;c&&b.matrixAutoUpdate&&b.updateMatrix();for(var o=0,w=h.length;o<w;o++){var u=new THREE.Vertex(h[o].position.clone());c&&b.localMatrix.multiplyVector3(u.position);g.push(u)}o=0;for(w=j.length;o<w;o++){h=j[o];var t,x=h.vertexNormals;if(h instanceof THREE.Face3)t=new THREE.Face3(h.a+d,h.b+d,h.c+d);else h instanceof THREE.Face4&&(t=new THREE.Face4(h.a+
 d,h.b+d,h.c+d,h.d+d));t.centroid.copy(h.centroid);t.normal.copy(h.normal);c=0;for(g=x.length;c<g;c++){u=x[c];t.vertexNormals.push(u.clone())}t.materials=h.materials.slice();k.push(t)}o=0;for(w=f.length;o<w;o++){d=f[o];k=[];c=0;for(g=d.length;c<g;c++)k.push(new THREE.UV(d[c].u,d[c].v));m.push(k)}}},ImageUtils={loadTexture:function(a,b,c){var d=new Image;d.onload=function(){this.loaded=!0;c&&c(this)};d.src=a;return new THREE.Texture(d,b)},loadArray:function(a,b){var c,d,f=[];c=f.loadCount=0;for(d=a.length;c<
 d;++c){f[c]=new Image;f[c].loaded=0;f[c].onload=function(){f.loadCount+=1;this.loaded=!0;b&&b(this)};f[c].src=a[c]}return f}};if(!window.requestAnimationFrame)window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();
 var SceneUtils={loadScene:function(a,b,c,d){a=new Worker(a);a.postMessage(0);a.onmessage=function(f){function g(){for(o in L.objects)if(!G.objects[o]){A=L.objects[o];if(q=G.geometries[A.geometry]){ba=[];for(i=0;i<A.materials.length;i++)ba[i]=G.materials[A.materials[i]];F=A.position;r=A.rotation;s=A.scale;object=new THREE.Mesh(q,ba);object.position.set(F[0],F[1],F[2]);object.rotation.set(r[0],r[1],r[2]);object.scale.set(s[0],s[1],s[2]);object.visible=A.visible;G.scene.addObject(object);G.objects[o]=

+ 1 - 1
examples/misc_webglrenderer2_sandbox.html

@@ -191,8 +191,8 @@
 					mesh.rotation.x = Math.random() * 360 * ( Math.PI / 180 );
 					mesh.rotation.y = Math.random() * 360 * ( Math.PI / 180 );
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 4 + 1;
+					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
-					mesh.autoUpdateMatrix = false;
 					scene.addObject( mesh );
 
 				}

+ 4 - 4
examples/webgl_materials_shaders_fresnel.html

@@ -108,14 +108,14 @@
 					mesh.position.y = Math.random() * 10000 - 5000;
 					mesh.position.z = Math.random() * 10000 - 5000;
 					mesh.scale.x = mesh.scale.y = mesh.scale.z = Math.random() * 4 + 1;
-					mesh.autoUpdateMatrix = false;
+					mesh.matrixAutoUpdate = false;
 					mesh.updateMatrix();
 					scene.addObject( mesh );
-					
+
 				}
 
-				scene.autoUpdateMatrix = false;
-				
+				scene.matrixAutoUpdate = false;
+
 				SceneUtils.addPanoramaCubeWebGL( sceneCube, 100000, textureCube );
 
 				webglRenderer = new THREE.WebGLRenderer();

+ 86 - 86
examples/webgl_ribbons.html

@@ -18,49 +18,49 @@
 			a {
 				color:#0078ff;
 			}
-			
+
             #info {
 				color:#fff;
                 position: absolute;
                 top: 0px; width: 100%;
                 padding: 5px;
 				z-index:100;
-				
-            }			
-		</style>		
+
+            }
+		</style>
 	</head>
-	
+
 	<body>
-		
+
 		<script type="text/javascript" src="../build/ThreeExtras.js"></script>
 		<script type="text/javascript" src="js/Stats.js"></script>
 
         <div id="info">
 			<a href="http://github.com/mrdoob/three.js" target="_blank">three.js</a> - webgl ribbons example
 		</div>
-		
+
 
 		<script type="text/javascript">
 
 			if ( ! THREE.Detector.webgl ) THREE.Detector.addGetWebGLMessage();
-			
+
 			window.onload = init;
 
 			var container, stats;
 			var camera, scene, renderer, ribbon, geometry, geometry2, materials = [], ribbons = [],
 				parameters, i, i2, h, color, x, y, z, z2, s, n, n2, nribbons, grid;
-				
+
 			var mouseX = 0, mouseY = 0;
 
 			var windowHalfX = window.innerWidth / 2;
 			var windowHalfY = window.innerHeight / 2;
 
 			var postprocessing = {
-				
+
 				enabled  : true
-				
+
 			};
-			
+
 			function init() {
 
 				container = document.createElement( 'div' );
@@ -71,32 +71,32 @@
 
 				scene = new THREE.Scene();
 				scene.fog = new THREE.FogExp2( 0x000000, 0.0016 );
-				
+
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( window.innerWidth, window.innerHeight );
 				container.appendChild( renderer.domElement );
-				
+
 				renderer.setClearColor( scene.fog.color, 1 );
-				
-				geometry = new THREE.Geometry();			
+
+				geometry = new THREE.Geometry();
 				geometry2 = new THREE.Geometry();
-				
+
 				n = 1000;
 				n2 = 2 * n;
-				
+
 				for ( i = -n; i < n; i++ ) {
 
 					i2 = i + n;
-					
+
 					x = i * 1.175;
 					y = ( i2 % 2 ) * 5;
-					
+
 					if ( i2 % 2 )  {
-					
+
 						z = 10 * Math.sin( i2 * 0.3 ) * Math.cos( i2 * 0.1 );
-						
+
 					}
-					
+
 					vector = new THREE.Vector3( x, y, z );
 					geometry.vertices.push( new THREE.Vertex( vector ) );
 
@@ -113,19 +113,19 @@
 					geometry2.colors.push( color );
 
 				}
-				
+
 				var material_base = new THREE.MeshBasicMaterial( { color:0xffffff, vertex_colors:true } );
-				
+
 				renderer.initMaterial( material_base, scene.lights, scene.fog );
-				
+
 				xgrid = 34;
 				ygrid = 15;
 				nribbons = xgrid * ygrid;
-				
+
 				c = 0;
 				for ( i = 0; i < xgrid; i++ )
 				for ( j = 0; j < ygrid; j++ ) {
-					
+
 					materials[c] = new THREE.MeshBasicMaterial( { color:0xffffff, vertex_colors:true } );
 					materials[c].program = material_base.program;
 					materials[c].uniforms = Uniforms.clone( THREE.ShaderLib[ 'basic' ].uniforms );
@@ -134,30 +134,30 @@
 					ribbon.rotation.x = 1.57;
 					ribbon.rotation.y = 1.57;
 					ribbon.rotation.z = -3.14;
-					
+
 					x = 40 * ( i - xgrid/2 );
 					y = 40 * ( j - ygrid/2 );
 					z = 0;
 					ribbon.position.set( x, y, z );
-					
-					materials[c].color.setHSV( i/xgrid, 0.3 +  0.7*j/ygrid, 1 );					
-					
+
+					materials[c].color.setHSV( i/xgrid, 0.3 +  0.7*j/ygrid, 1 );
+
 					ribbon.doubleSided = true;
-					ribbon.autoUpdateMatrix = false;
+					ribbon.matrixAutoUpdate = false;
 					ribbon.updateMatrix();
-					
+
 					ribbons.push( ribbon );
 					scene.addObject( ribbon );
-					
+
 					c++;
-					
+
 				}
 
-				scene.autoUpdateMatrix = false;				
+				scene.matrixAutoUpdate = false;
 
 				initPostprocessing();
 				renderer.autoClear = false;
-				
+
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
 				stats.domElement.style.top = '0px';
@@ -166,16 +166,16 @@
 				document.addEventListener( 'mousemove', onDocumentMouseMove, false );
 				document.addEventListener( 'touchstart', onDocumentTouchStart, false );
 				document.addEventListener( 'touchmove', onDocumentTouchMove, false );
-				
+
 				loop();
-				
+
 			}
 
 			function onDocumentMouseMove( event ) {
 
 				mouseX = event.clientX - windowHalfX;
 				mouseY = event.clientY - windowHalfY;
-				
+
 			}
 
 			function onDocumentTouchStart( event ) {
@@ -186,7 +186,7 @@
 
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
-					
+
 				}
 			}
 
@@ -198,19 +198,19 @@
 
 					mouseX = event.touches[ 0 ].pageX - windowHalfX;
 					mouseY = event.touches[ 0 ].pageY - windowHalfY;
-					
+
 				}
-				
+
 			}
-			
+
 			function initPostprocessing() {
-				
-				postprocessing.scene = new THREE.Scene();		
-				
+
+				postprocessing.scene = new THREE.Scene();
+
 				postprocessing.camera = new THREE.Camera();
 				postprocessing.camera.projectionMatrix = THREE.Matrix4.makeOrtho( window.innerWidth / - 2, window.innerWidth / 2,  window.innerHeight / 2, window.innerHeight / - 2, -10000, 10000 );
 				postprocessing.camera.position.z = 100;
-				
+
 				var pars = { min_filter: THREE.LinearFilter, mag_filter: THREE.LinearFilter };
                 postprocessing.rtTexture1 = new THREE.RenderTarget( window.innerWidth, window.innerHeight, pars );
                 postprocessing.rtTexture2 = new THREE.RenderTarget( 512, 512, pars );
@@ -218,10 +218,10 @@
 
 				var screen_shader = ShaderUtils.lib["screen"];
 				var screen_uniforms = Uniforms.clone( screen_shader.uniforms );
-				
+
 				screen_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
 				screen_uniforms["opacity"].value = 1.0;
-				
+
                 postprocessing.materialScreen = new THREE.MeshShaderMaterial( {
 
                     uniforms: screen_uniforms,
@@ -230,8 +230,8 @@
 					blending: THREE.AdditiveBlending
 
                 } );
-				
-				
+
+
 				var convolution_shader = ShaderUtils.lib["convolution"];
 				var convolution_uniforms = Uniforms.clone( convolution_shader.uniforms );
 
@@ -241,7 +241,7 @@
 				convolution_uniforms["tDiffuse"].texture = postprocessing.rtTexture1;
 				convolution_uniforms["uImageIncrement"].value = postprocessing.blurx;
 				convolution_uniforms["cKernel"].value = ShaderUtils.buildKernel( 4.0 );
-				
+
                 postprocessing.materialConvolution = new THREE.MeshShaderMaterial( {
 
                     uniforms: convolution_uniforms,
@@ -249,94 +249,94 @@
                     fragment_shader: "#define KERNEL_SIZE 25\n"   + convolution_shader.fragment_shader
 
                 } );
-				
-				
+
+
 				postprocessing.quad = new THREE.Mesh( new Plane( window.innerWidth, window.innerHeight ), postprocessing.materialConvolution );
 				postprocessing.quad.position.z = -500;
 				postprocessing.scene.addObject( postprocessing.quad );
 
-			}			
+			}
 
 			function loop() {
 
 				requestAnimationFrame( loop, renderer.domElement );
 
 				var time = new Date().getTime() * 0.00005;
-				
+
 				camera.position.x += ( mouseX - camera.position.x ) * 0.036;
 				camera.position.y += ( - (mouseY) - camera.position.y ) * 0.036;
-				
+
 				for ( i = -n; i < n; i++ ) {
 
 					i2 = i + n;
-					
+
 					z  =  10 * Math.sin( i2 * 0.1 + time*30 );
 					z2 =  20 * Math.cos( Math.sin( i2 * 0.1 + time * 20 ) );
-					
+
 					geometry.vertices[i2].position.z = z;
-					geometry2.vertices[i2].position.z = z2;	
-					
+					geometry2.vertices[i2].position.z = z2;
+
 				}
-				
+
 				geometry.__dirtyVertices = true;
 				geometry2.__dirtyVertices = true;
 
 
 				for( i = 0; i < nribbons; i++ ) {
-					
+
 					h = ( 360 * ( i/nribbons + time ) % 360 ) / 360;
-					materials[i].color.setHSV( h, 0.5+0.5*(i%20/20), 1 );					
-					
+					materials[i].color.setHSV( h, 0.5+0.5*(i%20/20), 1 );
+
 				}
 
 				if ( postprocessing.enabled ) {
-				
+
 					renderer.clear();
-					
+
 					// Render scene into texture
-					
+
 					renderer.render( scene, camera, postprocessing.rtTexture1 );
 
 					// Render quad with blured scene into texture (convolution pass 1)
-					
+
 					postprocessing.quad.materials = [ postprocessing.materialConvolution ];
-					
+
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blurx;
-					
+
 					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture2 );
-					
+
 					// Render quad with blured scene into texture (convolution pass 2)
-					
+
 					postprocessing.materialConvolution.uniforms.tDiffuse.texture = postprocessing.rtTexture2;
 					postprocessing.materialConvolution.uniforms.uImageIncrement.value = postprocessing.blury;
-					
+
 					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture3 );
-					
+
 					// Render original scene with superimposed blur to texture
-					
+
 					postprocessing.quad.materials = [ postprocessing.materialScreen ];
-					
+
 					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture3;
 					postprocessing.materialScreen.uniforms.opacity.value = 1.2;
-					
+
 					renderer.render( postprocessing.scene, postprocessing.camera, postprocessing.rtTexture1, false );
 
 					// Render to screen
 
 					postprocessing.materialScreen.uniforms.tDiffuse.texture = postprocessing.rtTexture1;
-					renderer.render( postprocessing.scene, postprocessing.camera );					
-					
+					renderer.render( postprocessing.scene, postprocessing.camera );
+
 				} else {
-					
+
 					renderer.clear();
 					renderer.render( scene, camera );
-					
+
 				}
 
 				stats.update();
-				
-				
+
+
 
 			}
 

+ 111 - 111
examples/webgl_scene_test.html

@@ -13,7 +13,7 @@
 				font-family:georgia;
 				text-align:center;
 			}
-			
+
 			#info {
 				position: absolute;
 				top: 0px; width: 100%;
@@ -23,7 +23,7 @@
 				text-align: center;
 				z-index:100;
 			}
-			
+
 			#progress {
 				color:red;
 				top:7em;
@@ -37,7 +37,7 @@
 				text-shadow: #000 0px 0px 10px;
 				display:none;
 			}
-			
+
 			#start {
 				color:#fff;
 				text-shadow: #000 0px 0px 2px;
@@ -46,44 +46,44 @@
 				text-align: center;
 				display:none;
 			}
-			
+
 			.shadow {
 				-moz-box-shadow: 0px 0px 5px #000;
 				-webkit-box-shadow: 0px 0px 5px #000;
 				box-shadow: 0px 0px 5px #000;
 			}
-			
+
 			#progressbar {
 				text-align: center;
 				background: white;
 				width: 250px;
 				height: 10px;
 			}
-			
+
 			#bar {
 				background:#d00;
 				width:50px;
 				height:10px;
 			}
-			
+
 			.enabled {
 				color: lime!important;
 				cursor:pointer;
 			}
-			
+
 			.enabled:hover {
 				text-shadow: #0f0 0px 0px 5px !important;
 			}
-			
+
 			.disabled {
 				background:gray;
 				cursor:default;
 			}
-			
+
 			a { color:red }
 			canvas { pointer-events:none; z-index:10; }
 			#log { position:absolute; top:0; display:block; text-align:left; z-index:1000; pointer-events:none; }
-			
+
 			#scene_explorer {
 				background:transparent;
 				color:#fff;
@@ -94,20 +94,20 @@
 				z-index:200;
 				overflow:auto;
 			}
-			
+
 			#section_exp {
 				background:rgba(0,0,50,0.5);
 				padding:0.5em 0;
 				display:none;
 			}
-			
-			#scene_explorer h3 { 
+
+			#scene_explorer h3 {
 				font-size:1em;
 				padding:0;
 				margin:0;
 				color:orange;
 			}
-			
+
 			#scene_explorer a {
 				color:#555;
 				font-weight:bold;
@@ -119,12 +119,12 @@
 				background:#555;
 				color:rgba(0,0,50,1);
 			}
-			
+
 			.part {
 				display:none;
 				padding:0 0 0.5em 2em;
 			}
-			
+
 		</style>
 	</head>
 
@@ -132,7 +132,7 @@
 		<div id="info">
 			<a href="http://github.com/mrdoob/three.js">three.js</a> - scene loader test
 		</div>
-		
+
 		<div id="scene_explorer">
 			<a id="plus_exp" href="#">[+]</a>
 			<div id="section_exp"></div>
@@ -140,13 +140,13 @@
 
 		<div id="progress">
 			<span id="message">Loading ...</span>
-			
+
 			<center>
 				<div id="progressbar" class="shadow"><div id="bar" class="shadow"></div></div>
 				<div id="start" class="disabled">Start</div>
 			</center>
 		</div>
-		
+
 		<pre id="log"></pre>
 
 		<script type="text/javascript" src="../build/ThreeExtras.js"></script>
@@ -155,7 +155,7 @@
 		<script type="text/javascript">
 
 			if ( ! THREE.Detector.webgl ) THREE.Detector.addGetWebGLMessage();
-			
+
 			var SCREEN_WIDTH = window.innerWidth;
 			var SCREEN_HEIGHT = window.innerHeight;
 
@@ -176,44 +176,44 @@
 			init();
 
 			function $( id ) {
-				
+
 				return document.getElementById( id );
-				
+
 			}
-			
+
 			function handle_update( result, pieces ) {
-				
+
 				refreshSceneView( result );
 				renderer.initWebGLObjects( result.scene );
-				
+
 				var m, material, count = 0;
-				
+
 				for ( m in result.materials ) {
-				
+
 					material = result.materials[ m ];
 					if ( ! ( material instanceof THREE.MeshFaceMaterial ) ) {
-						
+
 						if( !material.program ) {
-						
+
 							console.log(m);
 							renderer.initMaterial( material, result.scene.lights, result.scene.fog );
-							
+
 							count += 1;
 							if( count > pieces ) {
-								
+
 								//console.log("xxxxxxxxx");
 								break;
-							
+
 							}
-							
+
 						}
-						
+
 					}
-					
+
 				}
-				
+
 			}
-			
+
 			function init() {
 
 				container = document.createElement( 'div' );
@@ -222,7 +222,7 @@
 				var loadScene = createLoadScene();
 				scene  = loadScene.scene;
 				camera = loadScene.camera;
-				
+
 				renderer = new THREE.WebGLRenderer();
 				renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
 				renderer.domElement.style.position = "relative";
@@ -240,49 +240,49 @@
 				setInterval( loop, 1000/60 );
 
 				var callback_progress = function( progress, result ) {
-				
-					var bar = 250, 
+
+					var bar = 250,
 						total = progress.total_models + progress.total_textures,
 						loaded = progress.loaded_models + progress.loaded_textures;
-					
+
 					if ( total )
 						bar = Math.floor( bar * loaded / total );
-					
+
 					$( "bar" ).style.width = bar + "px";
-					
+
 					count = 0;
 					for ( var m in result.materials ) count++;
 
 					handle_update( result, Math.floor( count/total ) );
-					
+
 				}
-				
+
 				var callback_sync = function( result ) {
-				
+
 					/*
-					
+
 					// uncomment to see progressive scene loading
-					
+
 					scene = result.scene;
 					camera = result.currentCamera;
-					
+
 					camera.aspect = window.innerWidth / window.innerHeight;
 					camera.updateProjectionMatrix();
-					
+
 					renderer.setClearColor( result.bgColor, result.bgAlpha );
-					
+
 					*/
 
 					//handle_update( result, 1 );
-					
+
 				}
-				
+
 				var callback_async = function( result ) {
-				
+
 					loaded = result;
-					
+
 					var mat_veyron = result.geometries[ "veyron" ].materials;
-					
+
 					mat_veyron[ 0 ][ 0 ] = result.materials[ "interior" ];
 					mat_veyron[ 1 ][ 0 ] = result.materials[ "chrome" ];
 					mat_veyron[ 2 ][ 0 ] = result.materials[ "darkerchrome" ];
@@ -291,43 +291,43 @@
 					mat_veyron[ 5 ][ 0 ] = result.materials[ "chrome" ];
 					mat_veyron[ 6 ][ 0 ] = result.materials[ "backlights" ];
 					mat_veyron[ 7 ][ 0 ] = result.materials[ "backsignals" ];
-					
+
 					$( "message" ).style.display = "none";
 					$( "progressbar" ).style.display = "none";
 					$( "start" ).style.display = "block";
 					$( "start" ).className = "enabled";
-					
+
 					handle_update( result, 1 );
-					
+
 				}
-				
+
 				$( "progress" ).style.display = "block";
 				SceneUtils.loadScene( "scenes/test_scene.js", callback_sync, callback_async, callback_progress );
-				
+
 				$( "plus_exp" ).addEventListener( 'click', createToggle( "exp" ), false );
 
 			}
 
 			function setButtonActive( id ) {
-			
+
 				$( "start" ).style.backgroundColor = "green";
-					
+
 			}
-			
+
 			function onStartClick() {
-			
+
 				$( "progress" ).style.display = "none";
-				
+
 				scene = loaded.scene;
 				camera = loaded.currentCamera;
-				
+
 				camera.aspect = window.innerWidth / window.innerHeight;
 				camera.updateProjectionMatrix();
-				
+
 				renderer.setClearColor( loaded.bgColor, loaded.bgAlpha );
-				
+
 			}
-			
+
 			function onDocumentMouseMove(event) {
 
 				mouseX = ( event.clientX - windowHalfX );
@@ -336,23 +336,23 @@
 			}
 
 			function createLoadScene() {
-			
+
 				var result = {
-				
+
 					scene:  new THREE.Scene(),
 					camera: new THREE.Camera( 65, window.innerWidth / window.innerHeight, 1, 1000 )
-					
+
 				};
-				
+
 				result.camera.position.z = 100;
-				
+
 				var object, geometry, material, light, count = 500, range = 200;
-				
+
 				material = new THREE.MeshLambertMaterial( { color:0xffffff } );
 				geometry = new Cube( 5, 5, 5 );
-				
+
 				for( var i = 0; i < count; i++ ) {
-				
+
 					object = new THREE.Mesh( geometry, material );
 					object.position.x = ( Math.random() - 0.5 ) * range;
 					object.position.y = ( Math.random() - 0.5 ) * range;
@@ -360,14 +360,14 @@
 					object.rotation.x = Math.random() * 6;
 					object.rotation.y = Math.random() * 6;
 					object.rotation.z = Math.random() * 6;
-					object.autoUpdateMatrix = false;
+					object.matrixAutoUpdate = false;
 					object.updateMatrix();
 					result.scene.addObject( object );
-					
+
 				}
-				
-				result.scene.autoUpdateMatrix = false;
-				
+
+				result.scene.matrixAutoUpdate = false;
+
 				light = new THREE.PointLight( 0xffffff );
 				result.scene.addLight( light );
 
@@ -376,9 +376,9 @@
 				result.scene.addLight( light );
 
 				return result;
-				
+
 			}
-			
+
 			function loop() {
 
 				camera.position.x += ( mouseX - camera.position.x ) * .001;
@@ -398,60 +398,60 @@
 			}
 
 			// Scene explorer user interface
-			
+
 			function toggle( id ) {
-				
+
 				var scn = $( "section_" + id ).style,
 					btn = $( "plus_" + id );
-				
+
 				if ( scn.display == "block" ) {
-				
+
 					scn.display = "none";
 					btn.innerHTML = "[+]";
-					
+
 				}
 				else {
-					
+
 					scn.display = "block";
 					btn.innerHTML = "[-]";
-					
+
 				}
-					
+
 			}
-			
+
 			function createToggle( label ) { return function() { toggle( label ) } };
-			
+
 			function refreshSceneView( result ) {
-				
+
 				$( "section_exp" ).innerHTML = generateSceneView( result );
 
 				var config = [ "obj", "geo", "mat", "tex", "lit", "cam" ];
-				
+
 				for ( var i = 0; i < config.length; i++ )
 					$( "plus_" + config[i] ).addEventListener( 'click', createToggle( config[i] ), false );
 
 			}
-			
+
 			function generateSection( label, id, objects ) {
-				
+
 				var html = "";
-				
+
 				html += "<h3><a id='plus_" + id + "' href='#'>[+]</a> " + label + "</h3>";
 				html += "<div id='section_" + id + "' class='part'>";
-				
+
 				for( var o in objects ) {
-				
+
 					html += o + "<br/>";
-					
+
 				}
 				html += "</div>";
-				
+
 				return html;
-			
+
 			}
-			
+
 			function generateSceneView( result ) {
-				
+
 				var config = [
 				[ "Objects",    "obj", result.objects ],
 				[ "Geometries", "geo", result.geometries ],
@@ -460,14 +460,14 @@
 				[ "Lights",     "lit", result.lights ],
 				[ "Cameras",    "cam", result.cameras ]
 				];
-				
+
 				var html = "";
-				
+
 				for ( var i = 0; i < config.length; i++ )
 					html += generateSection( config[i][0], config[i][1], config[i][2] );
 
 				return html;
-				
+
 			}
 
 		</script>

+ 5 - 5
src/animation/Animation.js

@@ -54,7 +54,7 @@ THREE.Animation.prototype.play = function( loop ) {
 		for( var h = 0; h < this.hierarchy.length; h++ ) {
 			
 			this.hierarchy[ h ].useQuaternion    = true;
-			this.hierarchy[ h ].autoUpdateMatrix = true;
+			this.hierarchy[ h ].matrixAutoUpdate = true;
 			
 			if( this.hierarchy[ h ].prevKey === undefined ) {
 				
@@ -159,8 +159,8 @@ THREE.Animation.prototype.update = function( time ) {
 		if( JIThierarchy[ h ][ frame ] !== undefined ) {
 
 			object.skinMatrix           = JIThierarchy[ h ][ frame ];
-			object.autoUpdateMatrix     = false;
-			object.matrixNeedsToUpdate  = false;
+			object.matrixAutoUpdate     = false;
+			object.matrixNeedsUpdate  = false;
 			
 			//object.skinMatrix.flattenToArray( this.root.boneMatrices[ h ] );
 			object.skinMatrix.flattenToArrayOffset( this.root.boneMatrices, h * 16 );
@@ -214,8 +214,8 @@ THREE.Animation.prototype.update = function( time ) {
 				
 				// interpolate rot (quaternion slerp)
 				
-				object.autoUpdateMatrix    = true;
-				object.matrixNeedsToUpdate = true;
+				object.matrixAutoUpdate = true;
+				object.matrixNeedsUpdate = true;
 				
 				scale   = ( currentTime - prevKey.time ) / ( nextKey.time - prevKey.time );
 				prevXYZ = prevKey[ type ];

+ 3 - 3
src/cameras/Camera.js

@@ -98,17 +98,17 @@ THREE.Camera.prototype.update = function( parentGlobalMatrix, forceUpdate, camer
 
 	} else {
 
-		if( this.autoUpdateMatrix )
+		if( this.matrixAutoUpdate )
 			forceUpdate |= this.updateMatrix();
 
-		if( forceUpdate || this.matrixNeedsToUpdate ) {
+		if( forceUpdate || this.matrixNeedsUpdate ) {
 
 			if( parentGlobalMatrix )
 				this.globalMatrix.multiply( parentGlobalMatrix, this.localMatrix );
 			else
 				this.globalMatrix.copy( this.localMatrix );
 
-			this.matrixNeedsToUpdate = false;
+			this.matrixNeedsUpdate = false;
 			forceUpdate              = true;
 
 			THREE.Matrix4.makeInvert( this.globalMatrix, this.inverseMatrix );

+ 16 - 16
src/core/Color.js

@@ -4,13 +4,14 @@
 
 THREE.Color = function ( hex ) {
 
-	this.autoUpdate = true;
 	this.setHex( hex );
 
 };
 
 THREE.Color.prototype = {
 
+	autoUpdate: true,
+
 	setRGB: function ( r, g, b ) {
 
 		this.r = r;
@@ -26,27 +27,27 @@ THREE.Color.prototype = {
 
 	},
 
-	// based on MochiKit implementation by Bob Ippolito
-	// h,s,v ranges are < 0.0 - 1.0 >
-	
 	setHSV: function ( h, s, v ) {
 
+		// based on MochiKit implementation by Bob Ippolito
+		// h,s,v ranges are < 0.0 - 1.0 >
+
 		var red, green, blue, i, f, p, q, t;
-		
+
 		if ( v == 0.0 ) {
-			
+
 			red = green = blue = 0;
-			
+
 		} else {
-			
+
 			i = Math.floor( h * 6 );
 			f = ( h * 6 ) - i;
 			p = v * ( 1 - s );
 			q = v * ( 1 - ( s * f ) );
 			t = v * ( 1 - ( s * ( 1 - f ) ) );
-			
+
 			switch ( i ) {
-				
+
 				case 1: red = q; green = v; blue = p; break;
 				case 2: red = p; green = v; blue = t; break;
 				case 3: red = p; green = q; blue = v; break;
@@ -54,11 +55,11 @@ THREE.Color.prototype = {
 				case 5: red = v; green = p; blue = q; break;
 				case 6: // fall through
 				case 0: red = v; green = t; blue = p; break;
-				
+
 			}
-		
+
 		}
-		
+
 		this.r = red;
 		this.g = green;
 		this.b = blue;
@@ -69,9 +70,9 @@ THREE.Color.prototype = {
 			this.updateStyleString();
 
 		}
-		
+
 	},
-	
+
 	setHex: function ( hex ) {
 
 		this.hex = ( ~~ hex ) & 0xffffff;
@@ -111,7 +112,6 @@ THREE.Color.prototype = {
 
 	},
 
-
 	toString: function () {
 
 		return 'THREE.Color ( r: ' + this.r + ', g: ' + this.g + ', b: ' + this.b + ', hex: ' + this.hex + ' )';

+ 1 - 1
src/extras/GeometryUtils.js

@@ -14,7 +14,7 @@ var GeometryUtils = {
 		uvs1 = geometry1.uvs,
 		uvs2 = geometry2.uvs;
 
-		isMesh && object2.autoUpdateMatrix && object2.updateMatrix();
+		isMesh && object2.matrixAutoUpdate && object2.updateMatrix();
 
 		for ( var i = 0, il = vertices2.length; i < il; i ++ ) {
 

+ 5 - 5
src/objects/Bone.js

@@ -25,21 +25,21 @@ THREE.Bone.prototype.update = function( parentSkinMatrix, forceUpdate, camera )
 	
 	// update local
 	
-	if( this.autoUpdateMatrix )
+	if( this.matrixAutoUpdate )
 		forceUpdate |= this.updateMatrix();			
 
 	
 	// update skin matrix
 
-	if( forceUpdate || this.matrixNeedsToUpdate ) {
+	if( forceUpdate || this.matrixNeedsUpdate ) {
 		
 		if( parentSkinMatrix )
 			this.skinMatrix.multiply( parentSkinMatrix, this.localMatrix );
 		else
 			this.skinMatrix.copy( this.localMatrix );
 		
-		this.matrixNeedsToUpdate = false;
-		forceUpdate              = true;
+		this.matrixNeedsUpdate = false;
+		forceUpdate = true;
 
 	}
 
@@ -96,4 +96,4 @@ THREE.Bone.prototype.addChild = function( child ) {
 
 /*
  * Todo: Remove Children: see if any remaining are none-Bone
- */
+ */

+ 3 - 3
src/objects/LOD.js

@@ -43,20 +43,20 @@ THREE.LOD.prototype.update = function( parentGlobalMatrix, forceUpdate, camera )
 	
 	// update local
 	
-	if( this.autoUpdateMatrix )
+	if( this.matrixAutoUpdate )
 		forceUpdate |= this.updateMatrix();
 
 
 	// update global
 
-	if( forceUpdate || this.matrixNeedsToUpdate ) {
+	if( forceUpdate || this.matrixNeedsUpdate ) {
 		
 		if( parentGlobalMatrix )
 			this.globalMatrix.multiply( parentGlobalMatrix, this.localMatrix );
 		else
 			this.globalMatrix.copy( this.localMatrix );
 		
-		this.matrixNeedsToUpdate = false;
+		this.matrixNeedsUpdate = false;
 		forceUpdate              = true;
 
 	}

+ 3 - 3
src/objects/Mesh.js

@@ -45,20 +45,20 @@ THREE.Mesh.prototype.update = function( parentGlobalMatrix, forceUpdate, camera
 
 		// update local
 		
-		if( this.autoUpdateMatrix )
+		if( this.matrixAutoUpdate )
 			forceUpdate |= this.updateMatrix();
 
 
 		// update global
 
-		if( forceUpdate || this.matrixNeedsToUpdate ) {
+		if( forceUpdate || this.matrixNeedsUpdate ) {
 			
 			if( parentGlobalMatrix )
 				this.globalMatrix.multiply( parentGlobalMatrix, this.localMatrix );
 			else
 				this.globalMatrix.copy( this.localMatrix );
 			
-			this.matrixNeedsToUpdate = false;
+			this.matrixNeedsUpdate = false;
 			forceUpdate               = true;			
 
 		}

+ 5 - 5
src/objects/Object3D.js

@@ -9,8 +9,8 @@ THREE.Object3D = function() {
 	this.id = THREE.Object3DCounter.value ++;
 
 	this.visible = true;
-	this.autoUpdateMatrix = true;
-	this.matrixNeedsToUpdate = true;
+	this.matrixAutoUpdate = true;
+	this.matrixNeedsUpdate = true;
 
 	this.parent = undefined;
 	this.children = [];
@@ -44,20 +44,20 @@ THREE.Object3D.prototype.update = function( parentGlobalMatrix, forceUpdate, cam
 
 		// update local
 
-		if( this.autoUpdateMatrix )
+		if( this.matrixAutoUpdate )
 			forceUpdate |= this.updateMatrix();
 
 
 		// update global
 
-		if( forceUpdate || this.matrixNeedsToUpdate ) {
+		if( forceUpdate || this.matrixNeedsUpdate ) {
 
 			if( parentGlobalMatrix )
 				this.globalMatrix.multiply( parentGlobalMatrix, this.localMatrix );
 			else
 				this.globalMatrix.copy( this.localMatrix );
 
-			this.matrixNeedsToUpdate = false;
+			this.matrixNeedsUpdate = false;
 			forceUpdate              = true;
 
 		}

+ 1 - 1
src/objects/Particle.js

@@ -8,7 +8,7 @@ THREE.Particle = function ( materials ) {
 
 	this.materials = materials instanceof Array ? materials : [ materials ];
 
-	this.autoUpdateMatrix = false;
+	this.matrixAutoUpdate = false;
 
 };
 

+ 3 - 3
src/objects/SkinnedMesh.js

@@ -83,20 +83,20 @@ THREE.SkinnedMesh.prototype.update = function( parentGlobalMatrix, forceUpdate,
 
 		// update local
 		
-		if( this.autoUpdateMatrix )
+		if( this.matrixAutoUpdate )
 			forceUpdate |= this.updateMatrix();
 
 
 		// update global
 
-		if( forceUpdate || this.matrixNeedsToUpdate ) {
+		if( forceUpdate || this.matrixNeedsUpdate ) {
 			
 			if( parentGlobalMatrix )
 				this.globalMatrix.multiply( parentGlobalMatrix, this.localMatrix );
 			else
 				this.globalMatrix.copy( this.localMatrix );
 			
-			this.matrixNeedsToUpdate = false;
+			this.matrixNeedsUpdate = false;
 			forceUpdate              = true;
 
 		}

+ 2 - 2
src/renderers/Projector.js

@@ -72,7 +72,7 @@ THREE.Projector = function() {
 
 		_face3Count = _lineCount = _particleCount = 0;
 
-		camera.autoUpdateMatrix && camera.update();
+		camera.matrixAutoUpdate && camera.update();
 
 		_projScreenMatrix.multiply( camera.projectionMatrix, camera.globalMatrix );
 		computeFrustum( _projScreenMatrix );
@@ -87,7 +87,7 @@ THREE.Projector = function() {
 
 			if ( !object.visible ) continue;
 
-			object.autoUpdateMatrix && object.updateMatrix();
+			object.matrixAutoUpdate && object.updateMatrix();
 
 			objectMatrix = object.globalMatrix;
 			objectMatrix.extractRotationMatrix( object.rotationMatrix );

File diff suppressed because it is too large
+ 196 - 196
src/renderers/WebGLRenderer.js


+ 2 - 2
src/renderers/WebGLRenderer2.js

@@ -97,7 +97,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
 
 		this.autoClear && this.clear();
 
-		camera.autoUpdateMatrix && camera.updateMatrix();
+		camera.matrixAutoUpdate && camera.updateMatrix();
 
 		// Setup camera matrices
 
@@ -127,7 +127,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
 			var geometry, material, m, ml,
 			program, uniforms, attributes;
 
-			object.autoUpdateMatrix && object.updateMatrix();
+			object.matrixAutoUpdate && object.updateMatrix();
 
 			// Setup object matrices
 

Some files were not shown because too many files changed in this diff