@shopware-ag/dive 4.0.0 → 4.0.2
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/{AssetCache-MXFCGzZU.mjs → AssetCache-DadU3pjv.mjs} +8 -9
- package/build/chunks/AssetCache-GSqD2GKD.cjs +1 -0
- package/build/chunks/{AssetLoader-BDDJG9JL.cjs → AssetLoader-BOBXNUHe.cjs} +1 -1
- package/build/chunks/{AssetLoader-kRhuVN4p.mjs → AssetLoader-Dwnjh3GI.mjs} +16 -17
- package/build/chunks/{FileTypes-DGSsi-AX.mjs → FileTypes-CUga4xrG.mjs} +386 -294
- package/build/chunks/{FileTypes-gD_1MonW.cjs → FileTypes-Cm1k0dUE.cjs} +2 -2
- package/build/chunks/GridNode-CK4PiwHT.cjs +1 -0
- package/build/chunks/GridNode-KgFpPNWa.mjs +30 -0
- package/build/chunks/{ModelComponent-DkfAgTL0.mjs → ModelComponent-Cpy9q21L.mjs} +1 -1
- package/build/chunks/{ModelComponent-Cj3ff6nL.cjs → ModelComponent-DuBAn1uS.cjs} +1 -1
- package/build/chunks/OrbitController-CK4OclLu.cjs +1 -0
- package/build/chunks/{OrbitController-DLEyTvUt.mjs → OrbitController-DFf6ANcN.mjs} +3 -4
- package/build/chunks/{SpriteTextComponent-ByefJLeU.cjs → SpriteTextComponent-Bho3ynCj.cjs} +1 -1
- package/build/chunks/{SpriteTextComponent-CG5vfiFy.mjs → SpriteTextComponent-DrBnD0_-.mjs} +1 -1
- package/build/chunks/{detachTransformControls-Dr3TIdVy.mjs → detachTransformControls-D6VK3L3-.mjs} +1 -1
- package/build/chunks/{detachTransformControls-2XQrpLN-.cjs → detachTransformControls-DFTq45Xl.cjs} +1 -1
- package/build/chunks/{isFileExtensionSupported-RvlnH2dr.cjs → isFileExtensionSupported-CCEhBoz9.cjs} +1 -1
- package/build/chunks/{isFileExtensionSupported-CgcqpgqN.mjs → isFileExtensionSupported-vz_2VJPi.mjs} +1 -1
- package/build/components/grid/GridComponent.d.ts +51 -1
- package/build/constants/GridColors.d.ts +46 -2
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +106 -104
- package/build/engine/renderer/Renderer.d.ts +21 -1
- package/build/engine/scene/Scene.d.ts +9 -9
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +1 -1
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +2 -2
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +3 -4
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -1
- package/build/plugins/orientationdisplay/index.mjs +4 -5
- package/build/plugins/quickview/index.cjs +1 -1
- package/build/plugins/quickview/index.mjs +49 -49
- package/build/plugins/quickview/src/QuickView.d.ts +2 -3
- package/build/plugins/quickview/types/QuickViewSettings.d.ts +0 -14
- package/build/plugins/shader/index.cjs +1 -1
- package/build/plugins/shader/index.mjs +1 -1
- package/build/plugins/shader/src/shaders/GridNode.d.ts +4 -0
- package/build/plugins/state/index.cjs +1 -1
- package/build/plugins/state/index.mjs +151 -163
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +7 -8
- package/package.json +5 -4
- package/build/chunks/AssetCache-DdxevusY.cjs +0 -1
- package/build/chunks/GridNode-0R5ZnzR6.mjs +0 -30
- package/build/chunks/GridNode-iqnu86_v.cjs +0 -1
- package/build/chunks/OrbitController-DFPcXvlO.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const p=require("three/webgpu"),o=require("three/tsl");class h extends p.Node{constructor(i){super(),this.name="GridNode";const t=o.positionWorld.xz,e=t.div(i.uGridSize),r=o.abs(o.fract(e.sub(.5)).sub(.5)).div(o.fwidth(e)),l=o.min(r.x,r.y),u=i.uGridSize.mul(i.uMajorLineEvery),s=t.div(u),n=o.abs(o.fract(s.sub(.5)).sub(.5)).div(o.fwidth(s)),m=o.min(n.x,n.y),a=o.float(1).sub(o.min(l,1)).mul(i.uMinorLineOpacity),c=o.float(1).sub(o.min(m.div(2),1)).mul(i.uMajorLineOpacity),d=o.max(a,c).mul(o.float(1).sub(o.smoothstep(i.uFadeDistance.mul(.5),i.uFadeDistance,o.positionWorld.xz.sub(o.cameraPosition.xz).length())));d.lessThan(o.float(.001)).discard();const b=o.mix(i.uMinorLineColor,i.uMajorLineColor,o.step(a,c));return o.vec4(b,d)}}exports.GridNode=h;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Node as G } from "three/webgpu";
|
|
2
|
+
import { positionWorld as u, abs as m, fract as p, fwidth as b, min as i, float as r, max as M, smoothstep as z, cameraPosition as y, mix as L, step as C, vec4 as N } from "three/tsl";
|
|
3
|
+
class F extends G {
|
|
4
|
+
constructor(o) {
|
|
5
|
+
super(), this.name = "GridNode";
|
|
6
|
+
const t = u.xz, e = t.div(o.uGridSize), s = m(p(e.sub(0.5)).sub(0.5)).div(
|
|
7
|
+
b(e)
|
|
8
|
+
), x = i(s.x, s.y), h = o.uGridSize.mul(o.uMajorLineEvery), a = t.div(h), n = m(p(a.sub(0.5)).sub(0.5)).div(
|
|
9
|
+
b(a)
|
|
10
|
+
), j = i(n.x, n.y), c = r(1).sub(i(x, 1)).mul(o.uMinorLineOpacity), d = r(1).sub(i(j.div(2), 1)).mul(o.uMajorLineOpacity), l = M(c, d).mul(
|
|
11
|
+
r(1).sub(
|
|
12
|
+
z(
|
|
13
|
+
o.uFadeDistance.mul(0.5),
|
|
14
|
+
o.uFadeDistance,
|
|
15
|
+
u.xz.sub(y.xz).length()
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
l.lessThan(r(1e-3)).discard();
|
|
20
|
+
const v = L(
|
|
21
|
+
o.uMinorLineColor,
|
|
22
|
+
o.uMajorLineColor,
|
|
23
|
+
C(c, d)
|
|
24
|
+
);
|
|
25
|
+
return N(v, l);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
F as G
|
|
30
|
+
};
|
|
@@ -2,7 +2,7 @@ var m = Object.defineProperty;
|
|
|
2
2
|
var l = (a, e, t) => e in a ? m(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var r = (a, e, t) => l(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { P as u } from "./contributesToBounds-DYmHYES4.mjs";
|
|
5
|
-
import { M as _ } from "./FileTypes-
|
|
5
|
+
import { M as _ } from "./FileTypes-CUga4xrG.mjs";
|
|
6
6
|
class c extends _ {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var u=(r,s,t)=>s in r?m(r,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[s]=t;var a=(r,s,t)=>u(r,typeof s!="symbol"?s+"":s,t);const l=require("./contributesToBounds-C1mva__U.cjs"),d=require("./FileTypes-
|
|
1
|
+
"use strict";var m=Object.defineProperty;var u=(r,s,t)=>s in r?m(r,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[s]=t;var a=(r,s,t)=>u(r,typeof s!="symbol"?s+"":s,t);const l=require("./contributesToBounds-C1mva__U.cjs"),d=require("./FileTypes-Cm1k0dUE.cjs");class _ extends d.MeshComponent{constructor(){super();a(this,"isModelComponent",!0);a(this,"animations",[]);a(this,"_url",null);a(this,"_assetLoader",null);this.name="ModelComponent"}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await Promise.resolve().then(()=>require("../plugins/assetloader/index.cjs"))).AssetLoader),this._assetLoader}async setFromURL(t){const o=await(await this._getAssetLoader()).load(t);return this.setFromGLTF(o),this._url=t,this.dispatchEvent({type:"object-load"}),this}setFromGLTF(t){const i=[...this.contributions];this.withdraw(...i),i.forEach(e=>e.traverse(h=>{var n;(n=h.geometry)==null||n.dispose()})),this._mesh=null;const o=this.isAttached?this.owner.layers.mask:l.PRODUCT_LAYER_MASK;return t.traverse(e=>{e.castShadow=!0,e.receiveShadow=!0,e.layers.mask=o,!this._mesh&&"isMesh"in e&&(this._mesh=e,this._materialIsOwn?e.material=this._material:Array.isArray(e.material)||(this._material=e.material))}),this.animations=t.animations,this.contribute(...t.children),this}get url(){return this._url}copy(t){return super.copy(t),this._url=t.url,this.animations=t.animations,this}}exports.ModelComponent=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var D=Object.defineProperty;var E=(r,h,t)=>h in r?D(r,h,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[h]=t;var s=(r,h,t)=>E(r,typeof h!="symbol"?h+"":h,t);const i=require("three/webgpu"),S=require("./FileTypes-Cm1k0dUE.cjs");require("three/examples/jsm/loaders/HDRLoader.js");const w={enableDamping:!0,dampingFactor:.05,enabled:!0,target:new i.Vector3,minDistance:0,maxDistance:1/0,minZoom:0,maxZoom:1/0,minPolarAngle:0,maxPolarAngle:Math.PI,minAzimuthAngle:-1/0,maxAzimuthAngle:1/0,enableZoom:!0,zoomSpeed:1,enableRotate:!0,rotateSpeed:1,enablePan:!0,panSpeed:1,screenSpacePanning:!0,keyPanSpeed:7,autoRotate:!1,autoRotateSpeed:2,keys:{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},mouseButtons:{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN},touches:{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN}},c=class c extends i.EventDispatcher{constructor(t,e,a){super();s(this,"object");s(this,"domElements");s(this,"enabled",!0);s(this,"target",new i.Vector3);s(this,"minDistance",0);s(this,"maxDistance",1/0);s(this,"minZoom",0);s(this,"maxZoom",1/0);s(this,"minPolarAngle",0);s(this,"maxPolarAngle",Math.PI);s(this,"minAzimuthAngle",-1/0);s(this,"maxAzimuthAngle",1/0);s(this,"enableDamping",!0);s(this,"dampingFactor",.05);s(this,"enableZoom",!0);s(this,"zoomSpeed",1);s(this,"enableRotate",!0);s(this,"rotateSpeed",1);s(this,"enablePan",!0);s(this,"panSpeed",1);s(this,"screenSpacePanning",!0);s(this,"keyPanSpeed",7);s(this,"autoRotate",!1);s(this,"autoRotateSpeed",2);s(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"});s(this,"mouseButtons",{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN});s(this,"touches",{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN});s(this,"target0");s(this,"position0");s(this,"zoom0");s(this,"uuid",i.MathUtils.generateUUID());s(this,"state",-1);s(this,"EPS",1e-6);s(this,"spherical",new i.Spherical);s(this,"sphericalDelta",new i.Spherical);s(this,"scale",1);s(this,"panOffset",new i.Vector3);s(this,"zoomChanged",!1);s(this,"rotateStart",new i.Vector2);s(this,"rotateEnd",new i.Vector2);s(this,"rotateDelta",new i.Vector2);s(this,"panStart",new i.Vector2);s(this,"panEnd",new i.Vector2);s(this,"panDelta",new i.Vector2);s(this,"dollyStart",new i.Vector2);s(this,"dollyEnd",new i.Vector2);s(this,"dollyDelta",new i.Vector2);s(this,"pointers",[]);s(this,"pointerPositions",{});s(this,"offset",new i.Vector3);s(this,"quat");s(this,"quatInverse");s(this,"lastPosition",new i.Vector3);s(this,"lastQuaternion",new i.Quaternion);s(this,"lastTarget",new i.Vector3);s(this,"panLeft",(()=>{const t=new i.Vector3;return(e,a)=>{t.setFromMatrixColumn(a,0),t.multiplyScalar(-e),this.panOffset.add(t)}})());s(this,"panUp",(()=>{const t=new i.Vector3;return(e,a)=>{this.screenSpacePanning===!0?t.setFromMatrixColumn(a,1):(t.setFromMatrixColumn(a,0),t.crossVectors(this.object.camera.up,t)),t.multiplyScalar(e),this.panOffset.add(t)}})());s(this,"onMouseDown",t=>{let e;switch(t.button){case 0:e=this.mouseButtons.LEFT;break;case 1:e=this.mouseButtons.MIDDLE;break;case 2:e=this.mouseButtons.RIGHT;break;default:e=-1}switch(e){case i.MOUSE.DOLLY:if(this.enableZoom===!1)return;this.handleMouseDownDolly(t),this.state=1;break;case i.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}else{if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}break;case i.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(this.enableRotate===!1)return;this.handleMouseDownRotate(t),this.state=0}else{if(this.enablePan===!1)return;this.handleMouseDownPan(t),this.state=2}break;default:this.state=-1}this.state!==-1&&this.dispatchEvent({type:"start"})});s(this,"onMouseMove",t=>{if(this.enabled!==!1)switch(this.state){case 0:if(this.enableRotate===!1)return;this.handleMouseMoveRotate(t);break;case 1:if(this.enableZoom===!1)return;this.handleMouseMoveDolly(t);break;case 2:if(this.enablePan===!1)return;this.handleMouseMovePan(t);break}});s(this,"onMouseWheel",t=>{this.enabled===!1||this.enableZoom===!1||this.state!==-1||(t.preventDefault(),this.dispatchEvent({type:"start"}),this.handleMouseWheel(t),this.dispatchEvent({type:"end"}))});s(this,"onKeyDown",t=>{this.enabled===!1||this.enablePan===!1||this.handleKeyDown(t)});s(this,"onTouchStart",t=>{switch(this.trackPointer(t),this.pointers.length){case 1:switch(this.touches.ONE){case i.TOUCH.ROTATE:if(this.enableRotate===!1)return;this.handleTouchStartRotate(t),this.state=3;break;case i.TOUCH.PAN:if(this.enablePan===!1)return;this.handleTouchStartPan(t),this.state=4;break;default:this.state=-1}break;case 2:switch(this.touches.TWO){case i.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchStartDollyPan(t),this.state=5;break;case i.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchStartDollyRotate(t),this.state=6;break;default:this.state=-1}break;default:this.state=-1}this.state!==-1&&this.dispatchEvent({type:"start"})});s(this,"onTouchMove",t=>{switch(this.trackPointer(t),this.state){case 3:if(this.enableRotate===!1)return;this.handleTouchMoveRotate(t),this.update();break;case 4:if(this.enablePan===!1)return;this.handleTouchMovePan(t),this.update();break;case 5:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchMoveDollyPan(t),this.update();break;case 6:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchMoveDollyRotate(t),this.update();break;default:this.state=-1}});s(this,"onPointerDown",t=>{if(this.enabled!==!1){if(this.pointers.length===0){const e=t.currentTarget;e.setPointerCapture(t.pointerId),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp)}this.isTrackingPointer(t)||(this.addPointer(t),t.pointerType==="touch"?this.onTouchStart(t):this.onMouseDown(t))}});s(this,"onPointerMove",t=>{this.enabled!==!1&&(t.pointerType==="touch"?this.onTouchMove(t):this.onMouseMove(t))});s(this,"onPointerUp",t=>{if(this.removePointer(t),this.pointers.length===0){const e=t.currentTarget;e.releasePointerCapture(t.pointerId),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),this.dispatchEvent({type:"end"}),this.state=-1}});s(this,"onPointerCancel",t=>{this.removePointer(t)});s(this,"onContextMenu",t=>{this.enabled!==!1&&t.preventDefault()});if(this.object=t,!t.isAttached)throw new Error("OrbitController: the camera component must be attached to a node, because that is what gets moved.");this.domElements=Array.isArray(e)?e:[e],Object.assign(this,a),this.target0=this.target.clone(),this.position0=this.object.owner.position.clone(),this.zoom0=this._camera.zoom,this.quat=new i.Quaternion().setFromUnitVectors(this.object.camera.up,new i.Vector3(0,1,0)),this.quatInverse=this.quat.clone().invert(),this.domElements.forEach(o=>this.addEventListeners(o)),this.update()}get _camera(){return this.object.camera}get domElement(){return this.domElements[0]}tick(){this.enabled&&this.update()}getPolarAngle(){return this.spherical.phi}getAzimuthalAngle(){return this.spherical.theta}getDistance(){return this.object.owner.position.distanceTo(this.target)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.owner.position),this.zoom0=this._camera.zoom}reset(){this.target.copy(this.target0),this.object.owner.position.copy(this.position0),this._camera.zoom=this.zoom0,this._camera.updateProjectionMatrix(),this.dispatchEvent({type:"change"}),this.update(),this.state=-1}update(){return this.offset.copy(this.object.owner.position).sub(this.target),this.offset.applyQuaternion(this.quat),this.spherical.setFromVector3(this.offset),this.autoRotate&&this.state===-1&&this.rotateLeft(this.getAutoRotationAngle()),this.enableDamping?(this.spherical.theta+=this.sphericalDelta.theta*this.dampingFactor,this.spherical.phi+=this.sphericalDelta.phi*this.dampingFactor):(this.spherical.theta+=this.sphericalDelta.theta,this.spherical.phi+=this.sphericalDelta.phi),this.spherical.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this.spherical.theta)),this.spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this.spherical.phi)),this.spherical.makeSafe(),this.spherical.radius*=this.scale,this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius)),this.enableDamping===!0?this.target.addScaledVector(this.panOffset,this.dampingFactor):this.target.add(this.panOffset),this.offset.setFromSpherical(this.spherical),this.offset.applyQuaternion(this.quatInverse),this.object.owner.position.copy(this.target).add(this.offset),this.object.lookAt(this.target),this.enableDamping===!0?(this.sphericalDelta.theta*=1-this.dampingFactor,this.sphericalDelta.phi*=1-this.dampingFactor,this.panOffset.multiplyScalar(1-this.dampingFactor)):(this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0)),this.scale=1,this.zoomChanged||this.lastPosition.distanceToSquared(this.object.owner.position)>this.EPS||8*(1-this.lastQuaternion.dot(this.object.owner.quaternion))>this.EPS||this.lastTarget.distanceToSquared(this.target)>this.EPS?(this.dispatchEvent({type:"change"}),this.lastPosition.copy(this.object.owner.position),this.lastQuaternion.copy(this.object.owner.quaternion),this.lastTarget.copy(this.target),this.zoomChanged=!1,!0):!1}dispose(){this.domElements.forEach(t=>this.removeEventListeners(t)),this.dispatchEvent({type:"dispose"})}addDomElements(...t){t.forEach(e=>{this.domElements.includes(e)||(this.domElements.push(e),this.addEventListeners(e))})}removeDomElements(...t){t.forEach(e=>{const a=this.domElements.indexOf(e);a>-1&&(this.removeEventListeners(e),this.domElements.splice(a,1))})}setDomElements(...t){this.removeDomElements(...this.domElements),this.domElements=[],this.addDomElements(...t)}computeEncompassingView(t,e=0){const a=t.center,o=t.radius,n=this._camera,l=n.fov*(Math.PI/180),m=n.aspect,d=l/2,f=Math.atan(Math.tan(d)*m),g=o/Math.sin(d),y=o/Math.sin(f),b=Math.max(g,y)*(1+e),u=this.object.owner.position.clone().sub(this.target).normalize(),P=u.length()>.001?u:new i.Vector3(0,0,1);return{position:a.clone().add(P.multiplyScalar(b)),target:a}}focusObject(t,e=0){const a=this.computeEncompassingView(new S.BoundingBox().enclose(t).sphere,e);this.object.owner.position.copy(a.position),this.target.copy(a.target),this.update()}zoomIn(t){this.dollyIn(Math.pow(.95,t??c.DEFAULT_ZOOM_FACTOR)),this.update()}zoomOut(t){this.dollyOut(Math.pow(.95,t??c.DEFAULT_ZOOM_FACTOR)),this.update()}getState(){return{target:this.target.clone(),azimuthalAngle:this.getAzimuthalAngle(),polarAngle:this.getPolarAngle(),distance:this.getDistance(),position:this.object.owner.position.clone(),quaternion:this.object.owner.quaternion.clone()}}setState(t){this.target.copy(t.target),this.object.owner.position.copy(t.position),this.object.owner.quaternion.copy(t.quaternion),this.update()}addEventListeners(t){t.style.touchAction="none",t.addEventListener("contextmenu",this.onContextMenu),t.addEventListener("pointerdown",this.onPointerDown),t.addEventListener("pointercancel",this.onPointerCancel),t.addEventListener("wheel",this.onMouseWheel,{passive:!1}),t.addEventListener("keydown",this.onKeyDown)}removeEventListeners(t){t.removeEventListener("contextmenu",this.onContextMenu),t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointercancel",this.onPointerCancel),t.removeEventListener("wheel",this.onMouseWheel),t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp)}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}pan(t,e,a){const o=new i.Vector3;if("isPerspectiveCamera"in this._camera){const n=this.object.owner.position;o.copy(n).sub(this.target);let l=o.length();l*=Math.tan(this._camera.fov/2*Math.PI/180),this.panLeft(2*t*l/a.clientHeight,this.object.owner.matrix),this.panUp(2*e*l/a.clientHeight,this.object.owner.matrix)}else"isOrthographicCamera"in this._camera?(this.panLeft(t*(this._camera.right-this._camera.left)/this._camera.zoom/a.clientWidth,this.object.owner.matrix),this.panUp(e*(this._camera.top-this._camera.bottom)/this._camera.zoom/a.clientHeight,this.object.owner.matrix)):(console.warn("WARNING: OrbitController encountered an unknown camera type - pan disabled."),this.enablePan=!1)}dollyIn(t){"isPerspectiveCamera"in this._camera||"isOrthographicCamera"in this._camera?this.scale*=t:(console.warn("WARNING: OrbitController encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}dollyOut(t){"isPerspectiveCamera"in this._camera||"isOrthographicCamera"in this._camera?this.scale/=t:(console.warn("WARNING: OrbitController encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t){this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);const e=t.currentTarget;this.rotateLeft(2*Math.PI*this.rotateDelta.x/e.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/e.clientHeight),this.rotateStart.copy(this.rotateEnd),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyIn(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyOut(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t){const e=t.currentTarget;this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y,e),this.panStart.copy(this.panEnd),this.update()}handleMouseWheel(t){t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update()}handleKeyDown(t){let e=!1;const a=t.currentTarget;switch(t.code){case this.keys.UP:this.pan(0,this.keyPanSpeed,a),e=!0;break;case this.keys.BOTTOM:this.pan(0,-this.keyPanSpeed,a),e=!0;break;case this.keys.LEFT:this.pan(this.keyPanSpeed,0,a),e=!0;break;case this.keys.RIGHT:this.pan(-this.keyPanSpeed,0,a),e=!0;break}e&&(t.preventDefault(),this.update())}handleTouchStartRotate(t){if(this.pointers.length===1)this.rotateStart.set(t.pageX,t.pageY);else{const e=this.getSecondPointer(t),a=.5*(t.pageX+e.pageX),o=.5*(t.pageY+e.pageY);this.rotateStart.set(a,o)}}handleTouchStartPan(t){if(this.pointers.length===1)this.panStart.set(t.pageX,t.pageY);else{const e=this.getSecondPointer(t),a=.5*(t.pageX+e.pageX),o=.5*(t.pageY+e.pageY);this.panStart.set(a,o)}}handleTouchStartDolly(t){const e=this.getSecondPointer(t),a=t.pageX-e.pageX,o=t.pageY-e.pageY,n=Math.sqrt(a*a+o*o);this.dollyStart.set(0,n)}handleTouchStartDollyPan(t){this.enableZoom&&this.handleTouchStartDolly(t),this.enablePan&&this.handleTouchStartPan(t)}handleTouchStartDollyRotate(t){this.enableZoom&&this.handleTouchStartDolly(t),this.enableRotate&&this.handleTouchStartRotate(t)}handleTouchMoveRotate(t){if(this.pointers.length===1)this.rotateEnd.set(t.pageX,t.pageY);else{const a=this.getSecondPointer(t),o=.5*(t.pageX+a.pageX),n=.5*(t.pageY+a.pageY);this.rotateEnd.set(o,n)}const e=t.currentTarget;this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed),this.rotateLeft(2*Math.PI*this.rotateDelta.x/e.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/e.clientHeight),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(this.pointers.length===1)this.panEnd.set(t.pageX,t.pageY);else{const a=this.getSecondPointer(t),o=.5*(t.pageX+a.pageX),n=.5*(t.pageY+a.pageY);this.panEnd.set(o,n)}const e=t.currentTarget;this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y,e),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){const e=this.getSecondPointer(t),a=t.pageX-e.pageX,o=t.pageY-e.pageY,n=Math.sqrt(a*a+o*o);this.dollyEnd.set(0,n),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}addPointer(t){this.pointers.push(t)}removePointer(t){delete this.pointerPositions[t.pointerId];for(let e=0;e<this.pointers.length;e++)if(this.pointers[e].pointerId==t.pointerId){this.pointers.splice(e,1);return}}trackPointer(t){let e=this.pointerPositions[t.pointerId];e===void 0&&(e=new i.Vector2,this.pointerPositions[t.pointerId]=e),e.set(t.pageX,t.pageY)}getSecondPointer(t){return this.pointers[0].pointerId===t.pointerId?this.pointers[1]:this.pointers[0]}isTrackingPointer(t){return this.pointers.some(e=>e.pointerId===t.pointerId)}};s(c,"DEFAULT_ZOOM_FACTOR",1);let p=c;exports.OrbitController=p;exports.OrbitControllerDefaultSettings=w;
|
|
@@ -2,10 +2,9 @@ var T = Object.defineProperty;
|
|
|
2
2
|
var A = (p, l, t) => l in p ? T(p, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[l] = t;
|
|
3
3
|
var s = (p, l, t) => A(p, typeof l != "symbol" ? l + "" : l, t);
|
|
4
4
|
import { TOUCH as c, MOUSE as r, Vector3 as n, EventDispatcher as O, MathUtils as L, Spherical as g, Vector2 as h, Quaternion as y } from "three/webgpu";
|
|
5
|
-
import { B as R } from "./FileTypes-
|
|
5
|
+
import { B as R } from "./FileTypes-CUga4xrG.mjs";
|
|
6
6
|
import "three/examples/jsm/loaders/HDRLoader.js";
|
|
7
|
-
|
|
8
|
-
const Z = {
|
|
7
|
+
const j = {
|
|
9
8
|
enableDamping: !0,
|
|
10
9
|
dampingFactor: 0.05,
|
|
11
10
|
enabled: !0,
|
|
@@ -608,5 +607,5 @@ s(u, "DEFAULT_ZOOM_FACTOR", 1);
|
|
|
608
607
|
let b = u;
|
|
609
608
|
export {
|
|
610
609
|
b as O,
|
|
611
|
-
|
|
610
|
+
j as a
|
|
612
611
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var _=(i,e,t)=>e in i?a(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>_(i,typeof e!="symbol"?e+"":e,t);const r=require("three/webgpu"),x=require("./FileTypes-
|
|
1
|
+
"use strict";var a=Object.defineProperty;var _=(i,e,t)=>e in i?a(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>_(i,typeof e!="symbol"?e+"":e,t);const r=require("three/webgpu"),x=require("./FileTypes-Cm1k0dUE.cjs"),h=90,o=`normal ${h}px Arial`;class p extends x.DIVEComponent{constructor(){super();s(this,"isSpriteTextComponent",!0);s(this,"_text","");s(this,"_textHeight",1);s(this,"_color",new r.Color(16777215));s(this,"_canvas");s(this,"_texture");s(this,"_sprite");this.name="SpriteTextComponent",this._canvas=document.createElement("canvas"),this._texture=new r.CanvasTexture(this._canvas),this._texture.colorSpace=r.SRGBColorSpace,this._sprite=new r.Sprite(new r.SpriteMaterial({map:this._texture})),this._sprite.name="SpriteText",this.contribute(this._sprite),this._draw()}get sprite(){return this._sprite}get text(){return this._text}get textHeight(){return this._textHeight}get color(){return this._color}setText(t){return this._text=t,this._draw(),this}setTextHeight(t){return this._textHeight=t,this._draw(),this}setColor(t){return this._color.set(t),this._draw(),this}onAttach(t){this._sprite.layers.mask=t.layers.mask}copy(t){return super.copy(t),this._text=t.text,this._textHeight=t.textHeight,this._color.copy(t.color),this._draw(),this}dispose(){this._texture.dispose(),this._sprite.material.dispose()}_draw(){const t=this._canvas.getContext("2d");if(t===null)return;t.font=o;const n=Math.max(1,Math.ceil(t.measureText(this._text).width));this._canvas.width=n,this._canvas.height=h,t.font=o,t.fillStyle=`#${this._color.getHexString()}`,t.textBaseline="bottom",t.fillText(this._text,0,h),this._texture.needsUpdate=!0,this._sprite.scale.set(this._textHeight*n/h,this._textHeight,1)}}exports.SpriteTextComponent=p;
|
|
@@ -2,7 +2,7 @@ var a = Object.defineProperty;
|
|
|
2
2
|
var n = (i, e, t) => e in i ? a(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var s = (i, e, t) => n(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { Color as _, CanvasTexture as x, SRGBColorSpace as p, Sprite as c, SpriteMaterial as l } from "three/webgpu";
|
|
5
|
-
import { a as u } from "./FileTypes-
|
|
5
|
+
import { a as u } from "./FileTypes-CUga4xrG.mjs";
|
|
6
6
|
const r = 90, o = `normal ${r}px Arial`;
|
|
7
7
|
class w extends u {
|
|
8
8
|
constructor() {
|
package/build/chunks/{detachTransformControls-Dr3TIdVy.mjs → detachTransformControls-D6VK3L3-.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ var p = Object.defineProperty;
|
|
|
2
2
|
var w = (n, s, e) => s in n ? p(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
3
3
|
var r = (n, s, e) => w(n, typeof s != "symbol" ? s + "" : s, e);
|
|
4
4
|
import { AmbientLight as C, PointLight as f, MeshBasicMaterial as G, FrontSide as S, Mesh as m, SphereGeometry as u, MeshStandardMaterial as y, BufferGeometry as h, CylinderGeometry as M, BufferAttribute as c, BoxGeometry as l, ConeGeometry as A } from "three/webgpu";
|
|
5
|
-
import { f as _, M as P, g } from "./FileTypes-
|
|
5
|
+
import { f as _, M as P, g } from "./FileTypes-CUga4xrG.mjs";
|
|
6
6
|
import { a as E, P as L } from "./contributesToBounds-DYmHYES4.mjs";
|
|
7
7
|
class H extends _ {
|
|
8
8
|
constructor() {
|
package/build/chunks/{detachTransformControls-2XQrpLN-.cjs → detachTransformControls-DFTq45Xl.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var u=(i,r,e)=>r in i?d(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e;var s=(i,r,e)=>u(i,typeof r!="symbol"?r+"":r,e);const n=require("three/webgpu"),h=require("./FileTypes-
|
|
1
|
+
"use strict";var d=Object.defineProperty;var u=(i,r,e)=>r in i?d(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e;var s=(i,r,e)=>u(i,typeof r!="symbol"?r+"":r,e);const n=require("three/webgpu"),h=require("./FileTypes-Cm1k0dUE.cjs"),m=require("./contributesToBounds-C1mva__U.cjs");class p extends h.DIVELightComponent{constructor(){super(new n.AmbientLight(16777215,1));s(this,"isAmbientLightComponent",!0);this.name="AmbientLightComponent"}}const _=.1,c=.8,l=512;class w extends h.DIVELightComponent{constructor(){super(new n.PointLight(16777215,1));s(this,"isPointLightComponent",!0);s(this,"_handle");s(this,"_handleMaterial");this.name="PointLightComponent";const e=this._light;e.castShadow=!0,e.shadow.mapSize.width=l,e.shadow.mapSize.height=l,this._handleMaterial=new n.MeshBasicMaterial({color:this._light.color,transparent:!0,opacity:c,side:n.FrontSide}),this._handle=new n.Mesh(new n.SphereGeometry(_,32,32),this._handleMaterial),this._handle.layers.mask=m.PROXY_LAYER_MASK,this.contribute(this._handle)}get handle(){return this._handle}setColor(e){super.setColor(e),this._handleMaterial.color=e}setIntensity(e){super.setIntensity(e),this._handleMaterial.opacity=Math.min(e*c,c)}dispose(){super.dispose(),this._handle.geometry.dispose(),this._handleMaterial.dispose()}}const C=64,G=32;class y extends h.MeshComponent{constructor(){super();s(this,"isPrimitiveComponent",!0);s(this,"_geometry",null);this.name="PrimitiveComponent",this._material=new n.MeshStandardMaterial,this._mesh=new n.Mesh(new n.BufferGeometry,this._material),this._mesh.name="PrimitiveMesh",this._mesh.layers.mask=m.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this.contribute(this._mesh)}get geometry(){return this._geometry}setGeometry(e){const t=this._assembleGeometry(e);t&&(this._geometry=e,t.computeVertexNormals(),t.computeBoundingBox(),t.computeBoundingSphere(),this._mesh.geometry.dispose(),this._mesh.geometry=t)}copy(e){return super.copy(e),e.geometry&&this.setGeometry(e.geometry),this}_assembleGeometry(e){switch(this._material.flatShading=!1,e.name.toLowerCase()){case"cylinder":return this._createCylinderGeometry(e);case"sphere":return this._createSphereGeometry(e);case"pyramid":return this._material.flatShading=!0,this._createPyramidGeometry(e);case"cube":case"box":case"plane":return this._createBoxGeometry(e);case"cone":return this._createConeGeometry(e);case"wall":return this._createWallGeometry(e);default:return console.warn("PrimitiveComponent.setGeometry: Invalid geometry type:",e.name.toLowerCase()),null}}_createCylinderGeometry(e){const t=new n.CylinderGeometry(e.width/2,e.width/2,e.height,64);return t.translate(0,e.height/2,0),t}_createSphereGeometry(e){return new n.SphereGeometry(e.width/2,C,G)}_createPyramidGeometry(e){const t=new Float32Array([-e.width/2,0,-e.depth/2,e.width/2,0,-e.depth/2,e.width/2,0,e.depth/2,-e.width/2,0,e.depth/2,0,e.height,0]),o=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),a=new n.BufferGeometry;return a.setAttribute("position",new n.BufferAttribute(t,3)),a.setIndex(new n.BufferAttribute(o,1)),a}_createBoxGeometry(e){const t=new n.BoxGeometry(e.width,e.height,e.depth);return t.translate(0,e.height/2,0),t}_createConeGeometry(e){const t=new n.ConeGeometry(e.width/2,e.height,256);return t.translate(0,e.height/2,0),t}_createWallGeometry(e){const t=new n.BoxGeometry(e.width,e.height,e.depth||.05,16);return t.translate(0,e.height/2,0),t}}const f=i=>{const r=h.findSceneRecursive(i);r&&r.children.find(e=>{const t=e;if(t.isTransformControlsRoot&&t.controls)return t.controls.detach(),!0;const o=e;return o.isTransformControls&&o.detach?(o.detach(),!0):!1})};exports.AmbientLightComponent=p;exports.PointLightComponent=w;exports.PrimitiveComponent=y;exports.detachTransformControls=f;
|
package/build/chunks/{isFileExtensionSupported-RvlnH2dr.cjs → isFileExtensionSupported-CCEhBoz9.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./FileTypes-
|
|
1
|
+
"use strict";const n=require("./FileTypes-Cm1k0dUE.cjs");function o(e){var t;const i=(e.split("/").pop()||"").split(/[?#]/)[0];return!i.includes(".")||i.endsWith(".")?"":((t=i.split(".").pop())==null?void 0:t.toLowerCase())||""}function s(e){return e.toLowerCase()in n.FILE_TYPES}exports.getFileTypeFromUri=o;exports.isFileExtensionSupported=s;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DIVEGridColors } from '../../constants/GridColors.ts';
|
|
2
|
+
import { Color, ColorRepresentation, Mesh } from 'three/webgpu';
|
|
2
3
|
import { DIVEComponent } from '../../engine/component/Component.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Everything about a grid a caller can decide.
|
|
6
|
+
*
|
|
7
|
+
* Colors come as a whole rather than one at a time, because what makes a grid
|
|
8
|
+
* readable is the relationship between the two lines and the ground they sit
|
|
9
|
+
* on -- see the presets in {@link DIVEGridColors}. The engine never picks one:
|
|
10
|
+
* the ground is a white floor in one scene and the page behind a transparent
|
|
11
|
+
* canvas in the next, and only the caller knows which.
|
|
12
|
+
*/
|
|
13
|
+
export type DIVEGridSettings = DIVEGridColors & {
|
|
14
|
+
/** Distance between minor grid lines in meters. @default 1 */
|
|
15
|
+
gridSize: number;
|
|
16
|
+
/** Draw a thicker major line every N cells. @default 10 */
|
|
17
|
+
majorLineEvery: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const DIVEGridDefaultSettings: Required<DIVEGridSettings>;
|
|
3
20
|
/**
|
|
4
21
|
* An infinite shader-based grid that follows the camera.
|
|
5
22
|
*
|
|
@@ -32,6 +49,23 @@ export declare class GridComponent extends DIVEComponent {
|
|
|
32
49
|
get gridSize(): number;
|
|
33
50
|
/** How many cells apart the thicker major lines are drawn. */
|
|
34
51
|
get majorLineEvery(): number;
|
|
52
|
+
/** Color of the minor grid lines. */
|
|
53
|
+
get minorLineColor(): Color;
|
|
54
|
+
/** Color of the major grid lines. */
|
|
55
|
+
get majorLineColor(): Color;
|
|
56
|
+
/** How opaque the minor grid lines are drawn. */
|
|
57
|
+
get minorLineOpacity(): number;
|
|
58
|
+
/** How opaque the major grid lines are drawn. */
|
|
59
|
+
get majorLineOpacity(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Takes on whatever the settings carry, leaving the rest as it is.
|
|
62
|
+
*
|
|
63
|
+
* The way a preset is put on: `applySettings(DIVEGridOnDarkColors)` reads
|
|
64
|
+
* as what it does, and says nothing about the cell size the caller chose.
|
|
65
|
+
*
|
|
66
|
+
* @param settings - Cell size, major line spacing, line colors.
|
|
67
|
+
*/
|
|
68
|
+
applySettings(settings: Partial<DIVEGridSettings>): this;
|
|
35
69
|
/**
|
|
36
70
|
* @param visible - Whether the grid is drawn.
|
|
37
71
|
*/
|
|
@@ -45,6 +79,22 @@ export declare class GridComponent extends DIVEComponent {
|
|
|
45
79
|
* @param n - Draw a thicker major line every N cells.
|
|
46
80
|
*/
|
|
47
81
|
setMajorLineEvery(n: number): this;
|
|
82
|
+
/**
|
|
83
|
+
* @param color - Color of the minor grid lines.
|
|
84
|
+
*/
|
|
85
|
+
setMinorLineColor(color: ColorRepresentation): this;
|
|
86
|
+
/**
|
|
87
|
+
* @param color - Color of the major grid lines.
|
|
88
|
+
*/
|
|
89
|
+
setMajorLineColor(color: ColorRepresentation): this;
|
|
90
|
+
/**
|
|
91
|
+
* @param opacity - How opaque the minor grid lines are drawn, 0 to 1.
|
|
92
|
+
*/
|
|
93
|
+
setMinorLineOpacity(opacity: number): this;
|
|
94
|
+
/**
|
|
95
|
+
* @param opacity - How opaque the major grid lines are drawn, 0 to 1.
|
|
96
|
+
*/
|
|
97
|
+
setMajorLineOpacity(opacity: number): this;
|
|
48
98
|
copy(source: this): this;
|
|
49
99
|
dispose(): void;
|
|
50
100
|
}
|
|
@@ -1,2 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ColorRepresentation } from 'three/webgpu';
|
|
2
|
+
/**
|
|
3
|
+
* What a grid preset settles: how the two kinds of line read against the ground
|
|
4
|
+
* they sit on, and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* Opacity rather than a paler color, because paler only works in one direction:
|
|
7
|
+
* on a dark ground the way to a quieter line is darker, on a light one it is
|
|
8
|
+
* lighter, and opacity is the same move on both. It is also the only one open
|
|
9
|
+
* to a transparent canvas, where the ground is a page the engine cannot read.
|
|
10
|
+
*/
|
|
11
|
+
export type DIVEGridColors = {
|
|
12
|
+
/** Color of the minor grid lines. */
|
|
13
|
+
minorLineColor: ColorRepresentation;
|
|
14
|
+
/** Color of the major grid lines. */
|
|
15
|
+
majorLineColor: ColorRepresentation;
|
|
16
|
+
/** How opaque the minor grid lines are drawn, 0 to 1. */
|
|
17
|
+
minorLineOpacity: number;
|
|
18
|
+
/** How opaque the major grid lines are drawn, 0 to 1. */
|
|
19
|
+
majorLineOpacity: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Lines for a grid that sits on something light -- a white floor, or a page in
|
|
23
|
+
* its light theme.
|
|
24
|
+
*
|
|
25
|
+
* The minor lines carry the pattern and the major ones the reading of it, so
|
|
26
|
+
* the two are a step apart rather than a shade: close together they read as one
|
|
27
|
+
* grid drawn badly.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DIVEGridOnLightColors: DIVEGridColors;
|
|
30
|
+
/**
|
|
31
|
+
* Lines for a grid that sits on something dark -- a dark floor, or a page in
|
|
32
|
+
* its dark theme.
|
|
33
|
+
*
|
|
34
|
+
* Lighter than the ground rather than darker, and by less than the light
|
|
35
|
+
* preset's step: on a dark ground the same contrast reads louder, and a grid
|
|
36
|
+
* that shouts is furniture drawing attention to itself.
|
|
37
|
+
*/
|
|
38
|
+
export declare const DIVEGridOnDarkColors: DIVEGridColors;
|
|
39
|
+
/**
|
|
40
|
+
* Lines that hold on either ground, for a viewer that does not know which it is
|
|
41
|
+
* standing on.
|
|
42
|
+
*
|
|
43
|
+
* A compromise by construction: mid grey never disappears into white or into
|
|
44
|
+
* black, and never reads as well on either as the preset made for it.
|
|
45
|
+
*/
|
|
46
|
+
export declare const DIVEGridOnAnyColors: DIVEGridColors;
|
package/build/dive.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.defineProperty;var h=(e,t,n)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>h(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/FileTypes-Cm1k0dUE.cjs"),f=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),E=require("./chunks/contributesToBounds-C1mva__U.cjs"),C=require("./chunks/detachTransformControls-DFTq45Xl.cjs"),y=require("./chunks/ModelComponent-DuBAn1uS.cjs"),M=require("./chunks/SpriteTextComponent-Bho3ynCj.cjs"),L=require("./chunks/collectAnimations-C3HfZHte.cjs"),I=require("./chunks/isVisibleInHierarchy-D9JcLqR5.cjs"),D=require("./chunks/isFileExtensionSupported-CCEhBoz9.cjs"),g=require("three/webgpu"),A=require("./chunks/network-error-CdDXil5g.cjs"),S=require("./chunks/parse-error-Dy_EE4rL.cjs");class R{constructor(){m(this,"isMovable",!0)}}class T{constructor(){m(this,"isSelectable",!0)}}function _(e,t){return t.forEach(n=>{Object.getOwnPropertyNames(n.prototype).forEach(c=>{if(c==="constructor")return;const l=Object.getOwnPropertyDescriptor(n.prototype,c);Object.defineProperty(e.prototype,c,l)});const r=new n;Object.getOwnPropertyNames(r).forEach(c=>{const l=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(e.prototype,c,l)})}),e}function a(e,t=new WeakMap){if(e===null||typeof e!="object")return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){const i=[];t.set(e,i);for(let s=0;s<e.length;s++)i[s]=a(e[s],t);return i}if(e instanceof Map){const i=new Map;t.set(e,i);for(const[s,u]of e)i.set(a(s,t),a(u,t));return i}if(e instanceof Set){const i=new Set;t.set(e,i);for(const s of e)i.add(a(s,t));return i}const n=e;if(typeof n.clone=="function"){const i=n.clone();return t.set(e,i),i}const r=Object.create(Object.getPrototypeOf(e));t.set(e,r);const c=Object.getOwnPropertyNames(e);for(const i of c){const s=Object.getOwnPropertyDescriptor(e,i);if(s)if(s.value!==void 0){const u=a(s.value,t);Object.defineProperty(r,i,{...s,value:u})}else Object.defineProperty(r,i,s)}const l=Object.getOwnPropertySymbols(e);for(const i of l){const s=Object.getOwnPropertyDescriptor(e,i);if(s)if(s.value!==void 0){const u=a(s.value,t);Object.defineProperty(r,i,{...s,value:u})}else Object.defineProperty(r,i,s)}return r}const d=(e,t)=>{if(Object.keys(e).length===0&&Object.keys(t).length===0)return{};if(typeof e!="object"||typeof t!="object")return t;let n={};return Object.keys(t).forEach(r=>{if(!Object.keys(e).includes(r)){n={...n,[r]:t[r]};return}if(Array.isArray(t[r])){if(!Array.isArray(e[r])){n={...n,[r]:t[r]};return}const c=e[r],l=t[r];if(c.length===0&&l.length===0){n={...n};return}if(c.length!==l.length){n={...n,[r]:t[r]};return}const i=[];if(l.forEach((s,u)=>{const O=d(c[u],l[u]);Object.keys(O).length&&i.push(l[u])}),Object.keys(i).length){n={...n,[r]:i};return}return}if(typeof t[r]=="object"){if(typeof e[r]!="object"){n={...n,[r]:t[r]};return}const c=d(e[r],t[r]);if(Object.keys(c).length){n={...n,[r]:c};return}}e[r]!==t[r]&&(n={...n,[r]:t[r]})}),n};function x(e){return o.SUPPORTED_MIME_TYPES.includes(e.toLowerCase())}function F(e){return D.isFileExtensionSupported(D.getFileTypeFromUri(e))}function p(e,t){const n=(e+"e").split("e");return+(n[0]+"e"+(+n[1]+(t||0)))}function Y(e,t=0){const n=p(e,+t);return p(Math.ceil(n),-t)}function w(e,t=0){const n=p(e,+t);return p(Math.floor(n),-t)}function V(e,t=0){if(e<0)return-V(-e,t);const n=p(e,+t);return p(Math.round(n),-t)}function B(e,t,n){return Math.atan2(e.clone().cross(t).dot(n),t.clone().dot(e))}function U(e,t=0){const n=p(e,+t);return p(Math.round(n),-t).toFixed(t)}function b(e,t=0){const n=p(e,+t);return p(Math.trunc(n),-t)}function K(e){return(g.MathUtils.radToDeg(e)+360)%360}function G(e){return g.MathUtils.degToRad(e)}const v={ceilExp:Y,floorExp:w,roundExp:V,toFixedExp:U,truncateExp:b,signedAngleTo:B,radToDeg:K,degToRad:G};exports.BoundingBox=o.BoundingBox;exports.BoundingBoxComponent=o.BoundingBoxComponent;exports.DIVE=o.DIVE;exports.DIVEAbortablePromise=o.DIVEAbortablePromise;exports.DIVECameraComponent=o.DIVECameraComponent;exports.DIVECanvasLifecycleManager=o.DIVECanvasLifecycleManager;exports.DIVEClock=o.DIVEClock;exports.DIVEComponent=o.DIVEComponent;exports.DIVEDefaultSettings=o.DIVEDefaultSettings;exports.DIVEDeferredPromise=o.DIVEDeferredPromise;exports.DIVEEnvironment=o.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=o.DIVEEnvironmentDefaultSettings;exports.DIVEGridDefaultSettings=o.DIVEGridDefaultSettings;exports.DIVEGridOnAnyColors=o.DIVEGridOnAnyColors;exports.DIVEGridOnDarkColors=o.DIVEGridOnDarkColors;exports.DIVEGridOnLightColors=o.DIVEGridOnLightColors;exports.DIVELightComponent=o.DIVELightComponent;exports.DIVENode=o.DIVENode;exports.DIVEPerspectiveCameraDefaultSettings=o.DIVEPerspectiveCameraDefaultSettings;exports.DIVERenderer=o.DIVERenderer;exports.DIVERendererDefaultSettings=o.DIVERendererDefaultSettings;exports.DIVERoot=o.DIVERoot;exports.DIVEScene=o.DIVEScene;exports.DIVESceneDefaultSettings=o.DIVESceneDefaultSettings;exports.DIVEView=o.DIVEView;exports.DirectionalLightComponent=o.DirectionalLightComponent;exports.FILE_TYPES=o.FILE_TYPES;exports.FloorComponent=o.FloorComponent;exports.GridComponent=o.GridComponent;exports.HemisphereLightComponent=o.HemisphereLightComponent;exports.MeshComponent=o.MeshComponent;exports.MultiLineComponent=o.MultiLineComponent;exports.PerspectiveCameraComponent=o.PerspectiveCameraComponent;exports.SUPPORTED_FILE_TYPES=o.SUPPORTED_FILE_TYPES;exports.SUPPORTED_MIME_TYPES=o.SUPPORTED_MIME_TYPES;exports.computeProductBounds=o.computeProductBounds;exports.contributedBy=o.contributedBy;exports.disposeComponents=o.disposeComponents;exports.findComponent=o.findComponent;exports.findSceneRecursive=o.findSceneRecursive;exports.isDIVEComponent=o.isDIVEComponent;exports.AxesColorBlue=f.AxesColorBlue;exports.AxesColorBlueLetter=f.AxesColorBlueLetter;exports.AxesColorGreen=f.AxesColorGreen;exports.AxesColorGreenLetter=f.AxesColorGreenLetter;exports.AxesColorRed=f.AxesColorRed;exports.AxesColorRedLetter=f.AxesColorRedLetter;exports.COORDINATE_LAYER_MASK=E.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=E.DEFAULT_LAYER_MASK;exports.FLOOR_LAYER_MASK=E.FLOOR_LAYER_MASK;exports.HELPER_LAYER_MASK=E.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=E.PRODUCT_LAYER_MASK;exports.PROXY_LAYER_MASK=E.PROXY_LAYER_MASK;exports.UI_LAYER_MASK=E.UI_LAYER_MASK;exports.contributesToBounds=E.contributesToBounds;exports.AmbientLightComponent=C.AmbientLightComponent;exports.PointLightComponent=C.PointLightComponent;exports.PrimitiveComponent=C.PrimitiveComponent;exports.detachTransformControls=C.detachTransformControls;exports.ModelComponent=y.ModelComponent;exports.SpriteTextComponent=M.SpriteTextComponent;exports.collectAnimations=L.collectAnimations;exports.findInterface=I.findInterface;exports.implementsInterface=I.implementsInterface;exports.isVisibleInHierarchy=I.isVisibleInHierarchy;exports.getFileTypeFromUri=D.getFileTypeFromUri;exports.isFileExtensionSupported=D.isFileExtensionSupported;exports.FileContentError=A.FileContentError;exports.NetworkError=A.NetworkError;exports.FileTypeError=S.FileTypeError;exports.ParseError=S.ParseError;exports.DIVEMath=v;exports.DIVEMovable=R;exports.DIVESelectable=T;exports.applyMixins=_;exports.deepClone=a;exports.getObjectDelta=d;exports.isMimeTypeSupported=x;exports.isURIFileExtensionSupported=F;
|