@shopware-ag/dive 2.0.1-beta.3 → 2.0.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chunks/{package-C16N_5TP.mjs → package-DeBkqggW.mjs} +1 -1
- package/build/chunks/{package-CafekLb8.cjs → package-o6as1hwQ.cjs} +1 -1
- package/build/dive.cjs +2 -2
- package/build/dive.mjs +173 -181
- package/build/src/components/node/Node.d.ts +3 -3
- package/build/src/core/Dive.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@shopware-ag/dive", s = "2.0.1-beta.
|
|
1
|
+
const e = "@shopware-ag/dive", s = "2.0.1-beta.5", t = "Shopware Spatial Framework", o = "module", r = "build/dive.cjs", i = "build/dive.mjs", d = "build/dive.d.ts", l = { ".": { types: "./build/dive.d.ts", import: "./build/dive.mjs", require: "./build/dive.cjs" }, "./modules/AnimationSystem": { types: "./build/src/modules/animation/AnimationSystem.d.ts", import: "./build/src/modules/animation/AnimationSystem.mjs", require: "./build/src/modules/animation/AnimationSystem.cjs" }, "./modules/ARSystem": { types: "./build/src/modules/ar/ARSystem.d.ts", import: "./build/src/modules/ar/ARSystem.mjs", require: "./build/src/modules/ar/ARSystem.cjs" }, "./modules/AssetConverter": { types: "./build/src/modules/asset/converter/AssetConverter.d.ts", import: "./build/src/modules/asset/converter/AssetConverter.mjs", require: "./build/src/modules/asset/converter/AssetConverter.cjs" }, "./modules/AssetExporter": { types: "./build/src/modules/asset/exporter/AssetExporter.d.ts", import: "./build/src/modules/asset/exporter/AssetExporter.mjs", require: "./build/src/modules/asset/exporter/AssetExporter.cjs" }, "./modules/AssetLoader": { types: "./build/src/modules/asset/loader/AssetLoader.d.ts", import: "./build/src/modules/asset/loader/AssetLoader.mjs", require: "./build/src/modules/asset/loader/AssetLoader.cjs" }, "./modules/MediaCreator": { types: "./build/src/modules/mediacreator/MediaCreator.d.ts", import: "./build/src/modules/mediacreator/MediaCreator.mjs", require: "./build/src/modules/mediacreator/MediaCreator.cjs" }, "./modules/State": { types: "./build/src/modules/state/State.d.ts", import: "./build/src/modules/state/State.mjs", require: "./build/src/modules/state/State.cjs" }, "./modules/SystemInfo": { types: "./build/src/modules/systeminfo/SystemInfo.d.ts", import: "./build/src/modules/systeminfo/SystemInfo.mjs", require: "./build/src/modules/systeminfo/SystemInfo.cjs" }, "./modules/Toolbox": { types: "./build/src/modules/toolbox/Toolbox.d.ts", import: "./build/src/modules/toolbox/Toolbox.mjs", require: "./build/src/modules/toolbox/Toolbox.cjs" } }, a = ["build", "LICENSE", "package.json"], c = ["dive", "shopware", "sw6", "three", "three.js", "3d", "typescript"], u = "git@github.com:shopware/dive.git", m = "ffrank <f.frank@shopware.com>", n = "MIT", p = ["> 1%, not dead, not ie 11, not op_mini all"], b = { "@tweenjs/tween.js": "^23.1.1", lodash: "^4.17.21", three: "^0.163.0", "three-spritetext": "^1.8.2" }, y = { "@eslint/js": "^9.1.1", "@testing-library/jest-dom": "^6.6.3", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.12", "@types/node": "^20.12.7", "@types/three": "^0.163.0", "@vitest/coverage-v8": "3.1.2", acorn: "^8.14.1", "acorn-walk": "^8.3.4", eslint: "^9.1.1", glob: "^11.0.1", globals: "^15.0.0", jsdom: "^26.1.0", "magic-string": "^0.30.17", prettier: "^3.3.3", "prettier-plugin-multiline-arrays": "^3.0.6", "rollup-plugin-copy": "^3.5.0", "ts-jest": "^29.1.2", "ts-morph": "^25.0.1", "ts-node": "^10.9.2", tsc: "^2.0.4", tsx: "^4.19.4", typescript: "^5.8.2", "typescript-eslint": "^7.7.1", vite: "^6.2.1", "vite-plugin-dts": "^4.5.3", "vite-plugin-wasm": "^3.4.1", vitest: "^3.1.2" }, v = { "validate-build-paths": "NODE_OPTIONS='--loader ts-node/esm' ts-node ci/build/validate-build-paths.ts", build: "vite build", dev: "vite build --watch", lint: "eslint", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write .", unit: "vitest --run", coverage: "vitest --coverage --run", docs: "yarn docs:actions && yarn docs:modules", "docs:actions": "tsx docs/generators/generate-actions-docs.ts", "docs:modules": "tsx docs/generators/generate-modules-docs.ts", ci: "yarn lint && yarn prettier:check && yarn docs && yarn coverage && yarn build" }, j = {
|
|
2
2
|
name: e,
|
|
3
3
|
version: s,
|
|
4
4
|
description: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="@shopware-ag/dive",s="2.0.1-beta.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="@shopware-ag/dive",s="2.0.1-beta.5",t="Shopware Spatial Framework",o="module",r="build/dive.cjs",i="build/dive.mjs",d="build/dive.d.ts",l={".":{types:"./build/dive.d.ts",import:"./build/dive.mjs",require:"./build/dive.cjs"},"./modules/AnimationSystem":{types:"./build/src/modules/animation/AnimationSystem.d.ts",import:"./build/src/modules/animation/AnimationSystem.mjs",require:"./build/src/modules/animation/AnimationSystem.cjs"},"./modules/ARSystem":{types:"./build/src/modules/ar/ARSystem.d.ts",import:"./build/src/modules/ar/ARSystem.mjs",require:"./build/src/modules/ar/ARSystem.cjs"},"./modules/AssetConverter":{types:"./build/src/modules/asset/converter/AssetConverter.d.ts",import:"./build/src/modules/asset/converter/AssetConverter.mjs",require:"./build/src/modules/asset/converter/AssetConverter.cjs"},"./modules/AssetExporter":{types:"./build/src/modules/asset/exporter/AssetExporter.d.ts",import:"./build/src/modules/asset/exporter/AssetExporter.mjs",require:"./build/src/modules/asset/exporter/AssetExporter.cjs"},"./modules/AssetLoader":{types:"./build/src/modules/asset/loader/AssetLoader.d.ts",import:"./build/src/modules/asset/loader/AssetLoader.mjs",require:"./build/src/modules/asset/loader/AssetLoader.cjs"},"./modules/MediaCreator":{types:"./build/src/modules/mediacreator/MediaCreator.d.ts",import:"./build/src/modules/mediacreator/MediaCreator.mjs",require:"./build/src/modules/mediacreator/MediaCreator.cjs"},"./modules/State":{types:"./build/src/modules/state/State.d.ts",import:"./build/src/modules/state/State.mjs",require:"./build/src/modules/state/State.cjs"},"./modules/SystemInfo":{types:"./build/src/modules/systeminfo/SystemInfo.d.ts",import:"./build/src/modules/systeminfo/SystemInfo.mjs",require:"./build/src/modules/systeminfo/SystemInfo.cjs"},"./modules/Toolbox":{types:"./build/src/modules/toolbox/Toolbox.d.ts",import:"./build/src/modules/toolbox/Toolbox.mjs",require:"./build/src/modules/toolbox/Toolbox.cjs"}},a=["build","LICENSE","package.json"],c=["dive","shopware","sw6","three","three.js","3d","typescript"],n="git@github.com:shopware/dive.git",u="ffrank <f.frank@shopware.com>",m="MIT",p=["> 1%, not dead, not ie 11, not op_mini all"],b={"@tweenjs/tween.js":"^23.1.1",lodash:"^4.17.21",three:"^0.163.0","three-spritetext":"^1.8.2"},y={"@eslint/js":"^9.1.1","@testing-library/jest-dom":"^6.6.3","@types/jest":"^29.5.12","@types/lodash":"^4.17.12","@types/node":"^20.12.7","@types/three":"^0.163.0","@vitest/coverage-v8":"3.1.2",acorn:"^8.14.1","acorn-walk":"^8.3.4",eslint:"^9.1.1",glob:"^11.0.1",globals:"^15.0.0",jsdom:"^26.1.0","magic-string":"^0.30.17",prettier:"^3.3.3","prettier-plugin-multiline-arrays":"^3.0.6","rollup-plugin-copy":"^3.5.0","ts-jest":"^29.1.2","ts-morph":"^25.0.1","ts-node":"^10.9.2",tsc:"^2.0.4",tsx:"^4.19.4",typescript:"^5.8.2","typescript-eslint":"^7.7.1",vite:"^6.2.1","vite-plugin-dts":"^4.5.3","vite-plugin-wasm":"^3.4.1",vitest:"^3.1.2"},v={"validate-build-paths":"NODE_OPTIONS='--loader ts-node/esm' ts-node ci/build/validate-build-paths.ts",build:"vite build",dev:"vite build --watch",lint:"eslint","prettier:check":"prettier --check .","prettier:fix":"prettier --write .",unit:"vitest --run",coverage:"vitest --coverage --run",docs:"yarn docs:actions && yarn docs:modules","docs:actions":"tsx docs/generators/generate-actions-docs.ts","docs:modules":"tsx docs/generators/generate-modules-docs.ts",ci:"yarn lint && yarn prettier:check && yarn docs && yarn coverage && yarn build"},j={name:e,version:s,description:t,type:o,main:r,module:i,types:d,exports:l,files:a,keywords:c,repository:n,author:u,license:m,browserslist:p,dependencies:b,devDependencies:y,scripts:v};exports.author=u;exports.browserslist=p;exports.default=j;exports.dependencies=b;exports.description=t;exports.devDependencies=y;exports.exports=l;exports.files=a;exports.keywords=c;exports.license=m;exports.main=r;exports.module=i;exports.name=e;exports.repository=n;exports.scripts=v;exports.type=o;exports.types=d;exports.version=s;
|
package/build/dive.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var dt=Object.defineProperty;var ut=(l,n,t)=>n in l?dt(l,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[n]=t;var c=(l,n,t)=>ut(l,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three"),ae=require("three-spritetext"),y=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),x=require("./chunks/findInterface-BEdL2iUQ.cjs"),E=require("./chunks/ModuleRegistry-NyNtjHb2.cjs"),Be=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),K=require("./chunks/FileTypes-DzVpDu_p.cjs"),he=require("./chunks/index-MNP0K5dt.cjs"),Ue=require("./chunks/parse-error-Bd09D_1L.cjs"),ve={type:"change"},ce={type:"start"},Ve={type:"end"},J=new s.Ray,ke=new s.Plane,mt=Math.cos(70*s.MathUtils.DEG2RAD);class pt extends s.EventDispatcher{constructor(n,t){super(),this.object=n,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(i){i.addEventListener("keydown",re),this._domElementKeyEvents=i},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",re),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(ve),e.update(),r=o.NONE},this.update=function(){const i=new s.Vector3,a=new s.Quaternion().setFromUnitVectors(n.up,new s.Vector3(0,1,0)),u=a.clone().invert(),m=new s.Vector3,b=new s.Quaternion,P=new s.Vector3,w=2*Math.PI;return function(ht=null){const Ae=e.object.position;i.copy(Ae).sub(e.target),i.applyQuaternion(a),h.setFromVector3(i),e.autoRotate&&r===o.NONE&&Y(Ke(ht)),e.enableDamping?(h.theta+=p.theta*e.dampingFactor,h.phi+=p.phi*e.dampingFactor):(h.theta+=p.theta,h.phi+=p.phi);let M=e.minAzimuthAngle,T=e.maxAzimuthAngle;isFinite(M)&&isFinite(T)&&(M<-Math.PI?M+=w:M>Math.PI&&(M-=w),T<-Math.PI?T+=w:T>Math.PI&&(T-=w),M<=T?h.theta=Math.max(M,Math.min(T,h.theta)):h.theta=h.theta>(M+T)/2?Math.max(M,h.theta):Math.min(T,h.theta)),h.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,h.phi)),h.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(_,e.dampingFactor):e.target.add(_),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let G=!1;if(e.zoomToCursor&&W||e.object.isOrthographicCamera)h.radius=ne(h.radius);else{const L=h.radius;h.radius=ne(h.radius*f),G=L!=h.radius}if(i.setFromSpherical(h),i.applyQuaternion(u),Ae.copy(e.target).add(i),e.object.lookAt(e.target),e.enableDamping===!0?(p.theta*=1-e.dampingFactor,p.phi*=1-e.dampingFactor,_.multiplyScalar(1-e.dampingFactor)):(p.set(0,0,0),_.set(0,0,0)),e.zoomToCursor&&W){let L=null;if(e.object.isPerspectiveCamera){const j=i.length();L=ne(j*f);const q=j-L;e.object.position.addScaledVector(me,q),e.object.updateMatrixWorld(),G=!!q}else if(e.object.isOrthographicCamera){const j=new s.Vector3(S.x,S.y,0);j.unproject(e.object);const q=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),e.object.updateProjectionMatrix(),G=q!==e.object.zoom;const Re=new s.Vector3(S.x,S.y,0);Re.unproject(e.object),e.object.position.sub(Re).add(j),e.object.updateMatrixWorld(),L=i.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;L!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(L).add(e.object.position):(J.origin.copy(e.object.position),J.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(J.direction))<mt?n.lookAt(e.target):(ke.setFromNormalAndCoplanarPoint(e.object.up,e.target),J.intersectPlane(ke,e.target))))}else if(e.object.isOrthographicCamera){const L=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),L!==e.object.zoom&&(e.object.updateProjectionMatrix(),G=!0)}return f=1,W=!1,G||m.distanceToSquared(e.object.position)>d||8*(1-b.dot(e.object.quaternion))>d||P.distanceToSquared(e.target)>d?(e.dispatchEvent(ve),m.copy(e.object.position),b.copy(e.object.quaternion),P.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Oe),e.domElement.removeEventListener("pointerdown",Le),e.domElement.removeEventListener("pointercancel",F),e.domElement.removeEventListener("wheel",Se),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.domElement.getRootNode().removeEventListener("keydown",Pe,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",re),e._domElementKeyEvents=null)};const e=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=o.NONE;const d=1e-6,h=new s.Spherical,p=new s.Spherical;let f=1;const _=new s.Vector3,C=new s.Vector2,O=new s.Vector2,v=new s.Vector2,I=new s.Vector2,A=new s.Vector2,V=new s.Vector2,k=new s.Vector2,B=new s.Vector2,R=new s.Vector2,me=new s.Vector3,S=new s.Vector2;let W=!1;const g=[],N={};let te=!1;function Ke(i){return i!==null?2*Math.PI/60*e.autoRotateSpeed*i:2*Math.PI/60/60*e.autoRotateSpeed}function Z(i){const a=Math.abs(i*.01);return Math.pow(.95,e.zoomSpeed*a)}function Y(i){p.theta-=i}function X(i){p.phi-=i}const pe=function(){const i=new s.Vector3;return function(u,m){i.setFromMatrixColumn(m,0),i.multiplyScalar(-u),_.add(i)}}(),fe=function(){const i=new s.Vector3;return function(u,m){e.screenSpacePanning===!0?i.setFromMatrixColumn(m,1):(i.setFromMatrixColumn(m,0),i.crossVectors(e.object.up,i)),i.multiplyScalar(u),_.add(i)}}(),U=function(){const i=new s.Vector3;return function(u,m){const b=e.domElement;if(e.object.isPerspectiveCamera){const P=e.object.position;i.copy(P).sub(e.target);let w=i.length();w*=Math.tan(e.object.fov/2*Math.PI/180),pe(2*u*w/b.clientHeight,e.object.matrix),fe(2*m*w/b.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(pe(u*(e.object.right-e.object.left)/e.object.zoom/b.clientWidth,e.object.matrix),fe(m*(e.object.top-e.object.bottom)/e.object.zoom/b.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function ie(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f/=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function ge(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f*=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function se(i,a){if(!e.zoomToCursor)return;W=!0;const u=e.domElement.getBoundingClientRect(),m=i-u.left,b=a-u.top,P=u.width,w=u.height;S.x=m/P*2-1,S.y=-(b/w)*2+1,me.set(S.x,S.y,1).unproject(e.object).sub(e.object.position).normalize()}function ne(i){return Math.max(e.minDistance,Math.min(e.maxDistance,i))}function _e(i){C.set(i.clientX,i.clientY)}function We(i){se(i.clientX,i.clientX),k.set(i.clientX,i.clientY)}function ye(i){I.set(i.clientX,i.clientY)}function Ze(i){O.set(i.clientX,i.clientY),v.subVectors(O,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(O),e.update()}function Xe(i){B.set(i.clientX,i.clientY),R.subVectors(B,k),R.y>0?ie(Z(R.y)):R.y<0&&ge(Z(R.y)),k.copy(B),e.update()}function qe(i){A.set(i.clientX,i.clientY),V.subVectors(A,I).multiplyScalar(e.panSpeed),U(V.x,V.y),I.copy(A),e.update()}function Je(i){se(i.clientX,i.clientY),i.deltaY<0?ge(Z(i.deltaY)):i.deltaY>0&&ie(Z(i.deltaY)),e.update()}function $e(i){let a=!1;switch(i.code){case e.keys.UP:i.ctrlKey||i.metaKey||i.shiftKey?X(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),a=!0;break;case e.keys.BOTTOM:i.ctrlKey||i.metaKey||i.shiftKey?X(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),a=!0;break;case e.keys.LEFT:i.ctrlKey||i.metaKey||i.shiftKey?Y(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),a=!0;break;case e.keys.RIGHT:i.ctrlKey||i.metaKey||i.shiftKey?Y(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),a=!0;break}a&&(i.preventDefault(),e.update())}function be(i){if(g.length===1)C.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);C.set(u,m)}}function Ee(i){if(g.length===1)I.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);I.set(u,m)}}function we(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);k.set(0,b)}function Qe(i){e.enableZoom&&we(i),e.enablePan&&Ee(i)}function et(i){e.enableZoom&&we(i),e.enableRotate&&be(i)}function De(i){if(g.length==1)O.set(i.pageX,i.pageY);else{const u=z(i),m=.5*(i.pageX+u.x),b=.5*(i.pageY+u.y);O.set(m,b)}v.subVectors(O,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(O)}function Me(i){if(g.length===1)A.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);A.set(u,m)}V.subVectors(A,I).multiplyScalar(e.panSpeed),U(V.x,V.y),I.copy(A)}function Te(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);B.set(0,b),R.set(0,Math.pow(B.y/k.y,e.zoomSpeed)),ie(R.y),k.copy(B);const P=(i.pageX+a.x)*.5,w=(i.pageY+a.y)*.5;se(P,w)}function tt(i){e.enableZoom&&Te(i),e.enablePan&&Me(i)}function it(i){e.enableZoom&&Te(i),e.enableRotate&&De(i)}function Le(i){e.enabled!==!1&&(g.length===0&&(e.domElement.setPointerCapture(i.pointerId),e.domElement.addEventListener("pointermove",oe),e.domElement.addEventListener("pointerup",F)),!lt(i)&&(at(i),i.pointerType==="touch"?Ce(i):st(i)))}function oe(i){e.enabled!==!1&&(i.pointerType==="touch"?rt(i):nt(i))}function F(i){switch(ct(i),g.length){case 0:e.domElement.releasePointerCapture(i.pointerId),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.dispatchEvent(Ve),r=o.NONE;break;case 1:const a=g[0],u=N[a];Ce({pointerId:a,pageX:u.x,pageY:u.y});break}}function st(i){let a;switch(i.button){case 0:a=e.mouseButtons.LEFT;break;case 1:a=e.mouseButtons.MIDDLE;break;case 2:a=e.mouseButtons.RIGHT;break;default:a=-1}switch(a){case s.MOUSE.DOLLY:if(e.enableZoom===!1)return;We(i),r=o.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enablePan===!1)return;ye(i),r=o.PAN}else{if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}else{if(e.enablePan===!1)return;ye(i),r=o.PAN}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function nt(i){switch(r){case o.ROTATE:if(e.enableRotate===!1)return;Ze(i);break;case o.DOLLY:if(e.enableZoom===!1)return;Xe(i);break;case o.PAN:if(e.enablePan===!1)return;qe(i);break}}function Se(i){e.enabled===!1||e.enableZoom===!1||r!==o.NONE||(i.preventDefault(),e.dispatchEvent(ce),Je(ot(i)),e.dispatchEvent(Ve))}function ot(i){const a=i.deltaMode,u={clientX:i.clientX,clientY:i.clientY,deltaY:i.deltaY};switch(a){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return i.ctrlKey&&!te&&(u.deltaY*=10),u}function Pe(i){i.key==="Control"&&(te=!0,e.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(i){i.key==="Control"&&(te=!1,e.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function re(i){e.enabled===!1||e.enablePan===!1||$e(i)}function Ce(i){switch(Ie(i),g.length){case 1:switch(e.touches.ONE){case s.TOUCH.ROTATE:if(e.enableRotate===!1)return;be(i),r=o.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(e.enablePan===!1)return;Ee(i),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(e.touches.TWO){case s.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Qe(i),r=o.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;et(i),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function rt(i){switch(Ie(i),r){case o.TOUCH_ROTATE:if(e.enableRotate===!1)return;De(i),e.update();break;case o.TOUCH_PAN:if(e.enablePan===!1)return;Me(i),e.update();break;case o.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;tt(i),e.update();break;case o.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;it(i),e.update();break;default:r=o.NONE}}function Oe(i){e.enabled!==!1&&i.preventDefault()}function at(i){g.push(i.pointerId)}function ct(i){delete N[i.pointerId];for(let a=0;a<g.length;a++)if(g[a]==i.pointerId){g.splice(a,1);return}}function lt(i){for(let a=0;a<g.length;a++)if(g[a]==i.pointerId)return!0;return!1}function Ie(i){let a=N[i.pointerId];a===void 0&&(a=new s.Vector2,N[i.pointerId]=a),a.set(i.pageX,i.pageY)}function z(i){const a=i.pointerId===g[0]?g[1]:g[0];return N[a]}e.domElement.addEventListener("contextmenu",Oe),e.domElement.addEventListener("pointerdown",Le),e.domElement.addEventListener("pointercancel",F),e.domElement.addEventListener("wheel",Se,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Pe,{passive:!0,capture:!0}),this.update()}}const $={enableDamping:!0,dampingFactor:.05},H=class H extends pt{constructor(t,e,o=$){super(t,e);c(this,"uuid",s.MathUtils.generateUUID());c(this,"object");this.domElement=e,this.domElement=e,this.object=t,this.enableDamping=o.enableDamping??$.enableDamping,this.dampingFactor=o.dampingFactor??$.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}tick(){this.enabled&&this.update()}computeEncompassingView(t){const e=t.getCenter(new s.Vector3),o=t.getSize(new s.Vector3),r=Math.max(o.x,o.y,o.z)*1.25;return{position:this.object.position.clone().normalize().clone().multiplyScalar(r),target:e.clone()}}zoomIn(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()-e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}zoomOut(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()+e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}};c(H,"DEFAULT_ZOOM_FACTOR",1);let Q=H;class ft extends s.OrthographicCamera{constructor(t,e,o){super(-1,1,1,-1,.1,100);c(this,"axesHelper");c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_restoreViewport",new s.Vector4);this.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper=new s.AxesHelper(.5),this.axesHelper.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new s.Color(x.AxesColorRed),new s.Color(x.AxesColorGreen),new s.Color(x.AxesColorBlue));const r=new ae("X",.2,x.AxesColorRedLetter),d=new ae("Y",.2,x.AxesColorGreenLetter),h=new ae("Z",.2,x.AxesColorBlueLetter);r.layers.mask=y.COORDINATE_LAYER_MASK,d.layers.mask=y.COORDINATE_LAYER_MASK,h.layers.mask=y.COORDINATE_LAYER_MASK,r.position.set(.7,0,0),d.position.set(0,.7,0),h.position.set(0,0,.7),this.axesHelper.add(r),this.axesHelper.add(d),this.axesHelper.add(h),this.add(this.axesHelper),this._renderer=t,this._scene=e,this._camera=o,this._scene.add(this)}tick(){const t=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=t}dispose(){this._scene.remove(this)}setFromCameraMatrix(t){this.axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(t).invert())}}class gt extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEAmbientLight",!0);c(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=y.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(t){this._light.color=t}setIntensity(t){this._light.intensity=t}setEnabled(t){this._light.visible=t}}class _t extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEPointLight",!0);c(this,"isMovable",!0);c(this,"isSelectable",!0);c(this,"gizmo",null);c(this,"light");c(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=y.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const t=.1,e=new s.SphereGeometry(t,t*320,t*320),o=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(e,o),this.mesh.layers.mask=y.UI_LAYER_MASK,this.add(this.mesh)}setColor(t){this.light.color=t,this.mesh.material.color=t}setIntensity(t){this.light.intensity=t,this.mesh.material.opacity=t>.8?.8:t*.8}setEnabled(t){this.light.visible=t}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class ze extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVESceneLight",!0);c(this,"_hemiLight");c(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=y.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=y.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const t=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=t,this._dirLight.shadow.camera.top=t,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}setColor(t){this._hemiLight.color=t,this._dirLight.color=t}setIntensity(t){this._hemiLight.intensity=t*2,this._dirLight.intensity=t*3}setEnabled(t){this._hemiLight.visible=t,this._dirLight.visible=t}}const ee=l=>l.parent?ee(l.parent):l;class yt{constructor(){c(this,"isMovable",!0)}}class bt{constructor(){c(this,"isSelectable",!0)}}function Ne(l,n){return n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(o=>{if(o==="constructor")return;const r=Object.getOwnPropertyDescriptor(t.prototype,o);Object.defineProperty(l.prototype,o,r)});const e=new t;Object.getOwnPropertyNames(e).forEach(o=>{const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(l.prototype,o,r)})}),l}class de extends Ne(s.Object3D,[bt,yt]){constructor(){super();c(this,"isDIVENode",!0);c(this,"gizmo",null);c(this,"_positionWorldBuffer");c(this,"_boundingBox");this.layers.mask=y.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new s.Vector3,this._boundingBox=new s.Box3}setPosition(t){if(!this.parent){this.position.set(t.x,t.y,t.z);return}const e=new s.Vector3(t.x,t.y,t.z);this.position.copy(this.parent.worldToLocal(e)),"isDIVEGroup"in this.parent&&this.parent.updateLineTo(this)}setRotation(t){this.rotation.set(t.x,t.y,t.z)}setScale(t){this.scale.set(t.x,t.y,t.z)}setVisibility(t){this.visible=t}setToWorldOrigin(){this.position.set(0,0,0),E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class Ye extends de{constructor(){super(...arguments);c(this,"isDIVEModel",!0);c(this,"_mesh",null);c(this,"_material",null);c(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}async setFromURL(t){const o=await(await this._getAssetLoader()).load(t);this.setFromGLTF(o),E.getModule("State").then(r=>{var d;(d=r.get(this.userData.id))==null||d.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(t){this.clear(),this._boundingBox.makeEmpty(),t.traverse(e=>{e.castShadow=!0,e.receiveShadow=!0,e.layers.mask=this.layers.mask,this._boundingBox.expandByObject(e),!this._mesh&&"isMesh"in e&&(this._mesh=e,this._material?this._mesh.material=this._material:this._material=e.material)}),this.add(t)}setMaterial(t){this._material||(this._material=new s.MeshStandardMaterial),t.vertexColors!==void 0&&(this._material.vertexColors=t.vertexColors),t.color!==void 0&&this._material.color.set(t.color),t.map!==void 0&&(this._material.map=t.map),t.normalMap!==void 0&&(this._material.normalMap=t.normalMap),t.roughness!==void 0&&(this._material.roughness=t.roughness),t.roughnessMap!==void 0&&(this._material.roughnessMap=t.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),t.metalness!==void 0&&(this._material.metalness=t.metalness),t.metalnessMap!==void 0&&(this._material.metalnessMap=t.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}}class Et extends de{constructor(){super();c(this,"isDIVEPrimitive",!0);c(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=y.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}setGeometry(t){const e=this.assembleGeometry(t);e&&(this._mesh.geometry=e,this._boundingBox.setFromObject(this._mesh))}setMaterial(t){const e=this._mesh.material;t.vertexColors!==void 0&&(e.vertexColors=t.vertexColors),t.color!==void 0&&(e.color=new s.Color(t.color)),t.map!==void 0&&(e.map=t.map),t.normalMap!==void 0&&(e.normalMap=t.normalMap),t.roughness!==void 0&&(e.roughness=t.roughness),t.roughnessMap!==void 0&&(e.roughnessMap=t.roughnessMap,e.roughnessMap&&(e.roughness=1)),t.metalness!==void 0&&(e.metalness=t.metalness),t.metalnessMap!==void 0&&(e.metalnessMap=t.metalnessMap,e.metalnessMap&&(e.metalness=0)),this._mesh&&(this._mesh.material=e)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}assembleGeometry(t){switch(this._mesh.material.flatShading=!1,t.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(t);case"sphere":return this.createSphereGeometry(t);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(t);case"cube":case"box":return this.createBoxGeometry(t);case"cone":return this.createConeGeometry(t);case"wall":return this.createWallGeometry(t);case"plane":return this.createPlaneGeometry(t);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",t.name.toLowerCase()),null}}createCylinderGeometry(t){const e=new s.CylinderGeometry(t.width/2,t.width/2,t.height,64);return e.translate(0,t.height/2,0),e}createSphereGeometry(t){return new s.SphereGeometry(t.width/2,256,256)}createPyramidGeometry(t){const e=new Float32Array([-t.width/2,0,-t.depth/2,t.width/2,0,-t.depth/2,t.width/2,0,t.depth/2,-t.width/2,0,t.depth/2,0,t.height,0]),o=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),r=new s.BufferGeometry;return r.setAttribute("position",new s.BufferAttribute(e,3)),r.setIndex(new s.BufferAttribute(o,1)),r.computeVertexNormals(),r.computeBoundingBox(),r.computeBoundingSphere(),r}createBoxGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}createConeGeometry(t){const e=new s.ConeGeometry(t.width/2,t.height,256);return e.translate(0,t.height/2,0),e}createWallGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth||.05,16);return e.translate(0,t.height/2,0),e}createPlaneGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}}class wt extends de{constructor(){super();c(this,"isDIVEGroup",!0);c(this,"_members");c(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}setPosition(t){super.setPosition(t),this._members.forEach(e=>{"isDIVENode"in e&&e.onMove()})}setLinesVisibility(t,e){if(!e){this._lines.forEach(r=>{r.visible=t});return}const o=this._members.indexOf(e);o!==-1&&(this._lines[o].visible=t)}attach(t){if(this._members.includes(t))return this;const e=this.createLine();return this.add(e),this._lines.push(e),super.attach(t),this._members.push(t),this._updateLineTo(e,t),this.setLinesVisibility(!0,t),this}remove(t){const e=this._members.indexOf(t);if(e===-1)return this;const o=this._lines[e];return super.remove(o),this._lines.splice(e,1),super.remove(t),this._members.splice(e,1),this}updateLineTo(t){const e=this._members.indexOf(t);e!==-1&&this._updateLineTo(this._lines[e],t)}createLine(){const t=new s.BufferGeometry,e=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),o=new s.Line(t,e);return o.visible=!1,o}_updateLineTo(t,e){const o=[new s.Vector3(0,0,0),e.position.clone()];t.geometry.setFromPoints(o),t.computeLineDistances()}}class Dt extends s.Mesh{constructor(){super(new s.PlaneGeometry(1e4,1e4),new s.MeshStandardMaterial({color:new s.Color(150/255,150/255,150/255)}));c(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=y.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}setVisibility(t){this.visible=t}setColor(t){this.material.color=new s.Color(t)}}class Mt extends s.Object3D{constructor(){super();c(this,"isDIVERoot",!0);c(this,"_floor");c(this,"_assetLoader",null);this.name="Root",this._floor=new Dt,this.add(this._floor)}get floor(){return this._floor}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}computeSceneBB(){const t=new s.Box3;return this.children.forEach(e=>{"isDIVEFloor"in e||e.traverse(o=>{"isObject3D"in o&&t.expandByObject(o)})}),t}getSceneObject(t){let e;return this.traverse(o=>{e||o.userData.id===t.id&&(e=o)}),e}addSceneObject(t){let e=this.getSceneObject(t);if(e)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`),e;switch(t.entityType){case"pov":break;case"light":{switch(t.type){case"scene":{e=new ze;break}case"ambient":{e=new gt;break}case"point":{e=new _t;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${t.type}`)}e.name=t.name,e.userData.id=t.id,this.add(e),this._updateLight(e,t);break}case"model":{e=new Ye,e.name=t.name,e.userData.id=t.id,e.userData.uri=t.uri,this.add(e),this._updateModel(e,t);break}case"primitive":{e=new Et,e.name=t.name,e.userData.id=t.id,this.add(e),this._updatePrimitive(e,t);break}case"group":{e=new wt,e.name=t.name,e.userData.id=t.id,this.add(e),this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`)}return e}updateSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`);return}switch(t.entityType){case"pov":break;case"light":{this._updateLight(e,t);break}case"model":{this._updateModel(e,t);break}case"primitive":{this._updatePrimitive(e,t);break}case"group":{this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`)}}deleteSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.deleteSceneObject: Object with id ${t.id} not found`);return}switch(t.entityType){case"pov":break;case"light":{this._deleteLight(e);break}case"model":{this._deleteModel(e);break}case"primitive":{this._deletePrimitive(e);break}case"group":{this._deleteGroup(e);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`)}}_updateLight(t,e){e.name!==void 0&&e.name!==null&&(t.name=e.name),e.position!==void 0&&e.position!==null&&t.position.set(e.position.x,e.position.y,e.position.z),e.intensity!==void 0&&e.intensity!==null&&t.setIntensity(e.intensity),e.enabled!==void 0&&e.enabled!==null&&t.setEnabled(e.enabled),e.color!==void 0&&e.color!==null&&t.setColor(new s.Color(e.color)),e.visible!==void 0&&e.visible!==null&&(t.visible=e.visible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateModel(t,e){e.uri!==void 0&&t.setFromURL(e.uri),e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updatePrimitive(t,e){e.name!==void 0&&(t.name=e.name),e.geometry!==void 0&&t.setGeometry(e.geometry),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateGroup(t,e){e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.bbVisible!==void 0&&t.setLinesVisibility(e.bbVisible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_deleteLight(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteModel(t){this._detachTransformControls(t),t.parent.remove(t)}_deletePrimitive(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteGroup(t){this._detachTransformControls(t);for(let e=t.members.length-1;e>=0;e--)this.attach(t.members[e]);t.parent.remove(t)}_setParent(t){const e=this.getSceneObject(t);if(t.parentId!==null){const o=this.getSceneObject({id:t.parentId,entityType:t.entityType});if(!o)return;o.attach(e)}else this.attach(e)}_detachTransformControls(t){this._findScene(t).children.find(e=>{"isTransformControls"in e&&e.detach()})}_findScene(t){return t.parent!==null?this._findScene(t.parent):t}}const Tt="#888888",Lt="#dddddd";class St extends s.Object3D{constructor(){super(),this.name="Grid";const n=new s.GridHelper(100,100,Tt,Lt);n.material.depthTest=!1,n.layers.mask=y.HELPER_LAYER_MASK,this.add(n)}setVisibility(n){this.visible=n}}class Pt extends s.Scene{constructor(){super();c(this,"_root");c(this,"_grid");this.background=new s.Color(16777215),this._root=new Mt,this.add(this._root),this._grid=new St,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(t){this.background=new s.Color(t)}computeSceneBB(){return this.root.computeSceneBB()}}const Fe={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1};class xt{constructor(n,t,e){c(this,"_webglrenderer");c(this,"_settings");this._scene=n,this._camera=t,this._settings={...Fe,...e??{}},this._webglrenderer=new s.WebGLRenderer({canvas:this._settings.canvas,antialias:this._settings.antialias,alpha:this._settings.alpha,powerPreference:this._settings.powerPreference,precision:this._settings.precision,stencil:this._settings.stencil,depth:this._settings.depth,logarithmicDepthBuffer:this._settings.logarithmicDepthBuffer})}get webglrenderer(){return this._webglrenderer}setCanvas(n){this._webglrenderer.dispose(),this._settings.canvas=n,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(n,t){this._webglrenderer.setSize(n,t,!1)}dispose(){this._webglrenderer.dispose()}}class Ct{constructor(){c(this,"_renderer",null);c(this,"_lastTime",0);c(this,"_isRunning",!1);c(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(n){this._renderer=n}addTicker(n){this._tickers.find(t=>t.uuid===n.uuid)||this._tickers.push(n)}removeTicker(n){const t=this._tickers.findIndex(e=>e.uuid===n.uuid);t!==-1&&this._tickers.splice(t,1)}dispose(){this.stop(),this._tickers.forEach(n=>{var t;return(t=n.dispose)==null?void 0:t.call(n)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(n){var e;if(!this._isRunning)return;const t=(n-this._lastTime)/1e3;this._lastTime=n,this._tickers.forEach(o=>o.tick(t)),(e=this._renderer)==null||e.render(),requestAnimationFrame(this._tick.bind(this))}}class Ot{constructor(n,t){c(this,"_resizeObserver");c(this,"_width",0);c(this,"_height",0);this._resizeObserver=new ResizeObserver(e=>{for(const o of e){const{width:r,height:d}=o.contentRect;r===this._width&&d===this._height||(n.onResize(r,d),t.onResize(r,d),this._width=r,this._height=d)}}),this._observeCanvas(n.webglrenderer.domElement)}setCanvas(n){this._resizeObserver.disconnect(),this._observeCanvas(n)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(n){if(n.parentElement)this._resizeObserver.observe(n.parentElement);else{const t=setInterval(()=>{n.parentElement&&(this._resizeObserver.observe(n.parentElement),clearInterval(t))},16)}}}const Ge={autoStart:!0,displayAxes:!1,...Be.DIVEPerspectiveCameraDefaultSettings,...Fe};class It{constructor(n){c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_resizeManager");c(this,"_clock");c(this,"_settings");this._settings={...Ge,...n??{}},this._scene=new Pt,this._camera=new Be.DIVEPerspectiveCamera(this._settings),this._renderer=new xt(this._scene,this._camera,this._settings),this._resizeManager=new Ot(this._renderer,this._camera),this._clock=new Ct,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(n){this._renderer.setCanvas(n),this._resizeManager.setCanvas(n)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}function D(l,n){const t=(l+"e").split("e");return+(t[0]+"e"+(+t[1]+(n||0)))}function At(l,n=0){const t=D(l,+n);return D(Math.ceil(t),-n)}function Rt(l,n=0){const t=D(l,+n);return D(Math.floor(t),-n)}function je(l,n=0){if(l<0)return-je(-l,n);const t=D(l,+n);return D(Math.round(t),-n)}function vt(l,n,t){return Math.atan2(l.clone().cross(n).dot(t),n.clone().dot(l))}function Vt(l,n=0){const t=D(l,+n);return D(Math.round(t),-n).toFixed(n)}function kt(l,n=0){const t=D(l,+n);return D(Math.trunc(t),-n)}function Bt(l){return(s.MathUtils.radToDeg(l)+360)%360}function Ut(l){return s.MathUtils.degToRad(l)}const zt={ceilExp:At,floorExp:Rt,roundExp:je,toFixedExp:Vt,truncateExp:kt,signedAngleTo:vt,radToDeg:Bt,degToRad:Ut};window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const He={...Ge,...$};class ue{constructor(n){c(this,"_settings");c(this,"_engine");c(this,"orbitController");c(this,"axisCamera");this._settings={...He,...n??{}},this._engine=new It(n),this.orbitController=new Q(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.axisCamera=new ft(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.axisCamera)):this.axisCamera=null,Promise.resolve().then(()=>require("./chunks/package-CafekLb8.cjs")).then(t=>{console.log(`DIVE ${t.default.version} initialized successfully!`),console.log(`
|
|
1
|
+
"use strict";var ht=Object.defineProperty;var dt=(l,n,t)=>n in l?ht(l,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[n]=t;var c=(l,n,t)=>dt(l,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three"),ae=require("three-spritetext"),y=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),x=require("./chunks/findInterface-BEdL2iUQ.cjs"),E=require("./chunks/ModuleRegistry-NyNtjHb2.cjs"),Be=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),K=require("./chunks/FileTypes-DzVpDu_p.cjs"),he=require("./chunks/index-MNP0K5dt.cjs"),Ue=require("./chunks/parse-error-Bd09D_1L.cjs"),ve={type:"change"},ce={type:"start"},Ve={type:"end"},J=new s.Ray,ke=new s.Plane,ut=Math.cos(70*s.MathUtils.DEG2RAD);class mt extends s.EventDispatcher{constructor(n,t){super(),this.object=n,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(i){i.addEventListener("keydown",re),this._domElementKeyEvents=i},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",re),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(ve),e.update(),r=o.NONE},this.update=function(){const i=new s.Vector3,a=new s.Quaternion().setFromUnitVectors(n.up,new s.Vector3(0,1,0)),u=a.clone().invert(),m=new s.Vector3,b=new s.Quaternion,P=new s.Vector3,w=2*Math.PI;return function(lt=null){const Ae=e.object.position;i.copy(Ae).sub(e.target),i.applyQuaternion(a),h.setFromVector3(i),e.autoRotate&&r===o.NONE&&Y(He(lt)),e.enableDamping?(h.theta+=p.theta*e.dampingFactor,h.phi+=p.phi*e.dampingFactor):(h.theta+=p.theta,h.phi+=p.phi);let M=e.minAzimuthAngle,T=e.maxAzimuthAngle;isFinite(M)&&isFinite(T)&&(M<-Math.PI?M+=w:M>Math.PI&&(M-=w),T<-Math.PI?T+=w:T>Math.PI&&(T-=w),M<=T?h.theta=Math.max(M,Math.min(T,h.theta)):h.theta=h.theta>(M+T)/2?Math.max(M,h.theta):Math.min(T,h.theta)),h.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,h.phi)),h.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(_,e.dampingFactor):e.target.add(_),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let G=!1;if(e.zoomToCursor&&W||e.object.isOrthographicCamera)h.radius=ne(h.radius);else{const L=h.radius;h.radius=ne(h.radius*f),G=L!=h.radius}if(i.setFromSpherical(h),i.applyQuaternion(u),Ae.copy(e.target).add(i),e.object.lookAt(e.target),e.enableDamping===!0?(p.theta*=1-e.dampingFactor,p.phi*=1-e.dampingFactor,_.multiplyScalar(1-e.dampingFactor)):(p.set(0,0,0),_.set(0,0,0)),e.zoomToCursor&&W){let L=null;if(e.object.isPerspectiveCamera){const j=i.length();L=ne(j*f);const q=j-L;e.object.position.addScaledVector(me,q),e.object.updateMatrixWorld(),G=!!q}else if(e.object.isOrthographicCamera){const j=new s.Vector3(S.x,S.y,0);j.unproject(e.object);const q=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),e.object.updateProjectionMatrix(),G=q!==e.object.zoom;const Re=new s.Vector3(S.x,S.y,0);Re.unproject(e.object),e.object.position.sub(Re).add(j),e.object.updateMatrixWorld(),L=i.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;L!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(L).add(e.object.position):(J.origin.copy(e.object.position),J.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(J.direction))<ut?n.lookAt(e.target):(ke.setFromNormalAndCoplanarPoint(e.object.up,e.target),J.intersectPlane(ke,e.target))))}else if(e.object.isOrthographicCamera){const L=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),L!==e.object.zoom&&(e.object.updateProjectionMatrix(),G=!0)}return f=1,W=!1,G||m.distanceToSquared(e.object.position)>d||8*(1-b.dot(e.object.quaternion))>d||P.distanceToSquared(e.target)>d?(e.dispatchEvent(ve),m.copy(e.object.position),b.copy(e.object.quaternion),P.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Ie),e.domElement.removeEventListener("pointerdown",Le),e.domElement.removeEventListener("pointercancel",F),e.domElement.removeEventListener("wheel",Se),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.domElement.getRootNode().removeEventListener("keydown",Pe,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",re),e._domElementKeyEvents=null)};const e=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=o.NONE;const d=1e-6,h=new s.Spherical,p=new s.Spherical;let f=1;const _=new s.Vector3,C=new s.Vector2,I=new s.Vector2,v=new s.Vector2,O=new s.Vector2,A=new s.Vector2,V=new s.Vector2,k=new s.Vector2,B=new s.Vector2,R=new s.Vector2,me=new s.Vector3,S=new s.Vector2;let W=!1;const g=[],N={};let te=!1;function He(i){return i!==null?2*Math.PI/60*e.autoRotateSpeed*i:2*Math.PI/60/60*e.autoRotateSpeed}function Z(i){const a=Math.abs(i*.01);return Math.pow(.95,e.zoomSpeed*a)}function Y(i){p.theta-=i}function X(i){p.phi-=i}const pe=function(){const i=new s.Vector3;return function(u,m){i.setFromMatrixColumn(m,0),i.multiplyScalar(-u),_.add(i)}}(),fe=function(){const i=new s.Vector3;return function(u,m){e.screenSpacePanning===!0?i.setFromMatrixColumn(m,1):(i.setFromMatrixColumn(m,0),i.crossVectors(e.object.up,i)),i.multiplyScalar(u),_.add(i)}}(),U=function(){const i=new s.Vector3;return function(u,m){const b=e.domElement;if(e.object.isPerspectiveCamera){const P=e.object.position;i.copy(P).sub(e.target);let w=i.length();w*=Math.tan(e.object.fov/2*Math.PI/180),pe(2*u*w/b.clientHeight,e.object.matrix),fe(2*m*w/b.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(pe(u*(e.object.right-e.object.left)/e.object.zoom/b.clientWidth,e.object.matrix),fe(m*(e.object.top-e.object.bottom)/e.object.zoom/b.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function ie(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f/=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function ge(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f*=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function se(i,a){if(!e.zoomToCursor)return;W=!0;const u=e.domElement.getBoundingClientRect(),m=i-u.left,b=a-u.top,P=u.width,w=u.height;S.x=m/P*2-1,S.y=-(b/w)*2+1,me.set(S.x,S.y,1).unproject(e.object).sub(e.object.position).normalize()}function ne(i){return Math.max(e.minDistance,Math.min(e.maxDistance,i))}function _e(i){C.set(i.clientX,i.clientY)}function Ke(i){se(i.clientX,i.clientX),k.set(i.clientX,i.clientY)}function ye(i){O.set(i.clientX,i.clientY)}function We(i){I.set(i.clientX,i.clientY),v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(I),e.update()}function Ze(i){B.set(i.clientX,i.clientY),R.subVectors(B,k),R.y>0?ie(Z(R.y)):R.y<0&&ge(Z(R.y)),k.copy(B),e.update()}function Xe(i){A.set(i.clientX,i.clientY),V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A),e.update()}function qe(i){se(i.clientX,i.clientY),i.deltaY<0?ge(Z(i.deltaY)):i.deltaY>0&&ie(Z(i.deltaY)),e.update()}function Je(i){let a=!1;switch(i.code){case e.keys.UP:i.ctrlKey||i.metaKey||i.shiftKey?X(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),a=!0;break;case e.keys.BOTTOM:i.ctrlKey||i.metaKey||i.shiftKey?X(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),a=!0;break;case e.keys.LEFT:i.ctrlKey||i.metaKey||i.shiftKey?Y(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),a=!0;break;case e.keys.RIGHT:i.ctrlKey||i.metaKey||i.shiftKey?Y(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),a=!0;break}a&&(i.preventDefault(),e.update())}function be(i){if(g.length===1)C.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);C.set(u,m)}}function Ee(i){if(g.length===1)O.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);O.set(u,m)}}function we(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);k.set(0,b)}function $e(i){e.enableZoom&&we(i),e.enablePan&&Ee(i)}function Qe(i){e.enableZoom&&we(i),e.enableRotate&&be(i)}function De(i){if(g.length==1)I.set(i.pageX,i.pageY);else{const u=z(i),m=.5*(i.pageX+u.x),b=.5*(i.pageY+u.y);I.set(m,b)}v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;Y(2*Math.PI*v.x/a.clientHeight),X(2*Math.PI*v.y/a.clientHeight),C.copy(I)}function Me(i){if(g.length===1)A.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);A.set(u,m)}V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A)}function Te(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);B.set(0,b),R.set(0,Math.pow(B.y/k.y,e.zoomSpeed)),ie(R.y),k.copy(B);const P=(i.pageX+a.x)*.5,w=(i.pageY+a.y)*.5;se(P,w)}function et(i){e.enableZoom&&Te(i),e.enablePan&&Me(i)}function tt(i){e.enableZoom&&Te(i),e.enableRotate&&De(i)}function Le(i){e.enabled!==!1&&(g.length===0&&(e.domElement.setPointerCapture(i.pointerId),e.domElement.addEventListener("pointermove",oe),e.domElement.addEventListener("pointerup",F)),!ct(i)&&(rt(i),i.pointerType==="touch"?Ce(i):it(i)))}function oe(i){e.enabled!==!1&&(i.pointerType==="touch"?ot(i):st(i))}function F(i){switch(at(i),g.length){case 0:e.domElement.releasePointerCapture(i.pointerId),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.dispatchEvent(Ve),r=o.NONE;break;case 1:const a=g[0],u=N[a];Ce({pointerId:a,pageX:u.x,pageY:u.y});break}}function it(i){let a;switch(i.button){case 0:a=e.mouseButtons.LEFT;break;case 1:a=e.mouseButtons.MIDDLE;break;case 2:a=e.mouseButtons.RIGHT;break;default:a=-1}switch(a){case s.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ke(i),r=o.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enablePan===!1)return;ye(i),r=o.PAN}else{if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enableRotate===!1)return;_e(i),r=o.ROTATE}else{if(e.enablePan===!1)return;ye(i),r=o.PAN}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function st(i){switch(r){case o.ROTATE:if(e.enableRotate===!1)return;We(i);break;case o.DOLLY:if(e.enableZoom===!1)return;Ze(i);break;case o.PAN:if(e.enablePan===!1)return;Xe(i);break}}function Se(i){e.enabled===!1||e.enableZoom===!1||r!==o.NONE||(i.preventDefault(),e.dispatchEvent(ce),qe(nt(i)),e.dispatchEvent(Ve))}function nt(i){const a=i.deltaMode,u={clientX:i.clientX,clientY:i.clientY,deltaY:i.deltaY};switch(a){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return i.ctrlKey&&!te&&(u.deltaY*=10),u}function Pe(i){i.key==="Control"&&(te=!0,e.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(i){i.key==="Control"&&(te=!1,e.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function re(i){e.enabled===!1||e.enablePan===!1||Je(i)}function Ce(i){switch(Oe(i),g.length){case 1:switch(e.touches.ONE){case s.TOUCH.ROTATE:if(e.enableRotate===!1)return;be(i),r=o.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(e.enablePan===!1)return;Ee(i),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(e.touches.TWO){case s.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;$e(i),r=o.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Qe(i),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(ce)}function ot(i){switch(Oe(i),r){case o.TOUCH_ROTATE:if(e.enableRotate===!1)return;De(i),e.update();break;case o.TOUCH_PAN:if(e.enablePan===!1)return;Me(i),e.update();break;case o.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;et(i),e.update();break;case o.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;tt(i),e.update();break;default:r=o.NONE}}function Ie(i){e.enabled!==!1&&i.preventDefault()}function rt(i){g.push(i.pointerId)}function at(i){delete N[i.pointerId];for(let a=0;a<g.length;a++)if(g[a]==i.pointerId){g.splice(a,1);return}}function ct(i){for(let a=0;a<g.length;a++)if(g[a]==i.pointerId)return!0;return!1}function Oe(i){let a=N[i.pointerId];a===void 0&&(a=new s.Vector2,N[i.pointerId]=a),a.set(i.pageX,i.pageY)}function z(i){const a=i.pointerId===g[0]?g[1]:g[0];return N[a]}e.domElement.addEventListener("contextmenu",Ie),e.domElement.addEventListener("pointerdown",Le),e.domElement.addEventListener("pointercancel",F),e.domElement.addEventListener("wheel",Se,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Pe,{passive:!0,capture:!0}),this.update()}}const $={enableDamping:!0,dampingFactor:.05},H=class H extends mt{constructor(t,e,o=$){super(t,e);c(this,"uuid",s.MathUtils.generateUUID());c(this,"object");this.domElement=e,this.domElement=e,this.object=t,this.enableDamping=o.enableDamping??$.enableDamping,this.dampingFactor=o.dampingFactor??$.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}tick(){this.enabled&&this.update()}computeEncompassingView(t){const e=t.getCenter(new s.Vector3),o=t.getSize(new s.Vector3),r=Math.max(o.x,o.y,o.z)*1.25;return{position:this.object.position.clone().normalize().clone().multiplyScalar(r),target:e.clone()}}zoomIn(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()-e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}zoomOut(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()+e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}};c(H,"DEFAULT_ZOOM_FACTOR",1);let Q=H;class pt extends s.OrthographicCamera{constructor(t,e,o){super(-1,1,1,-1,.1,100);c(this,"axesHelper");c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_restoreViewport",new s.Vector4);this.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper=new s.AxesHelper(.5),this.axesHelper.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new s.Color(x.AxesColorRed),new s.Color(x.AxesColorGreen),new s.Color(x.AxesColorBlue));const r=new ae("X",.2,x.AxesColorRedLetter),d=new ae("Y",.2,x.AxesColorGreenLetter),h=new ae("Z",.2,x.AxesColorBlueLetter);r.layers.mask=y.COORDINATE_LAYER_MASK,d.layers.mask=y.COORDINATE_LAYER_MASK,h.layers.mask=y.COORDINATE_LAYER_MASK,r.position.set(.7,0,0),d.position.set(0,.7,0),h.position.set(0,0,.7),this.axesHelper.add(r),this.axesHelper.add(d),this.axesHelper.add(h),this.add(this.axesHelper),this._renderer=t,this._scene=e,this._camera=o,this._scene.add(this)}tick(){const t=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.setFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=t}dispose(){this._scene.remove(this)}setFromCameraMatrix(t){this.axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(t).invert())}}class ft extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEAmbientLight",!0);c(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=y.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(t){this._light.color=t}setIntensity(t){this._light.intensity=t}setEnabled(t){this._light.visible=t}}class gt extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVEPointLight",!0);c(this,"isMovable",!0);c(this,"isSelectable",!0);c(this,"gizmo",null);c(this,"light");c(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=y.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const t=.1,e=new s.SphereGeometry(t,t*320,t*320),o=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(e,o),this.mesh.layers.mask=y.UI_LAYER_MASK,this.add(this.mesh)}setColor(t){this.light.color=t,this.mesh.material.color=t}setIntensity(t){this.light.intensity=t,this.mesh.material.opacity=t>.8?.8:t*.8}setEnabled(t){this.light.visible=t}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class ze extends s.Object3D{constructor(){super();c(this,"isDIVELight",!0);c(this,"isDIVESceneLight",!0);c(this,"_hemiLight");c(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=y.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=y.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const t=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=t,this._dirLight.shadow.camera.top=t,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}setColor(t){this._hemiLight.color=t,this._dirLight.color=t}setIntensity(t){this._hemiLight.intensity=t*2,this._dirLight.intensity=t*3}setEnabled(t){this._hemiLight.visible=t,this._dirLight.visible=t}}const ee=l=>l.parent?ee(l.parent):l;class de extends s.Object3D{constructor(){super();c(this,"isSelectable",!0);c(this,"isMovable",!0);c(this,"isDIVENode",!0);c(this,"gizmo",null);c(this,"_positionWorldBuffer");c(this,"_boundingBox");this.layers.mask=y.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new s.Vector3,this._boundingBox=new s.Box3}setPosition(t){if(!this.parent){this.position.set(t.x,t.y,t.z);return}const e=new s.Vector3(t.x,t.y,t.z);this.position.copy(this.parent.worldToLocal(e)),"isDIVEGroup"in this.parent&&this.parent.updateLineTo(this)}setRotation(t){this.rotation.set(t.x,t.y,t.z)}setScale(t){this.scale.set(t.x,t.y,t.z)}setVisibility(t){this.visible=t}setToWorldOrigin(){this.position.set(0,0,0),E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class Ne extends de{constructor(){super(...arguments);c(this,"isDIVEModel",!0);c(this,"_mesh",null);c(this,"_material",null);c(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}async setFromURL(t){const o=await(await this._getAssetLoader()).load(t);this.setFromGLTF(o),E.getModule("State").then(r=>{var d;(d=r.get(this.userData.id))==null||d.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(t){this.clear(),this._boundingBox.makeEmpty(),t.traverse(e=>{e.castShadow=!0,e.receiveShadow=!0,e.layers.mask=this.layers.mask,this._boundingBox.expandByObject(e),!this._mesh&&"isMesh"in e&&(this._mesh=e,this._material?this._mesh.material=this._material:this._material=e.material)}),this.add(t)}setMaterial(t){this._material||(this._material=new s.MeshStandardMaterial),t.vertexColors!==void 0&&(this._material.vertexColors=t.vertexColors),t.color!==void 0&&this._material.color.set(t.color),t.map!==void 0&&(this._material.map=t.map),t.normalMap!==void 0&&(this._material.normalMap=t.normalMap),t.roughness!==void 0&&(this._material.roughness=t.roughness),t.roughnessMap!==void 0&&(this._material.roughnessMap=t.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),t.metalness!==void 0&&(this._material.metalness=t.metalness),t.metalnessMap!==void 0&&(this._material.metalnessMap=t.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}}class _t extends de{constructor(){super();c(this,"isDIVEPrimitive",!0);c(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=y.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}setGeometry(t){const e=this.assembleGeometry(t);e&&(this._mesh.geometry=e,this._boundingBox.setFromObject(this._mesh))}setMaterial(t){const e=this._mesh.material;t.vertexColors!==void 0&&(e.vertexColors=t.vertexColors),t.color!==void 0&&(e.color=new s.Color(t.color)),t.map!==void 0&&(e.map=t.map),t.normalMap!==void 0&&(e.normalMap=t.normalMap),t.roughness!==void 0&&(e.roughness=t.roughness),t.roughnessMap!==void 0&&(e.roughnessMap=t.roughnessMap,e.roughnessMap&&(e.roughness=1)),t.metalness!==void 0&&(e.metalness=t.metalness),t.metalnessMap!==void 0&&(e.metalnessMap=t.metalnessMap,e.metalnessMap&&(e.metalness=0)),this._mesh&&(this._mesh.material=e)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}assembleGeometry(t){switch(this._mesh.material.flatShading=!1,t.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(t);case"sphere":return this.createSphereGeometry(t);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(t);case"cube":case"box":return this.createBoxGeometry(t);case"cone":return this.createConeGeometry(t);case"wall":return this.createWallGeometry(t);case"plane":return this.createPlaneGeometry(t);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",t.name.toLowerCase()),null}}createCylinderGeometry(t){const e=new s.CylinderGeometry(t.width/2,t.width/2,t.height,64);return e.translate(0,t.height/2,0),e}createSphereGeometry(t){return new s.SphereGeometry(t.width/2,256,256)}createPyramidGeometry(t){const e=new Float32Array([-t.width/2,0,-t.depth/2,t.width/2,0,-t.depth/2,t.width/2,0,t.depth/2,-t.width/2,0,t.depth/2,0,t.height,0]),o=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),r=new s.BufferGeometry;return r.setAttribute("position",new s.BufferAttribute(e,3)),r.setIndex(new s.BufferAttribute(o,1)),r.computeVertexNormals(),r.computeBoundingBox(),r.computeBoundingSphere(),r}createBoxGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}createConeGeometry(t){const e=new s.ConeGeometry(t.width/2,t.height,256);return e.translate(0,t.height/2,0),e}createWallGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth||.05,16);return e.translate(0,t.height/2,0),e}createPlaneGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}}class yt extends de{constructor(){super();c(this,"isDIVEGroup",!0);c(this,"_members");c(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}setPosition(t){super.setPosition(t),this._members.forEach(e=>{"isDIVENode"in e&&e.onMove()})}setLinesVisibility(t,e){if(!e){this._lines.forEach(r=>{r.visible=t});return}const o=this._members.indexOf(e);o!==-1&&(this._lines[o].visible=t)}attach(t){if(this._members.includes(t))return this;const e=this.createLine();return this.add(e),this._lines.push(e),super.attach(t),this._members.push(t),this._updateLineTo(e,t),this.setLinesVisibility(!0,t),this}remove(t){const e=this._members.indexOf(t);if(e===-1)return this;const o=this._lines[e];return super.remove(o),this._lines.splice(e,1),super.remove(t),this._members.splice(e,1),this}updateLineTo(t){const e=this._members.indexOf(t);e!==-1&&this._updateLineTo(this._lines[e],t)}createLine(){const t=new s.BufferGeometry,e=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),o=new s.Line(t,e);return o.visible=!1,o}_updateLineTo(t,e){const o=[new s.Vector3(0,0,0),e.position.clone()];t.geometry.setFromPoints(o),t.computeLineDistances()}}class bt extends s.Mesh{constructor(){super(new s.PlaneGeometry(1e4,1e4),new s.MeshStandardMaterial({color:new s.Color(150/255,150/255,150/255)}));c(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=y.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}setVisibility(t){this.visible=t}setColor(t){this.material.color=new s.Color(t)}}class Et extends s.Object3D{constructor(){super();c(this,"isDIVERoot",!0);c(this,"_floor");c(this,"_assetLoader",null);this.name="Root",this._floor=new bt,this.add(this._floor)}get floor(){return this._floor}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}computeSceneBB(){const t=new s.Box3;return this.children.forEach(e=>{"isDIVEFloor"in e||e.traverse(o=>{"isObject3D"in o&&t.expandByObject(o)})}),t}getSceneObject(t){let e;return this.traverse(o=>{e||o.userData.id===t.id&&(e=o)}),e}addSceneObject(t){let e=this.getSceneObject(t);if(e)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`),e;switch(t.entityType){case"pov":break;case"light":{switch(t.type){case"scene":{e=new ze;break}case"ambient":{e=new ft;break}case"point":{e=new gt;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${t.type}`)}e.name=t.name,e.userData.id=t.id,this.add(e),this._updateLight(e,t);break}case"model":{e=new Ne,e.name=t.name,e.userData.id=t.id,e.userData.uri=t.uri,this.add(e),this._updateModel(e,t);break}case"primitive":{e=new _t,e.name=t.name,e.userData.id=t.id,this.add(e),this._updatePrimitive(e,t);break}case"group":{e=new yt,e.name=t.name,e.userData.id=t.id,this.add(e),this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`)}return e}updateSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`);return}switch(t.entityType){case"pov":break;case"light":{this._updateLight(e,t);break}case"model":{this._updateModel(e,t);break}case"primitive":{this._updatePrimitive(e,t);break}case"group":{this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`)}}deleteSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.deleteSceneObject: Object with id ${t.id} not found`);return}switch(t.entityType){case"pov":break;case"light":{this._deleteLight(e);break}case"model":{this._deleteModel(e);break}case"primitive":{this._deletePrimitive(e);break}case"group":{this._deleteGroup(e);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`)}}_updateLight(t,e){e.name!==void 0&&e.name!==null&&(t.name=e.name),e.position!==void 0&&e.position!==null&&t.position.set(e.position.x,e.position.y,e.position.z),e.intensity!==void 0&&e.intensity!==null&&t.setIntensity(e.intensity),e.enabled!==void 0&&e.enabled!==null&&t.setEnabled(e.enabled),e.color!==void 0&&e.color!==null&&t.setColor(new s.Color(e.color)),e.visible!==void 0&&e.visible!==null&&(t.visible=e.visible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateModel(t,e){e.uri!==void 0&&t.setFromURL(e.uri),e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updatePrimitive(t,e){e.name!==void 0&&(t.name=e.name),e.geometry!==void 0&&t.setGeometry(e.geometry),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateGroup(t,e){e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.setPosition(e.position),e.rotation!==void 0&&t.setRotation(e.rotation),e.scale!==void 0&&t.setScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.bbVisible!==void 0&&t.setLinesVisibility(e.bbVisible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_deleteLight(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteModel(t){this._detachTransformControls(t),t.parent.remove(t)}_deletePrimitive(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteGroup(t){this._detachTransformControls(t);for(let e=t.members.length-1;e>=0;e--)this.attach(t.members[e]);t.parent.remove(t)}_setParent(t){const e=this.getSceneObject(t);if(t.parentId!==null){const o=this.getSceneObject({id:t.parentId,entityType:t.entityType});if(!o)return;o.attach(e)}else this.attach(e)}_detachTransformControls(t){this._findScene(t).children.find(e=>{"isTransformControls"in e&&e.detach()})}_findScene(t){return t.parent!==null?this._findScene(t.parent):t}}const wt="#888888",Dt="#dddddd";class Mt extends s.Object3D{constructor(){super(),this.name="Grid";const n=new s.GridHelper(100,100,wt,Dt);n.material.depthTest=!1,n.layers.mask=y.HELPER_LAYER_MASK,this.add(n)}setVisibility(n){this.visible=n}}class Tt extends s.Scene{constructor(){super();c(this,"_root");c(this,"_grid");this.background=new s.Color(16777215),this._root=new Et,this.add(this._root),this._grid=new Mt,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(t){this.background=new s.Color(t)}computeSceneBB(){return this.root.computeSceneBB()}}const Ye={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1};class Lt{constructor(n,t,e){c(this,"_webglrenderer");c(this,"_settings");this._scene=n,this._camera=t,this._settings={...Ye,...e??{}},this._webglrenderer=new s.WebGLRenderer({canvas:this._settings.canvas,antialias:this._settings.antialias,alpha:this._settings.alpha,powerPreference:this._settings.powerPreference,precision:this._settings.precision,stencil:this._settings.stencil,depth:this._settings.depth,logarithmicDepthBuffer:this._settings.logarithmicDepthBuffer})}get webglrenderer(){return this._webglrenderer}setCanvas(n){this._webglrenderer.dispose(),this._settings.canvas=n,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(n,t){this._webglrenderer.setSize(n,t,!1)}dispose(){this._webglrenderer.dispose()}}class St{constructor(){c(this,"_renderer",null);c(this,"_lastTime",0);c(this,"_isRunning",!1);c(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(n){this._renderer=n}addTicker(n){this._tickers.find(t=>t.uuid===n.uuid)||this._tickers.push(n)}removeTicker(n){const t=this._tickers.findIndex(e=>e.uuid===n.uuid);t!==-1&&this._tickers.splice(t,1)}dispose(){this.stop(),this._tickers.forEach(n=>{var t;return(t=n.dispose)==null?void 0:t.call(n)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(n){var e;if(!this._isRunning)return;const t=(n-this._lastTime)/1e3;this._lastTime=n,this._tickers.forEach(o=>o.tick(t)),(e=this._renderer)==null||e.render(),requestAnimationFrame(this._tick.bind(this))}}class Pt{constructor(n,t){c(this,"_resizeObserver");c(this,"_width",0);c(this,"_height",0);this._resizeObserver=new ResizeObserver(e=>{for(const o of e){const{width:r,height:d}=o.contentRect;r===this._width&&d===this._height||(n.onResize(r,d),t.onResize(r,d),this._width=r,this._height=d)}}),this._observeCanvas(n.webglrenderer.domElement)}setCanvas(n){this._resizeObserver.disconnect(),this._observeCanvas(n)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(n){if(n.parentElement)this._resizeObserver.observe(n.parentElement);else{const t=setInterval(()=>{n.parentElement&&(this._resizeObserver.observe(n.parentElement),clearInterval(t))},16)}}}const Fe={autoStart:!0,displayAxes:!1,...Be.DIVEPerspectiveCameraDefaultSettings,...Ye};class xt{constructor(n){c(this,"_renderer");c(this,"_scene");c(this,"_camera");c(this,"_resizeManager");c(this,"_clock");c(this,"_settings");this._settings={...Fe,...n??{}},this._scene=new Tt,this._camera=new Be.DIVEPerspectiveCamera(this._settings),this._renderer=new Lt(this._scene,this._camera,this._settings),this._resizeManager=new Pt(this._renderer,this._camera),this._clock=new St,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(n){this._renderer.setCanvas(n),this._resizeManager.setCanvas(n)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}function D(l,n){const t=(l+"e").split("e");return+(t[0]+"e"+(+t[1]+(n||0)))}function Ct(l,n=0){const t=D(l,+n);return D(Math.ceil(t),-n)}function It(l,n=0){const t=D(l,+n);return D(Math.floor(t),-n)}function Ge(l,n=0){if(l<0)return-Ge(-l,n);const t=D(l,+n);return D(Math.round(t),-n)}function Ot(l,n,t){return Math.atan2(l.clone().cross(n).dot(t),n.clone().dot(l))}function At(l,n=0){const t=D(l,+n);return D(Math.round(t),-n).toFixed(n)}function Rt(l,n=0){const t=D(l,+n);return D(Math.trunc(t),-n)}function vt(l){return(s.MathUtils.radToDeg(l)+360)%360}function Vt(l){return s.MathUtils.degToRad(l)}const kt={ceilExp:Ct,floorExp:It,roundExp:Ge,toFixedExp:At,truncateExp:Rt,signedAngleTo:Ot,radToDeg:vt,degToRad:Vt};window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const je={...Fe,...$};class ue{constructor(n){c(this,"_instanceId",s.MathUtils.generateUUID());c(this,"_settings");c(this,"_engine");c(this,"orbitController");c(this,"axisCamera");this._settings={...je,...n??{}},this._engine=new xt(n),this.orbitController=new Q(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.axisCamera=new pt(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.axisCamera)):this.axisCamera=null,Promise.resolve().then(()=>require("./chunks/package-o6as1hwQ.cjs")).then(t=>{console.log(`DIVE ${t.default.version} initialized successfully!`),console.log(`
|
|
2
2
|
@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
|
|
3
3
|
@@@@+-:::::::---------------------==------------------------------=#@@@@
|
|
4
4
|
@@%=::::.......::---------------------------------------------------------+@@
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
@@@@+:::::::#@@ @@*-------*@@@@
|
|
28
28
|
@@@@@@@ @@@@@@
|
|
29
29
|
|
|
30
|
-
`)})}static async QuickView(n,t){const e=new ue(t);
|
|
30
|
+
`)}),window.DIVE.instances.push(this)}static async QuickView(n,t){const e=new ue(t);e.engine.scene.background=new s.Color(16777215),e.engine.scene.grid.setVisibility(!1),e.engine.scene.root.floor.setVisibility(!0),e.engine.scene.root.floor.setColor(16777215),e.engine.camera.position.set(0,2,2),e.orbitController.target.set(0,.5,0);const o=new ze;o.name="SceneLight",o.userData.id=s.MathUtils.generateUUID(),o.setEnabled(!0),o.visible=!0,o.setIntensity((t==null?void 0:t.lightIntensity)??1),o.setColor(new s.Color(16777215)),e.engine.scene.root.add(o);const r=new Ne;r.name="object",r.userData.id=s.MathUtils.generateUUID(),r.userData.uri=n,r.visible=!0,e.engine.scene.root.add(r),await r.setFromURL(n);const d=e.engine.scene.computeSceneBB(),h=e.orbitController.computeEncompassingView(d);return e.engine.camera.position.copy(h.position),e.orbitController.target.copy(h.target),e}get engine(){return this._engine}get canvas(){return this._engine.renderer.webglrenderer.domElement}setCanvas(n){this._engine.setCanvas(n),this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orbitController=new Q(this._engine.camera,n,this._settings),this._engine.clock.addTicker(this.orbitController)}async dispose(){return new Promise(n=>{this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.axisCamera&&(this._engine.clock.removeTicker(this.axisCamera),this.axisCamera.dispose()),window.DIVE.instances=window.DIVE.instances.filter(t=>t._instanceId!==this._instanceId),n()})}}const le=(l,n)=>{if(Object.keys(l).length===0&&Object.keys(n).length===0)return{};if(typeof l!="object"||typeof n!="object")return n;let t={};return Object.keys(n).forEach(e=>{if(!Object.keys(l).includes(e)){t={...t,[e]:n[e]};return}if(Array.isArray(n[e])){if(!Array.isArray(l[e])){t={...t,[e]:n[e]};return}const o=l[e],r=n[e];if(o.length===0&&r.length===0){t={...t};return}if(o.length!==r.length){t={...t,[e]:n[e]};return}const d=[];if(r.forEach((h,p)=>{const f=le(o[p],r[p]);Object.keys(f).length&&d.push(r[p])}),Object.keys(d).length){t={...t,[e]:d};return}return}if(typeof n[e]=="object"){if(typeof l[e]!="object"){t={...t,[e]:n[e]};return}const o=le(l[e],n[e]);if(Object.keys(o).length){t={...t,[e]:o};return}}l[e]!==n[e]&&(t={...t,[e]:n[e]})}),t};function Bt(l,n){return n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(o=>{if(o==="constructor")return;const r=Object.getOwnPropertyDescriptor(t.prototype,o);Object.defineProperty(l.prototype,o,r)});const e=new t;Object.getOwnPropertyNames(e).forEach(o=>{const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(l.prototype,o,r)})}),l}exports.findInterface=x.findInterface;exports.implementsInterface=x.implementsInterface;exports.getModule=E.getModule;exports.FILE_TYPES=K.FILE_TYPES;exports.NetworkError=K.NetworkError;exports.SUPPORTED_FILE_TYPES=K.SUPPORTED_FILE_TYPES;exports.getFileTypeFromUri=K.getFileTypeFromUri;exports.isFileTypeSupported=K.isFileTypeSupported;exports.ARCompatibilityError=he.ARCompatibilityError;exports.ESystem=he.ESystem;exports.EWebXRUnsupportedReason=he.EWebXRUnsupportedReason;exports.FileTypeError=Ue.FileTypeError;exports.ParseError=Ue.ParseError;exports.DIVE=ue;exports.DIVEDefaultSettings=je;exports.DIVEMath=kt;exports.applyMixins=Bt;exports.findSceneRecursive=ee;exports.getObjectDelta=le;
|
package/build/dive.mjs
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
var Dt = Object.defineProperty;
|
|
2
2
|
var xt = (h, s, t) => s in h ? Dt(h, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[s] = t;
|
|
3
3
|
var a = (h, s, t) => xt(h, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { Ray as Tt, Plane as Lt, MathUtils as
|
|
4
|
+
import { Ray as Tt, Plane as Lt, MathUtils as I, EventDispatcher as Pt, Vector3 as m, MOUSE as U, TOUCH as G, Spherical as Ne, Quaternion as Fe, Vector2 as E, OrthographicCamera as It, Vector4 as St, AxesHelper as Mt, Color as D, Matrix4 as Ct, Object3D as j, AmbientLight as Ot, PointLight as vt, SphereGeometry as Ke, MeshBasicMaterial as At, FrontSide as kt, Mesh as pe, HemisphereLight as Rt, DirectionalLight as Vt, Box3 as Ze, MeshStandardMaterial as fe, Raycaster as Xe, CylinderGeometry as Bt, BufferGeometry as qe, BufferAttribute as Ye, BoxGeometry as de, ConeGeometry as zt, LineDashedMaterial as Nt, Line as Ft, PlaneGeometry as Yt, GridHelper as Ut, Scene as Gt, WebGLRenderer as Ue } from "three";
|
|
5
5
|
import ue from "three-spritetext";
|
|
6
6
|
import { C as q, P as S, U as jt, H as Ht } from "./chunks/VisibilityLayerMask-CXgt1fJc.mjs";
|
|
7
7
|
import { A as Wt, a as Kt, b as Zt, c as Xt, d as qt, e as Jt } from "./chunks/findInterface-OrXgmwxj.mjs";
|
|
8
|
-
import { f as
|
|
8
|
+
import { f as zi, i as Ni } from "./chunks/findInterface-OrXgmwxj.mjs";
|
|
9
9
|
import { g as w } from "./chunks/ModuleRegistry-RSub8W0G.mjs";
|
|
10
10
|
import { D as $t, a as Qt } from "./chunks/PerspectiveCamera-sm4_81KJ.mjs";
|
|
11
|
-
import { F as
|
|
12
|
-
import { A as
|
|
13
|
-
import { F as
|
|
14
|
-
const
|
|
11
|
+
import { F as Yi, N as Ui, S as Gi, g as ji, i as Hi } from "./chunks/FileTypes-DuVGjbcR.mjs";
|
|
12
|
+
import { A as Ki, E as Zi, a as Xi } from "./chunks/index-C7Wx_9uY.mjs";
|
|
13
|
+
import { F as Ji, P as $i } from "./chunks/parse-error-BFRJyIxM.mjs";
|
|
14
|
+
const Ge = { type: "change" }, me = { type: "start" }, je = { type: "end" }, ie = new Tt(), He = new Lt(), ei = Math.cos(70 * I.DEG2RAD);
|
|
15
15
|
class ti extends Pt {
|
|
16
16
|
constructor(s, t) {
|
|
17
|
-
super(), this.object = s, this.domElement = t, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new m(), this.cursor = new m(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT:
|
|
18
|
-
return
|
|
17
|
+
super(), this.object = s, this.domElement = t, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new m(), this.cursor = new m(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: U.ROTATE, MIDDLE: U.DOLLY, RIGHT: U.PAN }, this.touches = { ONE: G.ROTATE, TWO: G.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
|
18
|
+
return c.phi;
|
|
19
19
|
}, this.getAzimuthalAngle = function() {
|
|
20
|
-
return
|
|
20
|
+
return c.theta;
|
|
21
21
|
}, this.getDistance = function() {
|
|
22
22
|
return this.object.position.distanceTo(this.target);
|
|
23
23
|
}, this.listenToKeyEvents = function(i) {
|
|
24
|
-
i.addEventListener("keydown",
|
|
24
|
+
i.addEventListener("keydown", le), this._domElementKeyEvents = i;
|
|
25
25
|
}, this.stopListenToKeyEvents = function() {
|
|
26
|
-
this._domElementKeyEvents.removeEventListener("keydown",
|
|
26
|
+
this._domElementKeyEvents.removeEventListener("keydown", le), this._domElementKeyEvents = null;
|
|
27
27
|
}, this.saveState = function() {
|
|
28
28
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
|
29
29
|
}, this.reset = function() {
|
|
30
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
|
30
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ge), e.update(), o = n.NONE;
|
|
31
31
|
}, this.update = function() {
|
|
32
|
-
const i = new m(), r = new Fe().setFromUnitVectors(s.up, new m(0, 1, 0)), d = r.clone().invert(), u = new m(), y = new Fe(),
|
|
32
|
+
const i = new m(), r = new Fe().setFromUnitVectors(s.up, new m(0, 1, 0)), d = r.clone().invert(), u = new m(), y = new Fe(), C = new m(), b = 2 * Math.PI;
|
|
33
33
|
return function(Et = null) {
|
|
34
34
|
const Be = e.object.position;
|
|
35
|
-
i.copy(Be).sub(e.target), i.applyQuaternion(r),
|
|
35
|
+
i.copy(Be).sub(e.target), i.applyQuaternion(r), c.setFromVector3(i), e.autoRotate && o === n.NONE && W(st(Et)), e.enableDamping ? (c.theta += p.theta * e.dampingFactor, c.phi += p.phi * e.dampingFactor) : (c.theta += p.theta, c.phi += p.phi);
|
|
36
36
|
let T = e.minAzimuthAngle, L = e.maxAzimuthAngle;
|
|
37
|
-
isFinite(T) && isFinite(L) && (T < -Math.PI ? T += b : T > Math.PI && (T -= b), L < -Math.PI ? L += b : L > Math.PI && (L -= b), T <= L ?
|
|
37
|
+
isFinite(T) && isFinite(L) && (T < -Math.PI ? T += b : T > Math.PI && (T -= b), L < -Math.PI ? L += b : L > Math.PI && (L -= b), T <= L ? c.theta = Math.max(T, Math.min(L, c.theta)) : c.theta = c.theta > (T + L) / 2 ? Math.max(T, c.theta) : Math.min(L, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(_, e.dampingFactor) : e.target.add(_), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
|
|
38
38
|
let Z = !1;
|
|
39
39
|
if (e.zoomToCursor && $ || e.object.isOrthographicCamera)
|
|
40
|
-
|
|
40
|
+
c.radius = he(c.radius);
|
|
41
41
|
else {
|
|
42
|
-
const P =
|
|
43
|
-
|
|
42
|
+
const P = c.radius;
|
|
43
|
+
c.radius = he(c.radius * f), Z = P != c.radius;
|
|
44
44
|
}
|
|
45
|
-
if (i.setFromSpherical(
|
|
45
|
+
if (i.setFromSpherical(c), i.applyQuaternion(d), Be.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (p.theta *= 1 - e.dampingFactor, p.phi *= 1 - e.dampingFactor, _.multiplyScalar(1 - e.dampingFactor)) : (p.set(0, 0, 0), _.set(0, 0, 0)), e.zoomToCursor && $) {
|
|
46
46
|
let P = null;
|
|
47
47
|
if (e.object.isPerspectiveCamera) {
|
|
48
48
|
const X = i.length();
|
|
@@ -50,11 +50,11 @@ class ti extends Pt {
|
|
|
50
50
|
const te = X - P;
|
|
51
51
|
e.object.position.addScaledVector(ye, te), e.object.updateMatrixWorld(), Z = !!te;
|
|
52
52
|
} else if (e.object.isOrthographicCamera) {
|
|
53
|
-
const X = new m(
|
|
53
|
+
const X = new m(M.x, M.y, 0);
|
|
54
54
|
X.unproject(e.object);
|
|
55
55
|
const te = e.object.zoom;
|
|
56
56
|
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Z = te !== e.object.zoom;
|
|
57
|
-
const ze = new m(
|
|
57
|
+
const ze = new m(M.x, M.y, 0);
|
|
58
58
|
ze.unproject(e.object), e.object.position.sub(ze).add(X), e.object.updateMatrixWorld(), P = i.length();
|
|
59
59
|
} else
|
|
60
60
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
|
@@ -63,10 +63,10 @@ class ti extends Pt {
|
|
|
63
63
|
const P = e.object.zoom;
|
|
64
64
|
e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), P !== e.object.zoom && (e.object.updateProjectionMatrix(), Z = !0);
|
|
65
65
|
}
|
|
66
|
-
return f = 1, $ = !1, Z || u.distanceToSquared(e.object.position) >
|
|
66
|
+
return f = 1, $ = !1, Z || u.distanceToSquared(e.object.position) > l || 8 * (1 - y.dot(e.object.quaternion)) > l || C.distanceToSquared(e.target) > l ? (e.dispatchEvent(Ge), u.copy(e.object.position), y.copy(e.object.quaternion), C.copy(e.target), !0) : !1;
|
|
67
67
|
};
|
|
68
68
|
}(), this.dispose = function() {
|
|
69
|
-
e.domElement.removeEventListener("contextmenu", Re), e.domElement.removeEventListener("pointerdown", Ce), e.domElement.removeEventListener("pointercancel", K), e.domElement.removeEventListener("wheel", Oe), e.domElement.removeEventListener("pointermove",
|
|
69
|
+
e.domElement.removeEventListener("contextmenu", Re), e.domElement.removeEventListener("pointerdown", Ce), e.domElement.removeEventListener("pointercancel", K), e.domElement.removeEventListener("wheel", Oe), e.domElement.removeEventListener("pointermove", ce), e.domElement.removeEventListener("pointerup", K), e.domElement.getRootNode().removeEventListener("keydown", ve, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", le), e._domElementKeyEvents = null);
|
|
70
70
|
};
|
|
71
71
|
const e = this, n = {
|
|
72
72
|
NONE: -1,
|
|
@@ -79,9 +79,9 @@ class ti extends Pt {
|
|
|
79
79
|
TOUCH_DOLLY_ROTATE: 6
|
|
80
80
|
};
|
|
81
81
|
let o = n.NONE;
|
|
82
|
-
const
|
|
82
|
+
const l = 1e-6, c = new Ne(), p = new Ne();
|
|
83
83
|
let f = 1;
|
|
84
|
-
const _ = new m(), O = new E(), v = new E(), V = new E(), A = new E(), k = new E(), B = new E(), z = new E(), N = new E(), R = new E(), ye = new m(),
|
|
84
|
+
const _ = new m(), O = new E(), v = new E(), V = new E(), A = new E(), k = new E(), B = new E(), z = new E(), N = new E(), R = new E(), ye = new m(), M = new E();
|
|
85
85
|
let $ = !1;
|
|
86
86
|
const g = [], H = {};
|
|
87
87
|
let oe = !1;
|
|
@@ -113,8 +113,8 @@ class ti extends Pt {
|
|
|
113
113
|
return function(d, u) {
|
|
114
114
|
const y = e.domElement;
|
|
115
115
|
if (e.object.isPerspectiveCamera) {
|
|
116
|
-
const
|
|
117
|
-
i.copy(
|
|
116
|
+
const C = e.object.position;
|
|
117
|
+
i.copy(C).sub(e.target);
|
|
118
118
|
let b = i.length();
|
|
119
119
|
b *= Math.tan(e.object.fov / 2 * Math.PI / 180), be(2 * d * b / y.clientHeight, e.object.matrix), we(2 * u * b / y.clientHeight, e.object.matrix);
|
|
120
120
|
} else e.object.isOrthographicCamera ? (be(d * (e.object.right - e.object.left) / e.object.zoom / y.clientWidth, e.object.matrix), we(u * (e.object.top - e.object.bottom) / e.object.zoom / y.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
|
@@ -130,8 +130,8 @@ class ti extends Pt {
|
|
|
130
130
|
if (!e.zoomToCursor)
|
|
131
131
|
return;
|
|
132
132
|
$ = !0;
|
|
133
|
-
const d = e.domElement.getBoundingClientRect(), u = i - d.left, y = r - d.top,
|
|
134
|
-
|
|
133
|
+
const d = e.domElement.getBoundingClientRect(), u = i - d.left, y = r - d.top, C = d.width, b = d.height;
|
|
134
|
+
M.x = u / C * 2 - 1, M.y = -(y / b) * 2 + 1, ye.set(M.x, M.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
|
135
135
|
}
|
|
136
136
|
function he(i) {
|
|
137
137
|
return Math.max(e.minDistance, Math.min(e.maxDistance, i));
|
|
@@ -159,7 +159,7 @@ class ti extends Pt {
|
|
|
159
159
|
function ht(i) {
|
|
160
160
|
ae(i.clientX, i.clientY), i.deltaY < 0 ? Ee(Q(i.deltaY)) : i.deltaY > 0 && re(Q(i.deltaY)), e.update();
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ct(i) {
|
|
163
163
|
let r = !1;
|
|
164
164
|
switch (i.code) {
|
|
165
165
|
case e.keys.UP:
|
|
@@ -197,13 +197,13 @@ class ti extends Pt {
|
|
|
197
197
|
const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
|
|
198
198
|
z.set(0, y);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function lt(i) {
|
|
201
201
|
e.enableZoom && Pe(i), e.enablePan && Le(i);
|
|
202
202
|
}
|
|
203
203
|
function dt(i) {
|
|
204
204
|
e.enableZoom && Pe(i), e.enableRotate && Te(i);
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function Ie(i) {
|
|
207
207
|
if (g.length == 1)
|
|
208
208
|
v.set(i.pageX, i.pageY);
|
|
209
209
|
else {
|
|
@@ -214,7 +214,7 @@ class ti extends Pt {
|
|
|
214
214
|
const r = e.domElement;
|
|
215
215
|
W(2 * Math.PI * V.x / r.clientHeight), ee(2 * Math.PI * V.y / r.clientHeight), O.copy(v);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Se(i) {
|
|
218
218
|
if (g.length === 1)
|
|
219
219
|
k.set(i.pageX, i.pageY);
|
|
220
220
|
else {
|
|
@@ -226,25 +226,25 @@ class ti extends Pt {
|
|
|
226
226
|
function Me(i) {
|
|
227
227
|
const r = Y(i), d = i.pageX - r.x, u = i.pageY - r.y, y = Math.sqrt(d * d + u * u);
|
|
228
228
|
N.set(0, y), R.set(0, Math.pow(N.y / z.y, e.zoomSpeed)), re(R.y), z.copy(N);
|
|
229
|
-
const
|
|
230
|
-
ae(
|
|
229
|
+
const C = (i.pageX + r.x) * 0.5, b = (i.pageY + r.y) * 0.5;
|
|
230
|
+
ae(C, b);
|
|
231
231
|
}
|
|
232
232
|
function ut(i) {
|
|
233
|
-
e.enableZoom && Me(i), e.enablePan &&
|
|
233
|
+
e.enableZoom && Me(i), e.enablePan && Se(i);
|
|
234
234
|
}
|
|
235
235
|
function mt(i) {
|
|
236
|
-
e.enableZoom && Me(i), e.enableRotate &&
|
|
236
|
+
e.enableZoom && Me(i), e.enableRotate && Ie(i);
|
|
237
237
|
}
|
|
238
238
|
function Ce(i) {
|
|
239
|
-
e.enabled !== !1 && (g.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove",
|
|
239
|
+
e.enabled !== !1 && (g.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", ce), e.domElement.addEventListener("pointerup", K)), !wt(i) && (yt(i), i.pointerType === "touch" ? ke(i) : pt(i)));
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function ce(i) {
|
|
242
242
|
e.enabled !== !1 && (i.pointerType === "touch" ? _t(i) : ft(i));
|
|
243
243
|
}
|
|
244
244
|
function K(i) {
|
|
245
245
|
switch (bt(i), g.length) {
|
|
246
246
|
case 0:
|
|
247
|
-
e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove",
|
|
247
|
+
e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", ce), e.domElement.removeEventListener("pointerup", K), e.dispatchEvent(je), o = n.NONE;
|
|
248
248
|
break;
|
|
249
249
|
case 1:
|
|
250
250
|
const r = g[0], d = H[r];
|
|
@@ -268,11 +268,11 @@ class ti extends Pt {
|
|
|
268
268
|
r = -1;
|
|
269
269
|
}
|
|
270
270
|
switch (r) {
|
|
271
|
-
case
|
|
271
|
+
case U.DOLLY:
|
|
272
272
|
if (e.enableZoom === !1) return;
|
|
273
273
|
nt(i), o = n.DOLLY;
|
|
274
274
|
break;
|
|
275
|
-
case
|
|
275
|
+
case U.ROTATE:
|
|
276
276
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
277
277
|
if (e.enablePan === !1) return;
|
|
278
278
|
xe(i), o = n.PAN;
|
|
@@ -281,7 +281,7 @@ class ti extends Pt {
|
|
|
281
281
|
De(i), o = n.ROTATE;
|
|
282
282
|
}
|
|
283
283
|
break;
|
|
284
|
-
case
|
|
284
|
+
case U.PAN:
|
|
285
285
|
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
|
286
286
|
if (e.enableRotate === !1) return;
|
|
287
287
|
De(i), o = n.ROTATE;
|
|
@@ -336,18 +336,18 @@ class ti extends Pt {
|
|
|
336
336
|
function Ae(i) {
|
|
337
337
|
i.key === "Control" && (oe = !1, e.domElement.getRootNode().removeEventListener("keyup", Ae, { passive: !0, capture: !0 }));
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
e.enabled === !1 || e.enablePan === !1 ||
|
|
339
|
+
function le(i) {
|
|
340
|
+
e.enabled === !1 || e.enablePan === !1 || ct(i);
|
|
341
341
|
}
|
|
342
342
|
function ke(i) {
|
|
343
343
|
switch (Ve(i), g.length) {
|
|
344
344
|
case 1:
|
|
345
345
|
switch (e.touches.ONE) {
|
|
346
|
-
case
|
|
346
|
+
case G.ROTATE:
|
|
347
347
|
if (e.enableRotate === !1) return;
|
|
348
348
|
Te(i), o = n.TOUCH_ROTATE;
|
|
349
349
|
break;
|
|
350
|
-
case
|
|
350
|
+
case G.PAN:
|
|
351
351
|
if (e.enablePan === !1) return;
|
|
352
352
|
Le(i), o = n.TOUCH_PAN;
|
|
353
353
|
break;
|
|
@@ -357,11 +357,11 @@ class ti extends Pt {
|
|
|
357
357
|
break;
|
|
358
358
|
case 2:
|
|
359
359
|
switch (e.touches.TWO) {
|
|
360
|
-
case
|
|
360
|
+
case G.DOLLY_PAN:
|
|
361
361
|
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
362
|
-
|
|
362
|
+
lt(i), o = n.TOUCH_DOLLY_PAN;
|
|
363
363
|
break;
|
|
364
|
-
case
|
|
364
|
+
case G.DOLLY_ROTATE:
|
|
365
365
|
if (e.enableZoom === !1 && e.enableRotate === !1) return;
|
|
366
366
|
dt(i), o = n.TOUCH_DOLLY_ROTATE;
|
|
367
367
|
break;
|
|
@@ -378,11 +378,11 @@ class ti extends Pt {
|
|
|
378
378
|
switch (Ve(i), o) {
|
|
379
379
|
case n.TOUCH_ROTATE:
|
|
380
380
|
if (e.enableRotate === !1) return;
|
|
381
|
-
|
|
381
|
+
Ie(i), e.update();
|
|
382
382
|
break;
|
|
383
383
|
case n.TOUCH_PAN:
|
|
384
384
|
if (e.enablePan === !1) return;
|
|
385
|
-
|
|
385
|
+
Se(i), e.update();
|
|
386
386
|
break;
|
|
387
387
|
case n.TOUCH_DOLLY_PAN:
|
|
388
388
|
if (e.enableZoom === !1 && e.enablePan === !1) return;
|
|
@@ -432,7 +432,7 @@ const se = {
|
|
|
432
432
|
}, J = class J extends ti {
|
|
433
433
|
constructor(t, e, n = se) {
|
|
434
434
|
super(t, e);
|
|
435
|
-
a(this, "uuid",
|
|
435
|
+
a(this, "uuid", I.generateUUID());
|
|
436
436
|
a(this, "object");
|
|
437
437
|
this.domElement = e, this.domElement = e, this.object = t, this.enableDamping = n.enableDamping ?? se.enableDamping, this.dampingFactor = n.dampingFactor ?? se.dampingFactor, this.object.position.set(0, 2, 2), this.target.copy({ x: 0, y: 0.5, z: 0 }), this.update();
|
|
438
438
|
}
|
|
@@ -448,7 +448,7 @@ const se = {
|
|
|
448
448
|
}
|
|
449
449
|
zoomIn(t) {
|
|
450
450
|
const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
|
|
451
|
-
this.minDistance = this.maxDistance =
|
|
451
|
+
this.minDistance = this.maxDistance = I.clamp(
|
|
452
452
|
this.getDistance() - e,
|
|
453
453
|
n + e,
|
|
454
454
|
o - e
|
|
@@ -456,7 +456,7 @@ const se = {
|
|
|
456
456
|
}
|
|
457
457
|
zoomOut(t) {
|
|
458
458
|
const e = t || J.DEFAULT_ZOOM_FACTOR, { minDistance: n, maxDistance: o } = this;
|
|
459
|
-
this.minDistance = this.maxDistance =
|
|
459
|
+
this.minDistance = this.maxDistance = I.clamp(
|
|
460
460
|
this.getDistance() + e,
|
|
461
461
|
n + e,
|
|
462
462
|
o - e
|
|
@@ -465,21 +465,21 @@ const se = {
|
|
|
465
465
|
};
|
|
466
466
|
a(J, "DEFAULT_ZOOM_FACTOR", 1);
|
|
467
467
|
let ne = J;
|
|
468
|
-
class ii extends
|
|
468
|
+
class ii extends It {
|
|
469
469
|
constructor(t, e, n) {
|
|
470
470
|
super(-1, 1, 1, -1, 0.1, 100);
|
|
471
471
|
a(this, "axesHelper");
|
|
472
472
|
a(this, "_renderer");
|
|
473
473
|
a(this, "_scene");
|
|
474
474
|
a(this, "_camera");
|
|
475
|
-
a(this, "_restoreViewport", new
|
|
475
|
+
a(this, "_restoreViewport", new St());
|
|
476
476
|
this.layers.mask = q, this.axesHelper = new Mt(0.5), this.axesHelper.layers.mask = q, this.axesHelper.material.depthTest = !1, this.axesHelper.position.set(0, 0, -1), this.axesHelper.setColors(
|
|
477
477
|
new D(Wt),
|
|
478
478
|
new D(Kt),
|
|
479
479
|
new D(Zt)
|
|
480
480
|
);
|
|
481
|
-
const o = new ue("X", 0.2, Xt),
|
|
482
|
-
o.layers.mask = q,
|
|
481
|
+
const o = new ue("X", 0.2, Xt), l = new ue("Y", 0.2, qt), c = new ue("Z", 0.2, Jt);
|
|
482
|
+
o.layers.mask = q, l.layers.mask = q, c.layers.mask = q, o.position.set(0.7, 0, 0), l.position.set(0, 0.7, 0), c.position.set(0, 0, 0.7), this.axesHelper.add(o), this.axesHelper.add(l), this.axesHelper.add(c), this.add(this.axesHelper), this._renderer = t, this._scene = e, this._camera = n, this._scene.add(this);
|
|
483
483
|
}
|
|
484
484
|
tick() {
|
|
485
485
|
const t = this._scene.background;
|
|
@@ -592,43 +592,11 @@ class Je extends j {
|
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
const ge = (h) => h.parent ? ge(h.parent) : h;
|
|
595
|
-
class
|
|
596
|
-
constructor() {
|
|
597
|
-
a(this, "isMovable", !0);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
class ri {
|
|
601
|
-
constructor() {
|
|
602
|
-
a(this, "isSelectable", !0);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
function ai(h, s) {
|
|
606
|
-
return s.forEach((t) => {
|
|
607
|
-
Object.getOwnPropertyNames(t.prototype).forEach((n) => {
|
|
608
|
-
if (n === "constructor")
|
|
609
|
-
return;
|
|
610
|
-
const o = Object.getOwnPropertyDescriptor(
|
|
611
|
-
t.prototype,
|
|
612
|
-
n
|
|
613
|
-
);
|
|
614
|
-
Object.defineProperty(h.prototype, n, o);
|
|
615
|
-
});
|
|
616
|
-
const e = new t();
|
|
617
|
-
Object.getOwnPropertyNames(e).forEach((n) => {
|
|
618
|
-
const o = Object.getOwnPropertyDescriptor(
|
|
619
|
-
e,
|
|
620
|
-
n
|
|
621
|
-
);
|
|
622
|
-
Object.defineProperty(h.prototype, n, o);
|
|
623
|
-
});
|
|
624
|
-
}), h;
|
|
625
|
-
}
|
|
626
|
-
class _e extends ai(j, [
|
|
627
|
-
ri,
|
|
628
|
-
oi
|
|
629
|
-
]) {
|
|
595
|
+
class _e extends j {
|
|
630
596
|
constructor() {
|
|
631
597
|
super();
|
|
598
|
+
a(this, "isSelectable", !0);
|
|
599
|
+
a(this, "isMovable", !0);
|
|
632
600
|
a(this, "isDIVENode", !0);
|
|
633
601
|
a(this, "gizmo", null);
|
|
634
602
|
a(this, "_positionWorldBuffer");
|
|
@@ -708,8 +676,8 @@ class $e extends _e {
|
|
|
708
676
|
async setFromURL(t) {
|
|
709
677
|
const n = await (await this._getAssetLoader()).load(t);
|
|
710
678
|
this.setFromGLTF(n), w("State").then((o) => {
|
|
711
|
-
var
|
|
712
|
-
(
|
|
679
|
+
var l;
|
|
680
|
+
(l = o.get(this.userData.id)) == null || l.performAction("MODEL_LOADED", {
|
|
713
681
|
id: this.userData.id
|
|
714
682
|
});
|
|
715
683
|
});
|
|
@@ -723,10 +691,10 @@ class $e extends _e {
|
|
|
723
691
|
this._material || (this._material = new fe()), t.vertexColors !== void 0 && (this._material.vertexColors = t.vertexColors), t.color !== void 0 && this._material.color.set(t.color), t.map !== void 0 && (this._material.map = t.map), t.normalMap !== void 0 && (this._material.normalMap = t.normalMap), t.roughness !== void 0 && (this._material.roughness = t.roughness), t.roughnessMap !== void 0 && (this._material.roughnessMap = t.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), t.metalness !== void 0 && (this._material.metalness = t.metalness), t.metalnessMap !== void 0 && (this._material.metalnessMap = t.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
|
|
724
692
|
}
|
|
725
693
|
placeOnFloor() {
|
|
726
|
-
var o,
|
|
694
|
+
var o, l, c, p;
|
|
727
695
|
const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
|
|
728
|
-
(
|
|
729
|
-
const n = (p = (
|
|
696
|
+
(l = (o = this._mesh) == null ? void 0 : o.geometry) == null || l.computeBoundingBox();
|
|
697
|
+
const n = (p = (c = this._mesh) == null ? void 0 : c.geometry) == null ? void 0 : p.boundingBox;
|
|
730
698
|
!n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
|
|
731
699
|
var _;
|
|
732
700
|
(_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
|
|
@@ -756,15 +724,15 @@ class $e extends _e {
|
|
|
756
724
|
!0
|
|
757
725
|
);
|
|
758
726
|
if (o.length > 0) {
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
727
|
+
const l = o[0].object;
|
|
728
|
+
l.geometry.computeBoundingBox();
|
|
729
|
+
const c = l.geometry.boundingBox, p = l.localToWorld(c.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
|
|
762
730
|
if (this.position.copy(_), this.position.y === f.y) return;
|
|
763
731
|
this.onMove();
|
|
764
732
|
}
|
|
765
733
|
}
|
|
766
734
|
}
|
|
767
|
-
class
|
|
735
|
+
class oi extends _e {
|
|
768
736
|
constructor() {
|
|
769
737
|
super();
|
|
770
738
|
a(this, "isDIVEPrimitive", !0);
|
|
@@ -780,10 +748,10 @@ class hi extends _e {
|
|
|
780
748
|
t.vertexColors !== void 0 && (e.vertexColors = t.vertexColors), t.color !== void 0 && (e.color = new D(t.color)), t.map !== void 0 && (e.map = t.map), t.normalMap !== void 0 && (e.normalMap = t.normalMap), t.roughness !== void 0 && (e.roughness = t.roughness), t.roughnessMap !== void 0 && (e.roughnessMap = t.roughnessMap, e.roughnessMap && (e.roughness = 1)), t.metalness !== void 0 && (e.metalness = t.metalness), t.metalnessMap !== void 0 && (e.metalnessMap = t.metalnessMap, e.metalnessMap && (e.metalness = 0)), this._mesh && (this._mesh.material = e);
|
|
781
749
|
}
|
|
782
750
|
placeOnFloor() {
|
|
783
|
-
var o,
|
|
751
|
+
var o, l, c, p;
|
|
784
752
|
const t = this.getWorldPosition(this._positionWorldBuffer), e = t.clone();
|
|
785
|
-
(
|
|
786
|
-
const n = (p = (
|
|
753
|
+
(l = (o = this._mesh) == null ? void 0 : o.geometry) == null || l.computeBoundingBox();
|
|
754
|
+
const n = (p = (c = this._mesh) == null ? void 0 : c.geometry) == null ? void 0 : p.boundingBox;
|
|
787
755
|
!n || !this._mesh || (t.y = t.y - this._mesh.localToWorld(n.min.clone()).y, t.y !== e.y && w("State").then((f) => {
|
|
788
756
|
var _;
|
|
789
757
|
(_ = f.get(this.userData.id)) == null || _.performAction("UPDATE_OBJECT", {
|
|
@@ -813,9 +781,9 @@ class hi extends _e {
|
|
|
813
781
|
!0
|
|
814
782
|
);
|
|
815
783
|
if (o.length > 0) {
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
const
|
|
784
|
+
const l = o[0].object;
|
|
785
|
+
l.geometry.computeBoundingBox();
|
|
786
|
+
const c = l.geometry.boundingBox, p = l.localToWorld(c.max.clone()), f = this.position.clone(), _ = this.position.clone().setY(p.y).sub(new m(0, t, 0));
|
|
819
787
|
if (this.position.copy(_), this.position.y === f.y) return;
|
|
820
788
|
this.onMove();
|
|
821
789
|
}
|
|
@@ -932,7 +900,7 @@ class hi extends _e {
|
|
|
932
900
|
return e.translate(0, t.height / 2, 0), e;
|
|
933
901
|
}
|
|
934
902
|
}
|
|
935
|
-
class
|
|
903
|
+
class ri extends _e {
|
|
936
904
|
// lines to children
|
|
937
905
|
constructor() {
|
|
938
906
|
super();
|
|
@@ -1051,7 +1019,7 @@ class li extends _e {
|
|
|
1051
1019
|
// this._boxMesh.visible = true;
|
|
1052
1020
|
// }
|
|
1053
1021
|
}
|
|
1054
|
-
class
|
|
1022
|
+
class ai extends pe {
|
|
1055
1023
|
constructor() {
|
|
1056
1024
|
super(
|
|
1057
1025
|
new Yt(1e4, 1e4),
|
|
@@ -1069,13 +1037,13 @@ class ci extends pe {
|
|
|
1069
1037
|
this.material.color = new D(t);
|
|
1070
1038
|
}
|
|
1071
1039
|
}
|
|
1072
|
-
class
|
|
1040
|
+
class hi extends j {
|
|
1073
1041
|
constructor() {
|
|
1074
1042
|
super();
|
|
1075
1043
|
a(this, "isDIVERoot", !0);
|
|
1076
1044
|
a(this, "_floor");
|
|
1077
1045
|
a(this, "_assetLoader", null);
|
|
1078
|
-
this.name = "Root", this._floor = new
|
|
1046
|
+
this.name = "Root", this._floor = new ai(), this.add(this._floor);
|
|
1079
1047
|
}
|
|
1080
1048
|
get floor() {
|
|
1081
1049
|
return this._floor;
|
|
@@ -1133,11 +1101,11 @@ class di extends j {
|
|
|
1133
1101
|
break;
|
|
1134
1102
|
}
|
|
1135
1103
|
case "primitive": {
|
|
1136
|
-
e = new
|
|
1104
|
+
e = new oi(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updatePrimitive(e, t);
|
|
1137
1105
|
break;
|
|
1138
1106
|
}
|
|
1139
1107
|
case "group": {
|
|
1140
|
-
e = new
|
|
1108
|
+
e = new ri(), e.name = t.name, e.userData.id = t.id, this.add(e), this._updateGroup(e, t);
|
|
1141
1109
|
break;
|
|
1142
1110
|
}
|
|
1143
1111
|
default:
|
|
@@ -1265,15 +1233,15 @@ class di extends j {
|
|
|
1265
1233
|
return t.parent !== null ? this._findScene(t.parent) : t;
|
|
1266
1234
|
}
|
|
1267
1235
|
}
|
|
1268
|
-
const
|
|
1269
|
-
class
|
|
1236
|
+
const ci = "#888888", li = "#dddddd";
|
|
1237
|
+
class di extends j {
|
|
1270
1238
|
constructor() {
|
|
1271
1239
|
super(), this.name = "Grid";
|
|
1272
|
-
const s = new
|
|
1240
|
+
const s = new Ut(
|
|
1273
1241
|
100,
|
|
1274
1242
|
100,
|
|
1275
|
-
|
|
1276
|
-
|
|
1243
|
+
ci,
|
|
1244
|
+
li
|
|
1277
1245
|
);
|
|
1278
1246
|
s.material.depthTest = !1, s.layers.mask = Ht, this.add(s);
|
|
1279
1247
|
}
|
|
@@ -1281,12 +1249,12 @@ class pi extends j {
|
|
|
1281
1249
|
this.visible = s;
|
|
1282
1250
|
}
|
|
1283
1251
|
}
|
|
1284
|
-
class
|
|
1252
|
+
class ui extends Gt {
|
|
1285
1253
|
constructor() {
|
|
1286
1254
|
super();
|
|
1287
1255
|
a(this, "_root");
|
|
1288
1256
|
a(this, "_grid");
|
|
1289
|
-
this.background = new D(16777215), this._root = new
|
|
1257
|
+
this.background = new D(16777215), this._root = new hi(), this.add(this._root), this._grid = new di(), this.add(this._grid);
|
|
1290
1258
|
}
|
|
1291
1259
|
get root() {
|
|
1292
1260
|
return this._root;
|
|
@@ -1311,14 +1279,14 @@ const Qe = {
|
|
|
1311
1279
|
depth: !0,
|
|
1312
1280
|
logarithmicDepthBuffer: !1
|
|
1313
1281
|
};
|
|
1314
|
-
class
|
|
1282
|
+
class mi {
|
|
1315
1283
|
constructor(s, t, e) {
|
|
1316
1284
|
a(this, "_webglrenderer");
|
|
1317
1285
|
a(this, "_settings");
|
|
1318
1286
|
this._scene = s, this._camera = t, this._settings = {
|
|
1319
1287
|
...Qe,
|
|
1320
1288
|
...e ?? {}
|
|
1321
|
-
}, this._webglrenderer = new
|
|
1289
|
+
}, this._webglrenderer = new Ue({
|
|
1322
1290
|
canvas: this._settings.canvas,
|
|
1323
1291
|
antialias: this._settings.antialias,
|
|
1324
1292
|
alpha: this._settings.alpha,
|
|
@@ -1333,7 +1301,7 @@ class gi {
|
|
|
1333
1301
|
return this._webglrenderer;
|
|
1334
1302
|
}
|
|
1335
1303
|
setCanvas(s) {
|
|
1336
|
-
this._webglrenderer.dispose(), this._settings.canvas = s, this._webglrenderer = new
|
|
1304
|
+
this._webglrenderer.dispose(), this._settings.canvas = s, this._webglrenderer = new Ue(this._settings);
|
|
1337
1305
|
}
|
|
1338
1306
|
render() {
|
|
1339
1307
|
this._webglrenderer.render(this._scene, this._camera);
|
|
@@ -1345,7 +1313,7 @@ class gi {
|
|
|
1345
1313
|
this._webglrenderer.dispose();
|
|
1346
1314
|
}
|
|
1347
1315
|
}
|
|
1348
|
-
class
|
|
1316
|
+
class pi {
|
|
1349
1317
|
constructor() {
|
|
1350
1318
|
a(this, "_renderer", null);
|
|
1351
1319
|
a(this, "_lastTime", 0);
|
|
@@ -1381,15 +1349,15 @@ class _i {
|
|
|
1381
1349
|
this._lastTime = s, this._tickers.forEach((n) => n.tick(t)), (e = this._renderer) == null || e.render(), requestAnimationFrame(this._tick.bind(this));
|
|
1382
1350
|
}
|
|
1383
1351
|
}
|
|
1384
|
-
class
|
|
1352
|
+
class fi {
|
|
1385
1353
|
constructor(s, t) {
|
|
1386
1354
|
a(this, "_resizeObserver");
|
|
1387
1355
|
a(this, "_width", 0);
|
|
1388
1356
|
a(this, "_height", 0);
|
|
1389
1357
|
this._resizeObserver = new ResizeObserver((e) => {
|
|
1390
1358
|
for (const n of e) {
|
|
1391
|
-
const { width: o, height:
|
|
1392
|
-
o === this._width &&
|
|
1359
|
+
const { width: o, height: l } = n.contentRect;
|
|
1360
|
+
o === this._width && l === this._height || (s.onResize(o, l), t.onResize(o, l), this._width = o, this._height = l);
|
|
1393
1361
|
}
|
|
1394
1362
|
}), this._observeCanvas(s.webglrenderer.domElement);
|
|
1395
1363
|
}
|
|
@@ -1415,7 +1383,7 @@ const et = {
|
|
|
1415
1383
|
...$t,
|
|
1416
1384
|
...Qe
|
|
1417
1385
|
};
|
|
1418
|
-
class
|
|
1386
|
+
class gi {
|
|
1419
1387
|
constructor(s) {
|
|
1420
1388
|
a(this, "_renderer");
|
|
1421
1389
|
a(this, "_scene");
|
|
@@ -1426,14 +1394,14 @@ class bi {
|
|
|
1426
1394
|
this._settings = {
|
|
1427
1395
|
...et,
|
|
1428
1396
|
...s ?? {}
|
|
1429
|
-
}, this._scene = new
|
|
1397
|
+
}, this._scene = new ui(), this._camera = new Qt(this._settings), this._renderer = new mi(
|
|
1430
1398
|
this._scene,
|
|
1431
1399
|
this._camera,
|
|
1432
1400
|
this._settings
|
|
1433
|
-
), this._resizeManager = new
|
|
1401
|
+
), this._resizeManager = new fi(
|
|
1434
1402
|
this._renderer,
|
|
1435
1403
|
this._camera
|
|
1436
|
-
), this._clock = new
|
|
1404
|
+
), this._clock = new pi(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
|
|
1437
1405
|
}
|
|
1438
1406
|
get scene() {
|
|
1439
1407
|
return this._scene;
|
|
@@ -1464,11 +1432,11 @@ function x(h, s) {
|
|
|
1464
1432
|
const t = (h + "e").split("e");
|
|
1465
1433
|
return +(t[0] + "e" + (+t[1] + (s || 0)));
|
|
1466
1434
|
}
|
|
1467
|
-
function
|
|
1435
|
+
function _i(h, s = 0) {
|
|
1468
1436
|
const t = x(h, +s);
|
|
1469
1437
|
return x(Math.ceil(t), -s);
|
|
1470
1438
|
}
|
|
1471
|
-
function
|
|
1439
|
+
function yi(h, s = 0) {
|
|
1472
1440
|
const t = x(h, +s);
|
|
1473
1441
|
return x(Math.floor(t), -s);
|
|
1474
1442
|
}
|
|
@@ -1477,35 +1445,35 @@ function tt(h, s = 0) {
|
|
|
1477
1445
|
const t = x(h, +s);
|
|
1478
1446
|
return x(Math.round(t), -s);
|
|
1479
1447
|
}
|
|
1480
|
-
function
|
|
1448
|
+
function bi(h, s, t) {
|
|
1481
1449
|
return Math.atan2(
|
|
1482
1450
|
h.clone().cross(s).dot(t),
|
|
1483
1451
|
s.clone().dot(h)
|
|
1484
1452
|
);
|
|
1485
1453
|
}
|
|
1486
|
-
function
|
|
1454
|
+
function wi(h, s = 0) {
|
|
1487
1455
|
const t = x(h, +s);
|
|
1488
1456
|
return x(Math.round(t), -s).toFixed(s);
|
|
1489
1457
|
}
|
|
1490
|
-
function
|
|
1458
|
+
function Ei(h, s = 0) {
|
|
1491
1459
|
const t = x(h, +s);
|
|
1492
1460
|
return x(Math.trunc(t), -s);
|
|
1493
1461
|
}
|
|
1494
|
-
function
|
|
1495
|
-
return (
|
|
1462
|
+
function Di(h) {
|
|
1463
|
+
return (I.radToDeg(h) + 360) % 360;
|
|
1496
1464
|
}
|
|
1497
|
-
function
|
|
1498
|
-
return
|
|
1465
|
+
function xi(h) {
|
|
1466
|
+
return I.degToRad(h);
|
|
1499
1467
|
}
|
|
1500
|
-
const
|
|
1501
|
-
ceilExp:
|
|
1502
|
-
floorExp:
|
|
1468
|
+
const ki = {
|
|
1469
|
+
ceilExp: _i,
|
|
1470
|
+
floorExp: yi,
|
|
1503
1471
|
roundExp: tt,
|
|
1504
|
-
toFixedExp:
|
|
1505
|
-
truncateExp:
|
|
1506
|
-
signedAngleTo:
|
|
1507
|
-
radToDeg:
|
|
1508
|
-
degToRad:
|
|
1472
|
+
toFixedExp: wi,
|
|
1473
|
+
truncateExp: Ei,
|
|
1474
|
+
signedAngleTo: bi,
|
|
1475
|
+
radToDeg: Di,
|
|
1476
|
+
degToRad: xi
|
|
1509
1477
|
};
|
|
1510
1478
|
window.DIVE = {
|
|
1511
1479
|
instances: [],
|
|
@@ -1513,21 +1481,22 @@ window.DIVE = {
|
|
|
1513
1481
|
return window.DIVE.instances[0];
|
|
1514
1482
|
}
|
|
1515
1483
|
};
|
|
1516
|
-
const
|
|
1484
|
+
const Ti = {
|
|
1517
1485
|
...et,
|
|
1518
1486
|
...se
|
|
1519
1487
|
};
|
|
1520
1488
|
class it {
|
|
1521
1489
|
constructor(s) {
|
|
1522
1490
|
// descriptive members
|
|
1491
|
+
a(this, "_instanceId", I.generateUUID());
|
|
1523
1492
|
a(this, "_settings");
|
|
1524
1493
|
a(this, "_engine");
|
|
1525
1494
|
a(this, "orbitController");
|
|
1526
1495
|
a(this, "axisCamera");
|
|
1527
1496
|
this._settings = {
|
|
1528
|
-
...
|
|
1497
|
+
...Ti,
|
|
1529
1498
|
...s ?? {}
|
|
1530
|
-
}, this._engine = new
|
|
1499
|
+
}, this._engine = new gi(s), this.orbitController = new ne(
|
|
1531
1500
|
this._engine.camera,
|
|
1532
1501
|
this._engine.renderer.webglrenderer.domElement,
|
|
1533
1502
|
this._settings
|
|
@@ -1535,7 +1504,7 @@ class it {
|
|
|
1535
1504
|
this._engine.renderer,
|
|
1536
1505
|
this._engine.scene,
|
|
1537
1506
|
this._engine.camera
|
|
1538
|
-
), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-
|
|
1507
|
+
), this._engine.clock.addTicker(this.axisCamera)) : this.axisCamera = null, import("./chunks/package-DeBkqggW.mjs").then((t) => {
|
|
1539
1508
|
console.log(
|
|
1540
1509
|
`DIVE ${t.default.version} initialized successfully!`
|
|
1541
1510
|
), console.log(`
|
|
@@ -1568,18 +1537,18 @@ class it {
|
|
|
1568
1537
|
@@@@@@@ @@@@@@
|
|
1569
1538
|
|
|
1570
1539
|
`);
|
|
1571
|
-
});
|
|
1540
|
+
}), window.DIVE.instances.push(this);
|
|
1572
1541
|
}
|
|
1573
1542
|
// static members
|
|
1574
1543
|
static async QuickView(s, t) {
|
|
1575
1544
|
const e = new it(t);
|
|
1576
|
-
|
|
1545
|
+
e.engine.scene.background = new D(16777215), e.engine.scene.grid.setVisibility(!1), e.engine.scene.root.floor.setVisibility(!0), e.engine.scene.root.floor.setColor(16777215), e.engine.camera.position.set(0, 2, 2), e.orbitController.target.set(0, 0.5, 0);
|
|
1577
1546
|
const n = new Je();
|
|
1578
|
-
n.name = "SceneLight", n.userData.id =
|
|
1547
|
+
n.name = "SceneLight", n.userData.id = I.generateUUID(), n.setEnabled(!0), n.visible = !0, n.setIntensity((t == null ? void 0 : t.lightIntensity) ?? 1), n.setColor(new D(16777215)), e.engine.scene.root.add(n);
|
|
1579
1548
|
const o = new $e();
|
|
1580
|
-
o.name = "object", o.userData.id =
|
|
1581
|
-
const
|
|
1582
|
-
return e.engine.camera.position.copy(
|
|
1549
|
+
o.name = "object", o.userData.id = I.generateUUID(), o.userData.uri = s, o.visible = !0, e.engine.scene.root.add(o), await o.setFromURL(s);
|
|
1550
|
+
const l = e.engine.scene.computeSceneBB(), c = e.orbitController.computeEncompassingView(l);
|
|
1551
|
+
return e.engine.camera.position.copy(c.position), e.orbitController.target.copy(c.target), e;
|
|
1583
1552
|
}
|
|
1584
1553
|
get engine() {
|
|
1585
1554
|
return this._engine;
|
|
@@ -1596,7 +1565,9 @@ class it {
|
|
|
1596
1565
|
}
|
|
1597
1566
|
async dispose() {
|
|
1598
1567
|
return new Promise((s) => {
|
|
1599
|
-
this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.dispose()),
|
|
1568
|
+
this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.axisCamera && (this._engine.clock.removeTicker(this.axisCamera), this.axisCamera.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
|
|
1569
|
+
(t) => t._instanceId !== this._instanceId
|
|
1570
|
+
), s();
|
|
1600
1571
|
});
|
|
1601
1572
|
}
|
|
1602
1573
|
}
|
|
@@ -1625,15 +1596,15 @@ const We = (h, s) => {
|
|
|
1625
1596
|
t = { ...t, [e]: s[e] };
|
|
1626
1597
|
return;
|
|
1627
1598
|
}
|
|
1628
|
-
const
|
|
1629
|
-
if (o.forEach((
|
|
1599
|
+
const l = [];
|
|
1600
|
+
if (o.forEach((c, p) => {
|
|
1630
1601
|
const f = We(
|
|
1631
1602
|
n[p],
|
|
1632
1603
|
o[p]
|
|
1633
1604
|
);
|
|
1634
|
-
Object.keys(f).length &&
|
|
1635
|
-
}), Object.keys(
|
|
1636
|
-
t = { ...t, [e]:
|
|
1605
|
+
Object.keys(f).length && l.push(o[p]);
|
|
1606
|
+
}), Object.keys(l).length) {
|
|
1607
|
+
t = { ...t, [e]: l };
|
|
1637
1608
|
return;
|
|
1638
1609
|
}
|
|
1639
1610
|
return;
|
|
@@ -1655,24 +1626,45 @@ const We = (h, s) => {
|
|
|
1655
1626
|
h[e] !== s[e] && (t = { ...t, [e]: s[e] });
|
|
1656
1627
|
}), t;
|
|
1657
1628
|
};
|
|
1629
|
+
function Ri(h, s) {
|
|
1630
|
+
return s.forEach((t) => {
|
|
1631
|
+
Object.getOwnPropertyNames(t.prototype).forEach((n) => {
|
|
1632
|
+
if (n === "constructor")
|
|
1633
|
+
return;
|
|
1634
|
+
const o = Object.getOwnPropertyDescriptor(
|
|
1635
|
+
t.prototype,
|
|
1636
|
+
n
|
|
1637
|
+
);
|
|
1638
|
+
Object.defineProperty(h.prototype, n, o);
|
|
1639
|
+
});
|
|
1640
|
+
const e = new t();
|
|
1641
|
+
Object.getOwnPropertyNames(e).forEach((n) => {
|
|
1642
|
+
const o = Object.getOwnPropertyDescriptor(
|
|
1643
|
+
e,
|
|
1644
|
+
n
|
|
1645
|
+
);
|
|
1646
|
+
Object.defineProperty(h.prototype, n, o);
|
|
1647
|
+
});
|
|
1648
|
+
}), h;
|
|
1649
|
+
}
|
|
1658
1650
|
export {
|
|
1659
|
-
|
|
1651
|
+
Ki as ARCompatibilityError,
|
|
1660
1652
|
it as DIVE,
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1653
|
+
Ti as DIVEDefaultSettings,
|
|
1654
|
+
ki as DIVEMath,
|
|
1655
|
+
Zi as ESystem,
|
|
1656
|
+
Xi as EWebXRUnsupportedReason,
|
|
1657
|
+
Yi as FILE_TYPES,
|
|
1658
|
+
Ji as FileTypeError,
|
|
1659
|
+
Ui as NetworkError,
|
|
1660
|
+
$i as ParseError,
|
|
1661
|
+
Gi as SUPPORTED_FILE_TYPES,
|
|
1662
|
+
Ri as applyMixins,
|
|
1663
|
+
zi as findInterface,
|
|
1672
1664
|
ge as findSceneRecursive,
|
|
1673
|
-
|
|
1665
|
+
ji as getFileTypeFromUri,
|
|
1674
1666
|
w as getModule,
|
|
1675
1667
|
We as getObjectDelta,
|
|
1676
|
-
|
|
1677
|
-
|
|
1668
|
+
Ni as implementsInterface,
|
|
1669
|
+
Hi as isFileTypeSupported
|
|
1678
1670
|
};
|
|
@@ -2,8 +2,9 @@ import { Box3, Object3D, Vector3, Vector3Like } from 'three';
|
|
|
2
2
|
import { DIVEMovable } from '../../interfaces/Movable.ts';
|
|
3
3
|
import { DIVESelectable } from '../../interfaces/Selectable.ts';
|
|
4
4
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
|
|
5
|
-
declare
|
|
6
|
-
|
|
5
|
+
export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
|
|
6
|
+
readonly isSelectable: true;
|
|
7
|
+
readonly isMovable: true;
|
|
7
8
|
readonly isDIVENode: true;
|
|
8
9
|
gizmo: TransformControls | null;
|
|
9
10
|
protected _positionWorldBuffer: Vector3;
|
|
@@ -21,4 +22,3 @@ export declare class DIVENode extends DIVENode_base {
|
|
|
21
22
|
onSelect(): void;
|
|
22
23
|
onDeselect(): void;
|
|
23
24
|
}
|
|
24
|
-
export {};
|
package/build/src/core/Dive.d.ts
CHANGED