stl_web_viewer2/build/stlwebviewer2.js

2 lines
20 KiB
JavaScript

(()=>{var e=function(){return void 0!==window.pageYOffset?window.pageYOffset:document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0},t=function(){return void 0!==window.pageXOffset?window.pageXOffset:document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0},n=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager};function o(e,t){if(this.modelUrl=e,this.$container=t,!a.webgl)return void a.addGetWebGLMessage({parent:this.$container[0]});o.instanceCount=(o.instanceCount||0)+1;let r="stlwv2-fullscreen-checkbox-"+(o.instanceCount-1);this.$container.append(['<input class="stlwv2-fullscreen-checkbox" id="'+r+'" type="checkbox"></input>','<div class="stlwv2-inner">',' <div class="stlwv2-percent"></div>',' <label class="stlwv2-hud stlwv2-fullscreen-on" title="Fullscreen" for="'+r+'">'," &#x21F1;</label>",' <label class="stlwv2-hud stlwv2-fullscreen-off" title="Close" for="'+r+'">'," &times;</label>",' <a class="stlwv2-hud stlwv2-github-link" target="_blank" href="https://github.com/brentyi/stl_web_viewer2">'," STL Web Viewer</a>","</div>"].join("\n")),this.$innerContainer=this.$container.children(".stlwv2-inner"),this.$fullscreenCheckbox=$("#"+r),this.$fullscreenCheckbox.on("change",this.fullscreenToggleHandler.bind(this)),this.scene=new THREE.Scene,this.camera=new THREE.PerspectiveCamera(40,this.$innerContainer.width()/this.$innerContainer.height(),1,15e3),this.cameraTarget=new THREE.Vector3,this.renderer=this.makeRenderer(antialias=!0),this.$innerContainer.append(this.renderer.domElement),this.controls=new i(this.camera,this.$innerContainer.get(0)),this.controls.target=this.cameraTarget,this.controls.enableDamping=!0,this.controls.enableKeys=!1,this.controls.rotateSpeed=.15,this.controls.dampingFactor=.125,this.controls.enableZoom=!0,this.controls.autoRotate=!0,this.controls.autoRotateSpeed=.25,this.controls.autoRotateDelay=5e3,this.hemisphereLight=new THREE.HemisphereLight(10066329,5592405),this.scene.add(this.hemisphereLight),this.pointLight=new THREE.PointLight(14540253,.75,0),this.camera.add(this.pointLight),this.scene.add(this.camera),(new n).load(this.modelUrl,this.stlLoadedCallback.bind(this),this.updateProgress.bind(this))}n.prototype={constructor:n,load:function(e,t,n,o){var a=this,i=new THREE.FileLoader(a.manager);i.setResponseType("arraybuffer"),i.load(e,(function(e){t(a.parse(e))}),n,o)},parse:function(e){var t=this.ensureBinary(e);return function(){var e;if(50,84+50*(e=new DataView(t)).getUint32(80,!0)===e.byteLength)return!0;for(var n=e.byteLength,o=0;o<n;o++)if(e.getUint8(o,!1)>127)return!0;return!1}()?this.parseBinary(t):this.parseASCII(this.ensureString(e))},parseBinary:function(e){for(var t,n,o,a,i,r,s,c,l=new DataView(e),d=l.getUint32(80,!0),h=!1,u=0;u<70;u++)1129270351==l.getUint32(u,!1)&&82==l.getUint8(u+4)&&61==l.getUint8(u+5)&&(h=!0,a=[],i=l.getUint8(u+6)/255,r=l.getUint8(u+7)/255,s=l.getUint8(u+8)/255,c=l.getUint8(u+9)/255);for(var m=new THREE.BufferGeometry,p=[],b=[],f=0;f<d;f++){var g=84+50*f,E=l.getFloat32(g,!0),w=l.getFloat32(g+4,!0),v=l.getFloat32(g+8,!0);if(h){var y=l.getUint16(g+48,!0);0==(32768&y)?(t=(31&y)/31,n=(y>>5&31)/31,o=(y>>10&31)/31):(t=i,n=r,o=s)}for(var R=1;R<=3;R++){var T=g+12*R;p.push(l.getFloat32(T,!0)),p.push(l.getFloat32(T+4,!0)),p.push(l.getFloat32(T+8,!0)),b.push(E,w,v),h&&a.push(t,n,o)}}return m.addAttribute("position",new THREE.BufferAttribute(new Float32Array(p),3)),m.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b),3)),h&&(m.addAttribute("color",new THREE.BufferAttribute(new Float32Array(a),3)),m.hasColors=!0,m.alpha=c),m},parseASCII:function(e){var t,n,o,a,i,r;t=new THREE.BufferGeometry,n=/facet([\s\S]*?)endfacet/g;for(var s=[],c=[],l=new THREE.Vector3;null!==(i=n.exec(e));){for(r=i[0],o=/normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;null!==(i=o.exec(r));)l.x=parseFloat(i[1]),l.y=parseFloat(i[3]),l.z=parseFloat(i[5]);for(a=/vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;null!==(i=a.exec(r));)s.push(parseFloat(i[1]),parseFloat(i[3]),parseFloat(i[5])),c.push(l.x,l.y,l.z)}return t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(s),3)),t.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c),3)),t},ensureString:function(e){if("string"!=typeof e){for(var t=new Uint8Array(e),n=[],o=0;o<e.byteLength;o++)n.push(String.fromCharCode(t[o]));return n.join("")}return e},ensureBinary:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=255&e.charCodeAt(n);return t.buffer||t}return e}},$(()=>{$(".stlwv2-model").each((function(){let e=$(this);new o(e.data("model-url"),e)})),$(document).keyup((function(e){"Escape"===e.key&&$(".stlwv2-model .stlwv2-fullscreen-checkbox").each((function(){$(this).prop("checked")&&$(this).prop("checked",!1).trigger("change")}))}))}),o.prototype.updateProgress=function(e){console.log("Loading "+this.modelUrl+": "+e.loaded+"/"+e.total),this.$innerContainer.children(".stlwv2-percent").text(Math.floor(e.loaded/e.total*100)+"%")},o.prototype.stlLoadedCallback=function(e){let t=new THREE.MeshPhongMaterial({color:16251135,specular:1118481,shininess:0,wireframe:!1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1,transparent:!0,opacity:.85}),n=new THREE.Mesh(e,t);n.position.set(0,0,0),n.castShadow=!1,n.receiveShadow=!1,this.scene.add(n);let o=new THREE.EdgesGeometry(e,29),a=new THREE.LineSegments(o,new THREE.LineBasicMaterial({color:6710886}));this.scene.add(a),e.computeBoundingSphere(),e.computeBoundingBox(),this.cameraTarget.copy(e.boundingSphere.center);let i=e.boundingSphere.radius;this.controls.maxDistance=10*i,this.pointLight.position.set(0,i,0),this.camera.position.set(1.5*i+this.cameraTarget.x,1.5*i+this.cameraTarget.y,1.5*i+this.cameraTarget.z),this.animate(),this.$innerContainer.addClass("stlwv2-loaded")},o.prototype.animate=function(){if(this.animateLoops=(this.animateLoops||0)+1,!this.performanceChecked)if(5==this.animateLoops)this.performanceCheckStartTime=performance.now();else if(this.animateLoops>5){let e=performance.now()-this.performanceCheckStartTime;if(e>2e3){let t=1e3*(this.animateLoops-5)/e;console.log("Cumulative framerate: "+t),t<30&&(console.log("Disabling anti-aliasing"),this.renderer.domElement.remove(),delete this.renderer,this.renderer=this.makeRenderer(antialias=!1),this.$innerContainer.append(this.renderer.domElement)),this.performanceChecked=!0}}this.camera.aspect=this.$innerContainer.width()/this.$innerContainer.height(),this.camera.updateProjectionMatrix(),this.renderer.setSize(this.$innerContainer.width(),this.$innerContainer.height()),requestAnimationFrame(this.animate.bind(this)),this.controls.update(),this.renderer.render(this.scene,this.camera)},o.prototype.makeRenderer=function(e){let t=new THREE.WebGLRenderer({antialias:e});return t.setClearColor(16777215),t.setPixelRatio(Math.min(window.devicePixelRatio,2)),t.gammaInput=!0,t.gammaOutput=!0,t.shadowMap.enabled=!0,t},o.prototype.fullscreenToggleHandler=function(){let n=this.$container.position().top-e()+1,o=this.$container.position().left-t()+1,a=$(window).height()-(n+this.$container.innerHeight())+1,i=this.$container.width()-2;this.$fullscreenCheckbox.prop("checked")?(this.$innerContainer.css({top:n+"px",bottom:a+"px",left:o+"px",width:i+"px",position:"fixed",opacity:"0.5","z-index":2e3}),this.$innerContainer.animate({top:"0",bottom:"0",left:"0",width:"100%",opacity:"1"},300,()=>{this.$innerContainer.animate({opacity:"1"},500)})):(this.$innerContainer.css({opacity:"0.5"}),this.$innerContainer.animate({top:n+"px",bottom:a+"px",left:o+"px",width:i+"px"},300,()=>{this.$innerContainer.css({position:"",top:"",bottom:"",left:"",width:"","z-index":""}),this.$innerContainer.animate({opacity:"1"},500)}))};var a={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var e=document.createElement("div");return e.id="webgl-error-message",e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.fontWeight="normal",e.style.textAlign="center",e.style.background="#fff",e.style.color="#000",e.style.padding="1.5em",e.style.width="400px",e.style.margin="5em auto 0",this.webgl||(e.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'].join("\n"):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.'].join("\n")),e},addGetWebGLMessage:function(e){var t,n,o;t=void 0!==(e=e||{}).parent?e.parent:document.body,n=void 0!==e.id?e.id:"oldie",(o=a.getWebGLErrorMessage()).id=n,t.appendChild(o)}};"object"==typeof module&&(module.exports=a);var i=function(e,t){var n,o,a,i,r;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new THREE.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,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.autoRotateDelay=0,this.autoRotateTimeout,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return p.phi},this.getAzimuthalAngle=function(){return p.theta},this.reset=function(){s.target.copy(s.target0),s.object.position.copy(s.position0),s.object.zoom=s.zoom0,s.object.updateProjectionMatrix(),s.dispatchEvent(c),s.update(),u=h.NONE},this.update=(n=new THREE.Vector3,o=(new THREE.Quaternion).setFromUnitVectors(e.up,new THREE.Vector3(0,1,0)),a=o.clone().inverse(),i=new THREE.Vector3,r=new THREE.Quaternion,function(){var e=s.object.position;return n.copy(e).sub(s.target),n.applyQuaternion(o),p.setFromVector3(n),s.autoRotate&&u===h.NONE&&!w?P(2*Math.PI/60/60*s.autoRotateSpeed):s.autoRotate&&s.autoRotateDelay>0&&(s.autoRotateSpeed>0&&(s.autoRotateSpeedActual=s.autoRotateSpeed,s.autoRotateSpeed=0),clearTimeout(s.autoRotateTimeout),s.autoRotateTimeout=setTimeout((function(){s.autoRotateSpeed=s.autoRotateSpeedActual}),s.autoRotateDelay),w=!1),p.theta+=b.theta,p.phi+=b.phi,p.theta=Math.max(s.minAzimuthAngle,Math.min(s.maxAzimuthAngle,p.theta)),p.phi=Math.max(s.minPolarAngle,Math.min(s.maxPolarAngle,p.phi)),p.makeSafe(),p.radius*=f,p.radius=Math.max(s.minDistance,Math.min(s.maxDistance,p.radius)),s.target.add(g),n.setFromSpherical(p),n.applyQuaternion(a),e.copy(s.target).add(n),s.object.lookAt(s.target),!0===s.enableDamping?(b.theta*=1-s.dampingFactor,b.phi*=1-s.dampingFactor):b.set(0,0,0),f=1,g.set(0,0,0),!!(E||i.distanceToSquared(s.object.position)>m||8*(1-r.dot(s.object.quaternion))>m)&&(s.dispatchEvent(c),i.copy(s.object.position),r.copy(s.object.quaternion),E=!1,!0)}),this.dispose=function(){s.domElement.removeEventListener("contextmenu",I,!1),s.domElement.removeEventListener("mousedown",D,!1),s.domElement.removeEventListener("wheel",z,!1),s.domElement.removeEventListener("touchstart",B,!1),s.domElement.removeEventListener("touchend",Z,!1),s.domElement.removeEventListener("touchmove",G,!1),document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",V,!1),document.removeEventListener("mouseleave",V,!1),window.removeEventListener("keydown",Y,!1)};var s=this,c={type:"change"},l={type:"start"},d={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},u=h.NONE,m=1e-6,p=new THREE.Spherical,b=new THREE.Spherical,f=1,g=new THREE.Vector3,E=!1,w=!1,v=new THREE.Vector2,y=new THREE.Vector2,R=new THREE.Vector2,T=new THREE.Vector2,C=new THREE.Vector2,L=new THREE.Vector2,O=new THREE.Vector2,H=new THREE.Vector2,x=new THREE.Vector2;function A(){return Math.pow(.95,s.zoomSpeed)}function P(e){b.theta-=e}function k(e){b.phi-=e}var M,j=(M=new THREE.Vector3,function(e,t){M.setFromMatrixColumn(t,0),M.multiplyScalar(-e),g.add(M)}),S=function(){var e=new THREE.Vector3;return function(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),g.add(e)}}(),F=function(){var e=new THREE.Vector3;return function(t,n){var o=s.domElement===document?s.domElement.body:s.domElement;if(s.object instanceof THREE.PerspectiveCamera){var a=s.object.position;e.copy(a).sub(s.target);var i=e.length();i*=Math.tan(s.object.fov/2*Math.PI/180),j(2*t*i/o.clientHeight,s.object.matrix),S(2*n*i/o.clientHeight,s.object.matrix)}else s.object instanceof THREE.OrthographicCamera?(j(t*(s.object.right-s.object.left)/s.object.zoom/o.clientWidth,s.object.matrix),S(n*(s.object.top-s.object.bottom)/s.object.zoom/o.clientHeight,s.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),s.enablePan=!1)}}();function U(e){s.object instanceof THREE.PerspectiveCamera?f/=e:s.object instanceof THREE.OrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom*e)),s.object.updateProjectionMatrix(),E=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function $(e){s.object instanceof THREE.PerspectiveCamera?f*=e:s.object instanceof THREE.OrthographicCamera?(s.object.zoom=Math.max(s.minZoom,Math.min(s.maxZoom,s.object.zoom/e)),s.object.updateProjectionMatrix(),E=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),s.enableZoom=!1)}function D(e){if(!1!==s.enabled){if(e.preventDefault(),e.button===s.mouseButtons.ORBIT){if(!1===s.enableRotate)return;!function(e){v.set(e.clientX,e.clientY)}(e),u=h.ROTATE}else if(e.button===s.mouseButtons.ZOOM){if(!1===s.enableZoom)return;!function(e){O.set(e.clientX,e.clientY)}(e),u=h.DOLLY}else if(e.button===s.mouseButtons.PAN){if(!1===s.enablePan)return;!function(e){T.set(e.clientX,e.clientY)}(e),u=h.PAN}u!==h.NONE&&(document.addEventListener("mousemove",N,!1),document.addEventListener("mouseup",V,!1),document.addEventListener("mouseleave",V,!1),s.dispatchEvent(l))}}function N(e){if(!1!==s.enabled)if(e.preventDefault(),u===h.ROTATE){if(!1===s.enableRotate)return;!function(e){y.set(e.clientX,e.clientY),R.subVectors(y,v);var t=s.domElement===document?s.domElement.body:s.domElement;P(2*Math.PI*R.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*R.y/t.clientHeight*s.rotateSpeed),v.copy(y),s.update()}(e)}else if(u===h.DOLLY){if(!1===s.enableZoom)return;!function(e){H.set(e.clientX,e.clientY),x.subVectors(H,O),x.y>0?U(A()):x.y<0&&$(A()),O.copy(H),s.update()}(e)}else if(u===h.PAN){if(!1===s.enablePan)return;!function(e){C.set(e.clientX,e.clientY),L.subVectors(C,T),F(L.x,L.y),T.copy(C),s.update()}(e)}}function V(e){!1!==s.enabled&&(document.removeEventListener("mousemove",N,!1),document.removeEventListener("mouseup",V,!1),document.removeEventListener("mouseleave",V,!1),s.dispatchEvent(d),u=h.NONE)}function z(e){if(!1!==s.enabled&&!1!==s.enableZoom&&(u===h.NONE||u===h.ROTATE))return function(e){e.deltaY<0?$(A()):e.deltaY>0&&U(A()),s.update()}(e),s.dispatchEvent(l),s.dispatchEvent(d),w=!0,e.preventDefault(),e.stopPropagation(),!1}function Y(e){!1!==s.enabled&&!1!==s.enableKeys&&!1!==s.enablePan&&function(e){switch(e.keyCode){case s.keys.UP:F(0,s.keyPanSpeed),s.update();break;case s.keys.BOTTOM:F(0,-s.keyPanSpeed),s.update();break;case s.keys.LEFT:F(s.keyPanSpeed,0),s.update();break;case s.keys.RIGHT:F(-s.keyPanSpeed,0),s.update()}}(e)}function B(e){if(!1!==s.enabled){switch(e.touches.length){case 1:if(!1===s.enableRotate)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY)}(e),u=h.TOUCH_ROTATE;break;case 2:if(!1===s.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,o=Math.sqrt(t*t+n*n);O.set(0,o)}(e),u=h.TOUCH_DOLLY;break;case 3:if(!1===s.enablePan)return;!function(e){T.set(e.touches[0].pageX,e.touches[0].pageY)}(e),u=h.TOUCH_PAN;break;default:u=h.NONE}u!==h.NONE&&s.dispatchEvent(l)}}function G(e){if(!1!==s.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===s.enableRotate)return;if(u!==h.TOUCH_ROTATE)return;!function(e){y.set(e.touches[0].pageX,e.touches[0].pageY),R.subVectors(y,v);var t=s.domElement===document?s.domElement.body:s.domElement;P(2*Math.PI*R.x/t.clientWidth*s.rotateSpeed),k(2*Math.PI*R.y/t.clientHeight*s.rotateSpeed),v.copy(y),s.update()}(e);break;case 2:if(!1===s.enableZoom)return;if(u!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,o=Math.sqrt(t*t+n*n);H.set(0,o),x.subVectors(H,O),x.y>0?$(A()):x.y<0&&U(A()),O.copy(H),s.update()}(e);break;case 3:if(!1===s.enablePan)return;if(u!==h.TOUCH_PAN)return;!function(e){C.set(e.touches[0].pageX,e.touches[0].pageY),L.subVectors(C,T),F(L.x,L.y),T.copy(C),s.update()}(e);break;default:u=h.NONE}}function Z(e){!1!==s.enabled&&(s.dispatchEvent(d),u=h.NONE)}function I(e){e.preventDefault()}s.domElement.addEventListener("contextmenu",I,!1),s.domElement.addEventListener("mousedown",D,!1),s.domElement.addEventListener("wheel",z,!1),s.domElement.addEventListener("touchstart",B,!1),s.domElement.addEventListener("touchend",Z,!1),s.domElement.addEventListener("touchmove",G,!1),window.addEventListener("keydown",Y,!1),this.update()};i.prototype=Object.create(THREE.EventDispatcher.prototype),i.prototype.constructor=i,Object.defineProperties(i.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}})})();