|
@@ -694,12 +694,17 @@ THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d
|
|
|
"cf2",3355443);b("cf3","cf4",3355443);this.camera=a;this.update(a)};THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);
|
|
|
THREE.CameraHelper.prototype.update=function(){function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=b.pointMap[a];if(a!==void 0){d=0;for(e=a.length;d<e;d++)b.geometry.vertices[a[d]].copy(THREE.CameraHelper.__v)}}var b=this;THREE.CameraHelper.__c.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);
|
|
|
a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",0.7,1.1,-1);a("u2",-0.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",0,1,-1);this.geometry.verticesNeedUpdate=true};THREE.CameraHelper.__projector=new THREE.Projector;THREE.CameraHelper.__v=new THREE.Vector3;THREE.CameraHelper.__c=new THREE.Camera;
|
|
|
-THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.position=a.position;this.properties.isGizmo=true;this.color=a.color.clone();this.color.r=this.color.r*a.intensity;this.color.g=this.color.g*a.intensity;this.color.b=this.color.b*a.intensity;var c=this.color.getHex();this.direction=new THREE.Vector3;this.direction.sub(a.target.position,a.position);var d=new THREE.SphereGeometry(5,8,4),e=new THREE.SphereGeometry(5,16,8),f=new THREE.MeshBasicMaterial({color:c});this.lightArrow=
|
|
|
-new THREE.ArrowHelper(this.direction,null,b,c);this.lightSphere=new THREE.Mesh(e,f);this.add(this.lightArrow);this.add(this.lightSphere);this.targetSphere=null;if(a.target.properties.targetInverse){e=new THREE.MeshBasicMaterial({color:c,wireframe:true});this.targetSphere=new THREE.Mesh(d,e);this.targetSphere.position=a.target.position;this.targetSphere.properties.isGizmo=true;this.targetSphere.properties.gizmoSubject=a.target;this.targetSphere.properties.gizmoRoot=this.targetSphere;c=new THREE.LineDashedMaterial({color:c,
|
|
|
-dashSize:4,gapSize:4,opacity:0.75,transparent:true});d=new THREE.Geometry;d.vertices.push(this.position.clone());d.vertices.push(this.targetSphere.position.clone());d.computeLineDistances();this.targetLine=new THREE.Line(d,c);this.targetLine.properties.isGizmo=true}this.lightSphere.properties.isGizmo=true;this.lightSphere.properties.gizmoSubject=a;this.lightSphere.properties.gizmoRoot=this};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
+THREE.DirectionalLightHelper=function(a,b,c){THREE.Object3D.call(this);this.light=a;this.position=a.position;this.properties.isGizmo=true;this.color=a.color.clone();this.color.r=this.color.r*a.intensity;this.color.g=this.color.g*a.intensity;this.color.b=this.color.b*a.intensity;var d=this.color.getHex();this.direction=new THREE.Vector3;this.direction.sub(a.target.position,a.position);var e=new THREE.SphereGeometry(b,8,4),b=new THREE.SphereGeometry(b,16,8),f=new THREE.MeshBasicMaterial({color:d,fog:false});
|
|
|
+this.lightArrow=new THREE.ArrowHelper(this.direction,null,c,d);this.lightSphere=new THREE.Mesh(b,f);this.lightArrow.cone.material.fog=false;this.lightArrow.line.material.fog=false;this.add(this.lightArrow);this.add(this.lightSphere);this.targetSphere=null;if(a.target.properties.targetInverse){c=new THREE.MeshBasicMaterial({color:d,wireframe:true,fog:false});this.targetSphere=new THREE.Mesh(e,c);this.targetSphere.position=a.target.position;this.targetSphere.properties.isGizmo=true;this.targetSphere.properties.gizmoSubject=
|
|
|
+a.target;this.targetSphere.properties.gizmoRoot=this.targetSphere;d=new THREE.LineDashedMaterial({color:d,dashSize:4,gapSize:4,opacity:0.75,transparent:true,fog:false});e=new THREE.Geometry;e.vertices.push(this.position.clone());e.vertices.push(this.targetSphere.position.clone());e.computeLineDistances();this.targetLine=new THREE.Line(e,d);this.targetLine.properties.isGizmo=true}this.lightSphere.properties.isGizmo=true;this.lightSphere.properties.gizmoSubject=a;this.lightSphere.properties.gizmoRoot=
|
|
|
+this};THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype);
|
|
|
THREE.DirectionalLightHelper.prototype.update=function(){this.direction.sub(this.light.target.position,this.light.position);this.lightArrow.setDirection(this.direction);this.color.copy(this.light.color);var a=THREE.Math.clamp(this.light.intensity,0,1);this.color.r=this.color.r*a;this.color.g=this.color.g*a;this.color.b=this.color.b*a;this.lightArrow.setColor(this.color.getHex());this.lightSphere.material.color.copy(this.color);this.targetSphere.material.color.copy(this.color);this.targetLine.material.color.copy(this.color);
|
|
|
-this.targetLine.geometry.vertices[0].copy(this.light.position);this.targetLine.geometry.vertices[1].copy(this.light.target.position);this.targetLine.geometry.computeLineDistances();this.targetLine.geometry.verticesNeedUpdate=true};THREE.SubdivisionModifier=function(a){this.subdivisions=a===void 0?1:a;this.useOldVertexColors=false;this.supportUVs=true;this.debug=false};THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;b-- >0;)this.smooth(a)};
|
|
|
-THREE.GeometryUtils.orderedKey=function(a,b){return Math.min(a,b)+"_"+Math.max(a,b)};THREE.GeometryUtils.computeEdgeFaces=function(a){function b(a,b){g[a]===void 0&&(g[a]=[]);g[a].push(b)}var c,d,e,f,g={},h=THREE.GeometryUtils.orderedKey;c=0;for(d=a.faces.length;c<d;c++){e=a.faces[c];if(e instanceof THREE.Face3){f=h(e.a,e.b);b(f,c);f=h(e.b,e.c);b(f,c);f=h(e.c,e.a);b(f,c)}else if(e instanceof THREE.Face4){f=h(e.a,e.b);b(f,c);f=h(e.b,e.c);b(f,c);f=h(e.c,e.d);b(f,c);f=h(e.d,e.a);b(f,c)}}return g};
|
|
|
+this.targetLine.geometry.vertices[0].copy(this.light.position);this.targetLine.geometry.vertices[1].copy(this.light.target.position);this.targetLine.geometry.computeLineDistances();this.targetLine.geometry.verticesNeedUpdate=true};
|
|
|
+THREE.PointLightHelper=function(a,b){THREE.Object3D.call(this);this.light=a;this.position=a.position;this.properties.isGizmo=true;this.color=a.color.clone();this.color.r=this.color.r*a.intensity;this.color.g=this.color.g*a.intensity;this.color.b=this.color.b*a.intensity;var c=this.color.getHex(),d=new THREE.SphereGeometry(b,16,8),e=new THREE.MeshBasicMaterial({color:c,fog:false});this.lightSphere=new THREE.Mesh(d,e);this.add(this.lightSphere);this.lightSphere.properties.isGizmo=true;this.lightSphere.properties.gizmoSubject=
|
|
|
+a;this.lightSphere.properties.gizmoRoot=this;for(var c=new THREE.LineBasicMaterial({color:c,fog:false}),d=new THREE.Geometry,e=b*1.25,f=b*2.25,g=0.707*e,h=0.707*f,e=[[e,0,0],[f,0,0],[-e,0,0],[-f,0,0],[0,e,0],[0,f,0],[0,-e,0],[0,-f,0],[0,0,e],[0,0,f],[0,0,-e],[0,0,-f],[g,g,0],[h,h,0],[-g,-g,0],[-h,-h,0],[g,-g,0],[h,-h,0],[-g,g,0],[-h,h,0],[g,0,g],[h,0,h],[-g,0,-g],[-h,0,-h],[g,0,-g],[h,0,-h],[-g,0,g],[-h,0,h],[0,g,g],[0,h,h],[0,-g,-g],[0,-h,-h],[0,g,-g],[0,h,-h],[0,-g,g],[0,-h,h]],f=0,g=e.length;f<
|
|
|
+g;f++)d.vertices.push(new THREE.Vector3(e[f][0],e[f][1],e[f][2]));this.lightLine=new THREE.Line(d,c,THREE.LinePieces);this.add(this.lightLine)};THREE.PointLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.PointLightHelper.prototype.update=function(){this.color.copy(this.light.color);var a=THREE.Math.clamp(this.light.intensity,0,1);this.color.r=this.color.r*a;this.color.g=this.color.g*a;this.color.b=this.color.b*a;this.lightSphere.material.color.copy(this.color);this.lightLine.material.color.copy(this.color)};
|
|
|
+THREE.SubdivisionModifier=function(a){this.subdivisions=a===void 0?1:a;this.useOldVertexColors=false;this.supportUVs=true;this.debug=false};THREE.SubdivisionModifier.prototype.modify=function(a){for(var b=this.subdivisions;b-- >0;)this.smooth(a)};THREE.GeometryUtils.orderedKey=function(a,b){return Math.min(a,b)+"_"+Math.max(a,b)};
|
|
|
+THREE.GeometryUtils.computeEdgeFaces=function(a){function b(a,b){g[a]===void 0&&(g[a]=[]);g[a].push(b)}var c,d,e,f,g={},h=THREE.GeometryUtils.orderedKey;c=0;for(d=a.faces.length;c<d;c++){e=a.faces[c];if(e instanceof THREE.Face3){f=h(e.a,e.b);b(f,c);f=h(e.b,e.c);b(f,c);f=h(e.c,e.a);b(f,c)}else if(e instanceof THREE.Face4){f=h(e.a,e.b);b(f,c);f=h(e.b,e.c);b(f,c);f=h(e.c,e.d);b(f,c);f=h(e.d,e.a);b(f,c)}}return g};
|
|
|
THREE.SubdivisionModifier.prototype.smooth=function(a){function b(){m.debug&&(console&&console.assert)&&console.assert.apply(console,arguments)}function c(){m.debug&&console.log.apply(console,arguments)}function d(){console&&console.log.apply(console,arguments)}function e(a,b,d,e,g,h,l){var n=new THREE.Face4(a,b,d,e,null,g.color,g.materialIndex);if(m.useOldVertexColors){n.vertexColors=[];for(var o,p,q,s=0;s<4;s++){q=h[s];o=new THREE.Color;o.setRGB(0,0,0);for(var r=0;r<q.length;r++){p=g.vertexColors[q[r]-
|
|
|
1];o.r=o.r+p.r;o.g=o.g+p.g;o.b=o.b+p.b}o.r=o.r/q.length;o.g=o.g/q.length;o.b=o.b/q.length;n.vertexColors[s]=o}}i.push(n);if(m.supportUVs){g=[f(a,""),f(b,l),f(d,l),f(e,l)];g[0]?g[1]?g[2]?g[3]?j.push(g):c("d :( ",e+":"+l):c("c :( ",d+":"+l):c("b :( ",b+":"+l):c("a :( ",a+":"+l)}}function f(a,b){var e=a+":"+b,f=u[e];if(!f){a>=q&&a<q+o.length?c("face pt"):c("edge pt");d("warning, UV not found for",e);return null}return f}function g(a,b,c){var e=a+":"+b;e in u?d("dup vertexNo",a,"oldFaceNo",b,"value",
|
|
|
c,"key",e,u[e]):u[e]=c}var h=[],i=[],j=[],m=this,n=THREE.GeometryUtils.orderedKey,l=THREE.GeometryUtils.computeEdgeFaces,p=a.vertices,o=a.faces,q=p.length,h=p.concat(),s=[],r={},A={},u={},t,F,z,w,v,C=a.faceVertexUvs[0],D;c("originalFaces, uvs, originalVerticesLength",o.length,C.length,q);if(m.supportUVs){t=0;for(F=C.length;t<F;t++){z=0;for(w=C[t].length;z<w;z++){D=o[t]["abcd".charAt(z)];g(D,t,C[t][z])}}}if(C.length==0)m.supportUVs=false;t=0;for(var I in u)t++;if(!t){m.supportUVs=false;c("no uvs")}t=
|