ThreeJS-Webpack-ES6-Boilerp.../build/js/0.app.js

1 line
38 KiB
JavaScript
Raw Normal View History

2019-01-29 21:54:53 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[,,,,function(e,t){e.exports=function(O){var e=O.MOUSE;function A(e){this.object=e,this.target=new O.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25;var n,o,a,i,r,s,l,c,h,d=this,u=1e-6,m=0,g=0,p=1,f=new O.Vector3,b=!1;this.getPolarAngle=function(){return o},this.getAzimuthalAngle=function(){return n},this.rotateLeft=function(e){g-=e},this.rotateUp=function(e){m-=e},this.panLeft=(a=new O.Vector3,function(e){var t=this.object.matrix.elements;a.set(t[0],t[1],t[2]),a.multiplyScalar(-e),f.add(a)}),this.panUp=(i=new O.Vector3,function(e){var t=this.object.matrix.elements;i.set(t[4],t[5],t[6]),i.multiplyScalar(e),f.add(i)}),this.pan=function(e,t,n,o){if(d.object instanceof O.PerspectiveCamera){var a=d.object.position.clone().sub(d.target).length();a*=Math.tan(d.object.fov/2*Math.PI/180),d.panLeft(2*e*a/o),d.panUp(2*t*a/o)}else d.object instanceof O.OrthographicCamera?(d.panLeft(e*(d.object.right-d.object.left)/n),d.panUp(t*(d.object.top-d.object.bottom)/o)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.dollyIn=function(e){d.object instanceof O.PerspectiveCamera?p/=e:d.object instanceof O.OrthographicCamera?(d.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*e)),d.object.updateProjectionMatrix(),b=!0):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(e){d.object instanceof O.PerspectiveCamera?p*=e:d.object instanceof O.OrthographicCamera?(d.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/e)),d.object.updateProjectionMatrix(),b=!0):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=(r=new O.Vector3,s=(new O.Quaternion).setFromUnitVectors(e.up,new O.Vector3(0,1,0)),l=s.clone().inverse(),c=new O.Vector3,h=new O.Quaternion,function(){var e=this.object.position;r.copy(e).sub(this.target),r.applyQuaternion(s),n=Math.atan2(r.x,r.z),o=Math.atan2(Math.sqrt(r.x*r.x+r.z*r.z),r.y),n+=g,o+=m,n=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,n)),o=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,o)),o=Math.max(u,Math.min(Math.PI-u,o));var t=r.length()*p;return t=Math.max(this.minDistance,Math.min(this.maxDistance,t)),this.target.add(f),r.x=t*Math.sin(o)*Math.sin(n),r.y=t*Math.cos(o),r.z=t*Math.sin(o)*Math.cos(n),r.applyQuaternion(l),e.copy(this.target).add(r),this.object.lookAt(this.target),!0===this.enableDamping?(g*=1-this.dampingFactor,m*=1-this.dampingFactor):m=g=0,p=1,f.set(0,0,0),!(!(b||c.distanceToSquared(this.object.position)>u||8*(1-h.dot(this.object.quaternion))>u)||(c.copy(this.object.position),h.copy(this.object.quaternion),b=!1))})}function t(e,t){var i=new A(e);this.domElement=void 0!==t?t:document,Object.defineProperty(this,"constraint",{get:function(){return i}}),this.getPolarAngle=function(){return i.getPolarAngle()},this.getAzimuthalAngle=function(){return i.getAzimuthalAngle()},this.enabled=!0,this.center=this.target,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:O.MOUSE.LEFT,ZOOM:O.MOUSE.MIDDLE,PAN:O.MOUSE.RIGHT};var r=this,s=new O.Vector2,l=new O.Vector2,c=new O.Vector2,h=new O.Vector2,d=new O.Vector2,u=new O.Vector2,m=new O.Vector2,g=new O.Vector2,p=new O.Vector2,f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},b=f.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var n={type:"change"},a={type:"start"},o={type:"end"};function v(e,t){var n=r.domElement===document?r.domElement.body:r.domElement;i.pan(e,t,n.clientWidth,n.clientHeight)}function w(){return Math.pow(.