|
@@ -132,9 +132,10 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&
|
|
a*16)};
|
|
a*16)};
|
|
THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var e=new THREE.Matrix4;e.getInverse(a.skinMatrix);b.push(e);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,f=this.geometry.skinIndices[a].x,h=this.geometry.skinIndices[a].y,e=
|
|
THREE.SkinnedMesh.prototype.pose=function(){this.updateMatrixWorld(!0);for(var a,b=[],c=0;c<this.bones.length;c++){a=this.bones[c];var e=new THREE.Matrix4;e.getInverse(a.skinMatrix);b.push(e);a.skinMatrix.flattenToArrayOffset(this.boneMatrices,c*16)}if(this.geometry.skinVerticesA===void 0){this.geometry.skinVerticesA=[];this.geometry.skinVerticesB=[];for(a=0;a<this.geometry.skinIndices.length;a++){var c=this.geometry.vertices[a].position,f=this.geometry.skinIndices[a].x,h=this.geometry.skinIndices[a].y,e=
|
|
new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(e));e=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[h].multiplyVector3(e));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)}}};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
|
|
new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesA.push(b[f].multiplyVector3(e));e=new THREE.Vector3(c.x,c.y,c.z);this.geometry.skinVerticesB.push(b[h].multiplyVector3(e));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)}}};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b};
|
|
-THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
|
|
|
|
-THREE.LOD.prototype.update=function(a,b,c){this.matrixAutoUpdate&&(b|=this.updateMatrix());if(b||this.matrixWorldNeedsUpdate)a?this.matrixWorld.multiply(a,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,b=!0;if(this.LODs.length>1){a=c.matrixWorldInverse;a=-(a.n31*this.position.x+a.n32*this.position.y+a.n33*this.position.z+a.n34);this.LODs[0].object3D.visible=!0;for(var e=1;e<this.LODs.length;e++)if(a>=this.LODs[e].visibleAtDistance)this.LODs[e-1].object3D.visible=!1,
|
|
|
|
-this.LODs[e].object3D.visible=!0;else break;for(;e<this.LODs.length;e++)this.LODs[e].object3D.visible=!1}for(a=0;a<this.children.length;a++)this.children[a].update(this.matrixWorld,b,c)};
|
|
|
|
|
|
+THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(a){THREE.Object3D.call(this);this.camera=a;this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;
|
|
|
|
+THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c<this.LODs.length;c++)if(b<this.LODs[c].visibleAtDistance)break;this.LODs.splice(c,0,{visibleAtDistance:b,object3D:a});this.add(a)};
|
|
|
|
+THREE.LOD.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)this.parent?this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;var b=this.camera;if(this.LODs.length>1){var b=b.matrixWorldInverse,c=-(b.n31*this.position.x+b.n32*this.position.y+b.n33*this.position.z+b.n34);this.LODs[0].object3D.visible=!0;for(b=1;b<this.LODs.length;b++)if(c>=this.LODs[b].visibleAtDistance)this.LODs[b-
|
|
|
|
+1].object3D.visible=!1,this.LODs[b].object3D.visible=!0;else break;for(;b<this.LODs.length;b++)this.LODs[b].object3D.visible=!1}c=0;for(b=this.children.length;c<b;c++)this.children[c].updateMatrixWorld(a)};
|
|
THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map instanceof THREE.Texture?a.map:THREE.ImageUtils.loadTexture(a.map);this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:
|
|
THREE.Sprite=function(a){THREE.Object3D.call(this);this.color=a.color!==void 0?new THREE.Color(a.color):new THREE.Color(16777215);this.map=a.map instanceof THREE.Texture?a.map:THREE.ImageUtils.loadTexture(a.map);this.blending=a.blending!==void 0?a.blending:THREE.NormalBlending;this.useScreenCoordinates=a.useScreenCoordinates!==void 0?a.useScreenCoordinates:!0;this.mergeWith3D=a.mergeWith3D!==void 0?a.mergeWith3D:!this.useScreenCoordinates;this.affectedByDistance=a.affectedByDistance!==void 0?a.affectedByDistance:
|
|
!this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
|
|
!this.useScreenCoordinates;this.scaleByViewport=a.scaleByViewport!==void 0?a.scaleByViewport:!this.affectedByDistance;this.alignment=a.alignment instanceof THREE.Vector2?a.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype;
|
|
THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
|
|
THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1);
|
|
@@ -204,7 +205,7 @@ i instanceof THREE.Ribbon&&(d.drawArrays(d.TRIANGLE_STRIP,0,f.__webglVertexCount
|
|
a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,p,q,k,n,o,l=a.count*3;for(o=0;o<l;o+=9)c=a.normalArray,e=c[o],f=c[o+1],h=c[o+2],i=c[o+3],p=c[o+4],k=c[o+5],j=c[o+6],q=c[o+7],n=c[o+8],e=(e+i+j)/3,f=(f+p+q)/3,h=(h+k+n)/3,c[o]=e,c[o+1]=f,c[o+2]=h,c[o+3]=e,c[o+4]=f,c[o+5]=h,c[o+6]=e,c[o+7]=f,c[o+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
a.__webglNormalBuffer);if(c===THREE.FlatShading){var e,f,h,i,j,p,q,k,n,o,l=a.count*3;for(o=0;o<l;o+=9)c=a.normalArray,e=c[o],f=c[o+1],h=c[o+2],i=c[o+3],p=c[o+4],k=c[o+5],j=c[o+6],q=c[o+7],n=c[o+8],e=(e+i+j)/3,f=(f+p+q)/3,h=(h+k+n)/3,c[o]=e,c[o+1]=f,c[o+2]=h,c[o+3]=e,c[o+4]=f,c[o+5]=h,c[o+6]=e,c[o+7]=f,c[o+8]=h}d.bufferData(d.ARRAY_BUFFER,a.normalArray,d.DYNAMIC_DRAW);d.enableVertexAttribArray(b.attributes.normal);d.vertexAttribPointer(b.attributes.normal,3,d.FLOAT,!1,0,0)}d.drawArrays(d.TRIANGLES,
|
|
0,a.count);a.count=0}function i(a){if(va!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),va=a.doubleSided;if(Ga!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),Ga=a.flipSided}function j(a){wa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),wa=a)}function n(a){Ba!==a&&(d.depthMask(a),Ba=a)}function l(a,b,c){ya!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),ya=a);if(a&&($a!==b||ab!==c))d.polygonOffset(b,c),$a=b,ab=c}function o(a){Z[0].set(a.n41-
|
|
0,a.count);a.count=0}function i(a){if(va!==a.doubleSided)a.doubleSided?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),va=a.doubleSided;if(Ga!==a.flipSided)a.flipSided?d.frontFace(d.CW):d.frontFace(d.CCW),Ga=a.flipSided}function j(a){wa!==a&&(a?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),wa=a)}function n(a){Ba!==a&&(d.depthMask(a),Ba=a)}function l(a,b,c){ya!==a&&(a?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL),ya=a);if(a&&($a!==b||ab!==c))d.polygonOffset(b,c),$a=b,ab=c}function o(a){Z[0].set(a.n41-
|
|
a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);Z[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);Z[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);Z[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);Z[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);Z[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(var b,a=0;a<6;a++)b=Z[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}function k(a){for(var b=a.matrixWorld,d=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,
|
|
a.n11,a.n42-a.n12,a.n43-a.n13,a.n44-a.n14);Z[1].set(a.n41+a.n11,a.n42+a.n12,a.n43+a.n13,a.n44+a.n14);Z[2].set(a.n41+a.n21,a.n42+a.n22,a.n43+a.n23,a.n44+a.n24);Z[3].set(a.n41-a.n21,a.n42-a.n22,a.n43-a.n23,a.n44-a.n24);Z[4].set(a.n41-a.n31,a.n42-a.n32,a.n43-a.n33,a.n44-a.n34);Z[5].set(a.n41+a.n31,a.n42+a.n32,a.n43+a.n33,a.n44+a.n34);for(var b,a=0;a<6;a++)b=Z[a],b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}function k(a){for(var b=a.matrixWorld,d=-a.geometry.boundingSphere.radius*Math.max(a.scale.x,
|
|
-Math.max(a.scale.y,a.scale.z)),c=0;c<6;c++)if(a=Z[c].x*b.n14+Z[c].y*b.n24+Z[c].z*b.n34+Z[c].w,a<=d)return!1;return!0}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a){var b=a.object,d=a.buffer,c;c=b.material;if(c instanceof THREE.MeshFaceMaterial){if(d=d.materialIndex,d>=0)b=b.geometry.materials[d],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=c)b.transparent?(a.transparent=b,
|
|
|
|
|
|
+Math.max(a.scale.y,a.scale.z)),c=0;c<6;c++)if(a=Z[c].x*b.n14+Z[c].y*b.n24+Z[c].z*b.n34+Z[c].w,a<=d)return!1;return!0}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a){var b=a.object,c=a.buffer,d;d=b.material;if(d instanceof THREE.MeshFaceMaterial){if(c=c.materialIndex,c>=0)b=b.geometry.materials[c],b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}else if(b=d)b.transparent?(a.transparent=b,
|
|
a.opaque=null):(a.opaque=b,a.transparent=null)}function z(a,b){return b.z-a.z}function B(a){var b,c,n,sa=0,J,l,u,p,q=a.lights;ja||(ja=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar));b=0;for(c=q.length;b<c;b++)if(n=q[b],n instanceof THREE.SpotLight&&n.castShadow){Q=-1;A.shadowMap[sa]||(A.shadowMap[sa]=new THREE.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
a.opaque=null):(a.opaque=b,a.transparent=null)}function z(a,b){return b.z-a.z}function B(a){var b,c,n,sa=0,J,l,u,p,q=a.lights;ja||(ja=new THREE.PerspectiveCamera(A.shadowCameraFov,A.shadowMapWidth/A.shadowMapHeight,A.shadowCameraNear,A.shadowCameraFar));b=0;for(c=q.length;b<c;b++)if(n=q[b],n instanceof THREE.SpotLight&&n.castShadow){Q=-1;A.shadowMap[sa]||(A.shadowMap[sa]=new THREE.WebGLRenderTarget(A.shadowMapWidth,A.shadowMapHeight,{minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat}));
|
|
Ra[sa]||(Ra[sa]=new THREE.Matrix4);J=A.shadowMap[sa];l=Ra[sa];ja.position.copy(n.position);ja.lookAt(n.target.position);ja.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),a.add(ja));a.updateMatrixWorld();ja.matrixWorldInverse.getInverse(ja.matrixWorld);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ja.projectionMatrix);l.multiplySelf(ja.matrixWorldInverse);ja.matrixWorldInverse.flattenToArray(Ua);ja.projectionMatrix.flattenToArray(Ta);Ca.multiply(ja.projectionMatrix,
|
|
Ra[sa]||(Ra[sa]=new THREE.Matrix4);J=A.shadowMap[sa];l=Ra[sa];ja.position.copy(n.position);ja.lookAt(n.target.position);ja.parent==null&&(console.warn("Camera is not on the Scene. Adding it..."),a.add(ja));a.updateMatrixWorld();ja.matrixWorldInverse.getInverse(ja.matrixWorld);l.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);l.multiplySelf(ja.projectionMatrix);l.multiplySelf(ja.matrixWorldInverse);ja.matrixWorldInverse.flattenToArray(Ua);ja.projectionMatrix.flattenToArray(Ta);Ca.multiply(ja.projectionMatrix,
|
|
ja.matrixWorldInverse);o(Ca);ma(J);d.clearColor(1,1,1,1);A.clear();d.clearColor(ga.r,ga.g,ga.b,Ea);l=a.__webglObjects.length;n=a.__webglObjectsImmediate.length;for(J=0;J<l;J++)u=a.__webglObjects[J],p=u.object,p.visible&&p.castShadow?!(p instanceof THREE.Mesh)||!p.frustumCulled||k(p)?(p.matrixWorld.flattenToArray(p._objectMatrixArray),E(p,ja,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);I(THREE.NormalBlending);for(J=0;J<l;J++)if(u=a.__webglObjects[J],u.render)p=u.object,buffer=u.buffer,i(p),u=p.customDepthMaterial?
|
|
ja.matrixWorldInverse);o(Ca);ma(J);d.clearColor(1,1,1,1);A.clear();d.clearColor(ga.r,ga.g,ga.b,Ea);l=a.__webglObjects.length;n=a.__webglObjectsImmediate.length;for(J=0;J<l;J++)u=a.__webglObjects[J],p=u.object,p.visible&&p.castShadow?!(p instanceof THREE.Mesh)||!p.frustumCulled||k(p)?(p.matrixWorld.flattenToArray(p._objectMatrixArray),E(p,ja,!1),u.render=!0):u.render=!1:u.render=!1;j(!0);I(THREE.NormalBlending);for(J=0;J<l;J++)if(u=a.__webglObjects[J],u.render)p=u.object,buffer=u.buffer,i(p),u=p.customDepthMaterial?
|