@shopware-ag/dive 2.3.7 → 3.0.0-beta.0

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.
Files changed (142) hide show
  1. package/build/chunks/Animator-DHnpWRt_.mjs +16 -0
  2. package/build/chunks/Animator-YDE8aFEd.cjs +1 -0
  3. package/build/chunks/{AssetCache-DSpWOp3n.mjs → AssetCache-C2DuXcmp.mjs} +6 -5
  4. package/build/chunks/AssetCache-CnbDDhU8.cjs +1 -0
  5. package/build/chunks/AssetExporter-Cdxb04b3.cjs +1 -0
  6. package/build/chunks/AssetExporter-DLL_vJae.mjs +67 -0
  7. package/build/chunks/AssetLoader-DO7xlbC3.mjs +499 -0
  8. package/build/chunks/AssetLoader-h2uyFEfZ.cjs +3 -0
  9. package/build/chunks/{ClipAnimator-keFLDMNZ.mjs → ClipAnimator-D8Gho4Ec.mjs} +2 -2
  10. package/build/chunks/ClipAnimator-SdDq2wk1.cjs +1 -0
  11. package/build/chunks/FileTypes-BB4_1gBJ.mjs +1975 -0
  12. package/build/chunks/FileTypes-Bvt5QTJC.cjs +29 -0
  13. package/build/chunks/GridNode-0R5ZnzR6.mjs +30 -0
  14. package/build/chunks/GridNode-iqnu86_v.cjs +1 -0
  15. package/build/chunks/{PerspectiveCamera-BFzE2TQU.mjs → PerspectiveCamera-B5TvUzTa.mjs} +1 -1
  16. package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +1 -0
  17. package/build/chunks/{TargetAnimator-DuqPk2eq.cjs → TargetAnimator-D37bWNKD.cjs} +1 -1
  18. package/build/chunks/{TargetAnimator-DUqkkdVb.mjs → TargetAnimator-DL_9b921.mjs} +1 -1
  19. package/build/chunks/{isFileTypeSupported-zLrD710P.mjs → isFileTypeSupported-D1z0zckw.mjs} +1 -1
  20. package/build/chunks/{isFileTypeSupported-Bh5Scxis.cjs → isFileTypeSupported-MJWHcUsR.cjs} +1 -1
  21. package/build/components/boundingbox/BoundingBox.d.ts +1 -1
  22. package/build/components/floor/Floor.d.ts +1 -1
  23. package/build/components/gizmo/Gizmo.d.ts +1 -1
  24. package/build/components/gizmo/handles/AxisHandle.d.ts +1 -1
  25. package/build/components/gizmo/handles/RadialHandle.d.ts +1 -1
  26. package/build/components/gizmo/handles/ScaleHandle.d.ts +1 -1
  27. package/build/components/gizmo/plane/GizmoPlane.d.ts +1 -1
  28. package/build/components/gizmo/rotate/RotateGizmo.d.ts +1 -1
  29. package/build/components/gizmo/scale/ScaleGizmo.d.ts +1 -1
  30. package/build/components/gizmo/translate/TranslateGizmo.d.ts +1 -1
  31. package/build/components/grid/Grid.d.ts +2 -1
  32. package/build/components/group/Group.d.ts +1 -1
  33. package/build/components/light/AmbientLight.d.ts +1 -1
  34. package/build/components/light/PointLight.d.ts +1 -1
  35. package/build/components/light/SceneLight.d.ts +1 -1
  36. package/build/components/model/Model.d.ts +1 -1
  37. package/build/components/node/Node.d.ts +1 -1
  38. package/build/components/primitive/Primitive.d.ts +1 -1
  39. package/build/components/root/Root.d.ts +1 -1
  40. package/build/dive.cjs +1 -1
  41. package/build/dive.mjs +58 -60
  42. package/build/engine/Dive.d.ts +3 -31
  43. package/build/engine/camera/PerspectiveCamera.d.ts +1 -1
  44. package/build/engine/environment/Environment.d.ts +12 -27
  45. package/build/engine/renderer/Renderer.d.ts +7 -8
  46. package/build/engine/scene/Scene.d.ts +1 -1
  47. package/build/engine/scene/xrroot/XRRoot.d.ts +2 -3
  48. package/build/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +3 -3
  49. package/build/helpers/findInterface/findInterface.d.ts +1 -1
  50. package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +1 -1
  51. package/build/helpers/implementsInterface/implementsInterface.d.ts +1 -1
  52. package/build/helpers/math/signedAngleTo/signedAngleTo.d.ts +1 -1
  53. package/build/interfaces/Hoverable.d.ts +1 -1
  54. package/build/plugins/animation/index.cjs +1 -1
  55. package/build/plugins/animation/index.mjs +12 -20
  56. package/build/plugins/animation/src/animator/Animator.d.ts +1 -1
  57. package/build/plugins/animation/src/animator/ClipAnimator.d.ts +1 -1
  58. package/build/plugins/animation/src/system/AnimationSystem.d.ts +1 -6
  59. package/build/plugins/animation/src/types/AnimatorTypes.d.ts +1 -1
  60. package/build/plugins/ar/index.cjs +1 -1
  61. package/build/plugins/ar/index.mjs +5 -4
  62. package/build/plugins/ar/src/webxr/controller/WebXRController.d.ts +1 -1
  63. package/build/plugins/ar/src/webxr/crosshair/WebXRCrosshair.d.ts +1 -1
  64. package/build/plugins/ar/src/webxr/origin/WebXROrigin.d.ts +1 -1
  65. package/build/plugins/ar/src/webxr/raycaster/WebXRRaycaster.d.ts +1 -1
  66. package/build/plugins/ar/src/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +1 -1
  67. package/build/plugins/assetcache/index.cjs +1 -1
  68. package/build/plugins/assetcache/index.mjs +1 -1
  69. package/build/plugins/assetexporter/index.cjs +1 -1
  70. package/build/plugins/assetexporter/index.mjs +1 -1
  71. package/build/plugins/assetexporter/src/AssetExporter.d.ts +1 -1
  72. package/build/plugins/assetloader/index.cjs +1 -1
  73. package/build/plugins/assetloader/index.mjs +2 -2
  74. package/build/plugins/assetloader/src/loader/AssetLoader.d.ts +2 -2
  75. package/build/plugins/assetloader/src/step/STEPLoader.d.ts +1 -1
  76. package/build/plugins/mediacreator/index.cjs +1 -1
  77. package/build/plugins/mediacreator/index.mjs +52 -24
  78. package/build/plugins/mediacreator/src/MediaCreator.d.ts +4 -3
  79. package/build/plugins/mediacreator/types/MediaGenerationByPosition.d.ts +1 -1
  80. package/build/plugins/orbitcontroller/index.cjs +1 -1
  81. package/build/plugins/orbitcontroller/index.mjs +1 -1
  82. package/build/plugins/orbitcontroller/src/OrbitController.d.ts +1 -1
  83. package/build/plugins/orbitcontroller/types/OrbitControllerState.types.d.ts +1 -1
  84. package/build/plugins/orientationdisplay/index.cjs +1 -1
  85. package/build/plugins/orientationdisplay/index.mjs +17 -16
  86. package/build/plugins/orientationdisplay/src/axes/Axes.d.ts +1 -1
  87. package/build/plugins/quickview/index.cjs +1 -1
  88. package/build/plugins/quickview/index.mjs +9 -8
  89. package/build/plugins/shader/index.cjs +1 -1
  90. package/build/plugins/shader/index.mjs +2 -3
  91. package/build/plugins/shader/src/index.d.ts +1 -3
  92. package/build/plugins/shader/src/shaders/GridNode.d.ts +16 -0
  93. package/build/plugins/state/index.cjs +11 -11
  94. package/build/plugins/state/index.mjs +1538 -1537
  95. package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
  96. package/build/plugins/state/src/actions/camera/getcameratransform.d.ts +1 -1
  97. package/build/plugins/state/src/actions/camera/movecamera.d.ts +1 -1
  98. package/build/plugins/state/src/actions/camera/setcameratransform.d.ts +1 -1
  99. package/build/plugins/state/types/StateSceneData.d.ts +1 -1
  100. package/build/plugins/toolbox/index.cjs +1 -1
  101. package/build/plugins/toolbox/index.d.ts +0 -1
  102. package/build/plugins/toolbox/index.mjs +224 -853
  103. package/build/plugins/toolbox/src/PointerContext.d.ts +1 -1
  104. package/build/plugins/toolbox/src/SelectionState.d.ts +1 -1
  105. package/build/plugins/toolbox/src/Toolbox.d.ts +0 -10
  106. package/build/plugins/toolbox/src/drag/DragTool.d.ts +1 -1
  107. package/build/plugins/toolbox/src/drag/DraggableEvent.d.ts +1 -1
  108. package/build/plugins/toolbox/src/hover/HoverTool.d.ts +1 -1
  109. package/build/plugins/toolbox/src/select/SelectTool.d.ts +1 -1
  110. package/build/plugins/toolbox/src/transform/TransformTool.d.ts +2 -1
  111. package/build/types/schema/GroupSchema.d.ts +1 -1
  112. package/build/types/schema/LightSchema.d.ts +1 -1
  113. package/build/types/schema/MaterialSchema.d.ts +1 -1
  114. package/build/types/schema/ModelSchema.d.ts +1 -1
  115. package/build/types/schema/PovSchema.d.ts +1 -1
  116. package/build/types/schema/PrimitiveSchema.d.ts +1 -1
  117. package/package.json +5 -4
  118. package/build/chunks/Animator-BGFdF70Z.mjs +0 -47
  119. package/build/chunks/Animator-Cu7NIkVg.cjs +0 -1
  120. package/build/chunks/AssetCache-DJyYrAdR.cjs +0 -1
  121. package/build/chunks/AssetExporter-PFiNYi50.mjs +0 -1628
  122. package/build/chunks/AssetExporter-yVhYmVXW.cjs +0 -164
  123. package/build/chunks/AssetLoader-BA_QwJMR.mjs +0 -2590
  124. package/build/chunks/AssetLoader-DJb8P6eB.cjs +0 -5
  125. package/build/chunks/ClipAnimator-tjhLo851.cjs +0 -1
  126. package/build/chunks/DIVEShaderMaterial-Bt0d8oJB.mjs +0 -3468
  127. package/build/chunks/DIVEShaderMaterial-DE8YRWj9.cjs +0 -1554
  128. package/build/chunks/FileTypes-BSJhZREN.cjs +0 -33
  129. package/build/chunks/FileTypes-CUf24rq6.mjs +0 -2155
  130. package/build/chunks/PerspectiveCamera-iAsZqrnY.cjs +0 -1
  131. package/build/chunks/draco_decoder-Bh9flJPu.cjs +0 -1
  132. package/build/chunks/draco_decoder-CEzwqP9o.mjs +0 -38
  133. package/build/chunks/draco_decoder-DtHHc5d0.mjs +0 -4
  134. package/build/chunks/draco_decoder-DvYjcLz_.cjs +0 -35
  135. package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +0 -118
  136. package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +0 -121
  137. package/build/chunks/fflate.module-DHdJvhNh.cjs +0 -6
  138. package/build/chunks/fflate.module-xyO_T3Zm.mjs +0 -602
  139. package/build/plugins/shader/src/material/DIVEShaderMaterial.d.ts +0 -5
  140. package/build/plugins/shader/src/shaders/DIVEShaderLib.d.ts +0 -2
  141. package/build/plugins/shader/src/shaders/grid/index.d.ts +0 -40
  142. package/build/plugins/toolbox/src/BaseTool.d.ts +0 -59
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var d=(r,o,t)=>o in r?l(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;var s=(r,o,t)=>d(r,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@tweenjs/tween.js"),g=require("./Animator-Cu7NIkVg.cjs");class y extends g.Animator{constructor(t,i,n){super();s(this,"_group",new p.Group);s(this,"_tweens",[]);s(this,"_snapshots",[]);s(this,"_state","idle");s(this,"_duration");s(this,"_loop","once");s(this,"_options");s(this,"_completedCount",0);this._duration=i,this._options=n;const u=Array.isArray(t)?t:[t];for(const h of u){const _={};for(const e of Object.keys(h.to))_[e]=h.object[e];this._snapshots.push({object:h.object,values:_});const c=new p.Tween(h.object,this._group).to(h.to,i).easing((n==null?void 0:n.easing)??p.Easing.Quadratic.Out).onUpdate(()=>{var e,a;(a=(e=this._options)==null?void 0:e.onUpdate)==null||a.call(e),this.dispatchEvent({type:"update",target:this})}).onComplete(()=>{var e,a;this._completedCount++,this._completedCount>=this._tweens.length&&(this._state="idle",(a=(e=this._options)==null?void 0:e.onComplete)==null||a.call(e),this.dispatchEvent({type:"complete",target:this}))});this._tweens.push(c)}}get state(){return this._state}get duration(){return this._duration}get loop(){return this._loop}set loop(t){this._loop=t,this._tweens.forEach(i=>{i.repeat(t==="once"?0:1/0),i.yoyo(t==="pingpong")})}get time(){return this._tweens.length>0?this._tweens[0].getDuration():0}set time(t){}play(){return this._tweens.forEach(t=>t.stop()),this._state="playing",this._completedCount=0,this._restoreSnapshots(),this._tweens.forEach(t=>t.start()),this.dispatchEvent({type:"play",target:this}),this}pause(){return this._state="paused",this._tweens.forEach(t=>t.pause()),this.dispatchEvent({type:"pause",target:this}),this}resume(){return this._state="playing",this._tweens.forEach(t=>t.resume()),this.dispatchEvent({type:"resume",target:this}),this}stop(){return this._state="idle",this._tweens.forEach(t=>t.stop()),this._restoreSnapshots(),this.dispatchEvent({type:"stop",target:this}),this}update(){this._state!=="idle"&&this._group.update()}_restoreSnapshots(){for(const{object:t,values:i}of this._snapshots)for(const n of Object.keys(i))t[n]=i[n]}dispose(){this._tweens.forEach(t=>t.stop()),this._tweens=[],this._group.removeAll(),this._state="idle"}}exports.TargetAnimator=y;
1
+ "use strict";var l=Object.defineProperty;var d=(r,o,t)=>o in r?l(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t;var s=(r,o,t)=>d(r,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@tweenjs/tween.js"),g=require("./Animator-YDE8aFEd.cjs");class y extends g.Animator{constructor(t,i,n){super();s(this,"_group",new p.Group);s(this,"_tweens",[]);s(this,"_snapshots",[]);s(this,"_state","idle");s(this,"_duration");s(this,"_loop","once");s(this,"_options");s(this,"_completedCount",0);this._duration=i,this._options=n;const u=Array.isArray(t)?t:[t];for(const h of u){const _={};for(const e of Object.keys(h.to))_[e]=h.object[e];this._snapshots.push({object:h.object,values:_});const c=new p.Tween(h.object,this._group).to(h.to,i).easing((n==null?void 0:n.easing)??p.Easing.Quadratic.Out).onUpdate(()=>{var e,a;(a=(e=this._options)==null?void 0:e.onUpdate)==null||a.call(e),this.dispatchEvent({type:"update",target:this})}).onComplete(()=>{var e,a;this._completedCount++,this._completedCount>=this._tweens.length&&(this._state="idle",(a=(e=this._options)==null?void 0:e.onComplete)==null||a.call(e),this.dispatchEvent({type:"complete",target:this}))});this._tweens.push(c)}}get state(){return this._state}get duration(){return this._duration}get loop(){return this._loop}set loop(t){this._loop=t,this._tweens.forEach(i=>{i.repeat(t==="once"?0:1/0),i.yoyo(t==="pingpong")})}get time(){return this._tweens.length>0?this._tweens[0].getDuration():0}set time(t){}play(){return this._tweens.forEach(t=>t.stop()),this._state="playing",this._completedCount=0,this._restoreSnapshots(),this._tweens.forEach(t=>t.start()),this.dispatchEvent({type:"play",target:this}),this}pause(){return this._state="paused",this._tweens.forEach(t=>t.pause()),this.dispatchEvent({type:"pause",target:this}),this}resume(){return this._state="playing",this._tweens.forEach(t=>t.resume()),this.dispatchEvent({type:"resume",target:this}),this}stop(){return this._state="idle",this._tweens.forEach(t=>t.stop()),this._restoreSnapshots(),this.dispatchEvent({type:"stop",target:this}),this}update(){this._state!=="idle"&&this._group.update()}_restoreSnapshots(){for(const{object:t,values:i}of this._snapshots)for(const n of Object.keys(i))t[n]=i[n]}dispose(){this._tweens.forEach(t=>t.stop()),this._tweens=[],this._group.removeAll(),this._state="idle"}}exports.TargetAnimator=y;
@@ -2,7 +2,7 @@ var c = Object.defineProperty;
2
2
  var d = (n, o, t) => o in n ? c(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
3
3
  var s = (n, o, t) => d(n, typeof o != "symbol" ? o + "" : o, t);
4
4
  import { Group as l, Tween as g, Easing as f } from "@tweenjs/tween.js";
5
- import { A as y } from "./Animator-BGFdF70Z.mjs";
5
+ import { A as y } from "./Animator-DHnpWRt_.mjs";
6
6
  class v extends y {
7
7
  constructor(t, i, h) {
8
8
  super();
@@ -1,4 +1,4 @@
1
- import { F as n } from "./FileTypes-CUf24rq6.mjs";
1
+ import { F as n } from "./FileTypes-BB4_1gBJ.mjs";
2
2
  function r(e) {
3
3
  var i;
4
4
  const t = e.split("/").pop() || "";
@@ -1 +1 @@
1
- "use strict";const n=require("./FileTypes-BSJhZREN.cjs");function o(e){var t;const i=e.split("/").pop()||"";return!i.includes(".")||i.endsWith(".")?"":((t=i.split(".").pop())==null?void 0:t.toLowerCase().split("?")[0])||""}function r(e){return e.toLowerCase()in n.FILE_TYPES}exports.getFileTypeFromUri=o;exports.isFileTypeSupported=r;
1
+ "use strict";const n=require("./FileTypes-Bvt5QTJC.cjs");function o(e){var t;const i=e.split("/").pop()||"";return!i.includes(".")||i.endsWith(".")?"":((t=i.split(".").pop())==null?void 0:t.toLowerCase().split("?")[0])||""}function r(e){return e.toLowerCase()in n.FILE_TYPES}exports.getFileTypeFromUri=o;exports.isFileTypeSupported=r;
@@ -1,4 +1,4 @@
1
- import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three';
1
+ import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three/webgpu';
2
2
  import { DIVENode } from '../node/Node.ts';
3
3
  /**
4
4
  * A bounding box component that provides both axis-aligned and oriented bounding boxes
@@ -1,4 +1,4 @@
1
- import { ColorRepresentation, Mesh } from 'three';
1
+ import { ColorRepresentation, Mesh } from 'three/webgpu';
2
2
  /**
3
3
  * A basic floor geometry.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { Euler, Object3D, Vector3 } from 'three';
1
+ import { Euler, Object3D, Vector3 } from 'three/webgpu';
2
2
  import { OrbitController } from '../../plugins/orbitcontroller/index.ts';
3
3
  import { DIVEGizmoPlane as DIVEGizmoPlane } from './plane/GizmoPlane.ts';
4
4
  import { DIVESelectable } from '../../interfaces/Selectable.ts';
@@ -1,4 +1,4 @@
1
- import { ColorRepresentation, Object3D, Vector3 } from 'three';
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
2
2
  import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
3
3
  import { DIVETranslateGizmo } from '../translate/TranslateGizmo.ts';
4
4
  import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
@@ -1,4 +1,4 @@
1
- import { ColorRepresentation, Object3D, Vector3 } from 'three';
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
2
2
  import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
3
3
  import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
4
4
  import { DIVERotateGizmo } from '../rotate/RotateGizmo.ts';
@@ -1,4 +1,4 @@
1
- import { ColorRepresentation, Object3D, Vector3 } from 'three';
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three/webgpu';
2
2
  import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
3
3
  import { DIVEScaleGizmo } from '../scale/ScaleGizmo.ts';
4
4
  import { DIVEDraggable } from '../../../interfaces/Draggable.ts';
@@ -1,4 +1,4 @@
1
- import { Mesh, Object3D } from 'three';
1
+ import { Mesh, Object3D } from 'three/webgpu';
2
2
  import { DIVEGizmoAxis, DIVEGizmoMode } from '../Gizmo.ts';
3
3
  export declare class DIVEGizmoPlane extends Object3D {
4
4
  private _meshX;
@@ -1,4 +1,4 @@
1
- import { Object3D } from 'three';
1
+ import { Object3D } from 'three/webgpu';
2
2
  import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
3
3
  import { DIVERadialHandle } from '../handles/RadialHandle.ts';
4
4
  import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
@@ -1,4 +1,4 @@
1
- import { Object3D, Vector3 } from 'three';
1
+ import { Object3D, Vector3 } from 'three/webgpu';
2
2
  import { DIVEHoverable } from '../../../interfaces/Hoverable.ts';
3
3
  import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
4
4
  import { DIVEScaleHandle } from '../handles/ScaleHandle.ts';
@@ -1,4 +1,4 @@
1
- import { Object3D } from 'three';
1
+ import { Object3D } from 'three/webgpu';
2
2
  import { OrbitController } from '../../../plugins/orbitcontroller/index.ts';
3
3
  import { DIVEAxisHandle } from '../handles/AxisHandle.ts';
4
4
  import { DraggableEvent } from '../../../plugins/toolbox/index.ts';
@@ -1,4 +1,4 @@
1
- import { Object3D } from 'three';
1
+ import { Object3D } from 'three/webgpu';
2
2
  export interface DIVEGridSettings {
3
3
  /** Distance between minor grid lines in meters. @default 1 */
4
4
  gridSize?: number;
@@ -13,6 +13,7 @@ export interface DIVEGridSettings {
13
13
  export declare class DIVEGrid extends Object3D {
14
14
  private _mesh;
15
15
  private _material;
16
+ private _uniforms;
16
17
  private _gridSize;
17
18
  constructor(settings?: DIVEGridSettings);
18
19
  setVisibility(visible: boolean): void;
@@ -1,4 +1,4 @@
1
- import { Vector3Like, Object3D } from 'three';
1
+ import { Vector3Like, Object3D } from 'three/webgpu';
2
2
  import { DIVENode } from '../node/Node.ts';
3
3
  import { DIVESceneObject } from '../../types/index.ts';
4
4
  export declare class DIVEGroup extends DIVENode {
@@ -1,4 +1,4 @@
1
- import { Color, Object3D } from 'three';
1
+ import { Color, Object3D } from 'three/webgpu';
2
2
  import { DIVESelectable } from '../../index.ts';
3
3
  /**
4
4
  * A basic ambient light.
@@ -1,4 +1,4 @@
1
- import { Color, Object3D } from 'three';
1
+ import { Color, Object3D } from 'three/webgpu';
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';
@@ -1,5 +1,5 @@
1
1
  import { DIVESelectable } from '../../index.ts';
2
- import { Color, Object3D } from 'three';
2
+ import { Color, Object3D } from 'three/webgpu';
3
3
  /**
4
4
  * A complex scene light.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { Mesh, MeshStandardMaterial, Object3D } from 'three';
1
+ import { Mesh, MeshStandardMaterial, Object3D } from 'three/webgpu';
2
2
  import { DIVENode } from '../node/Node.ts';
3
3
  import { MaterialSchema } from 'src/types/index.ts';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Box3, Object3D, Vector3, Vector3Like } from 'three';
1
+ import { Box3, Object3D, Vector3, Vector3Like } from 'three/webgpu';
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';
@@ -1,4 +1,4 @@
1
- import { Mesh, MeshStandardMaterial } from 'three';
1
+ import { Mesh, MeshStandardMaterial } from 'three/webgpu';
2
2
  import { DIVEModel } from '../model/Model.ts';
3
3
  import { GeometrySchema } from '../../types/index.ts';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Box3, Object3D } from 'three';
1
+ import { Box3, Object3D } from 'three/webgpu';
2
2
  import { EntitySchema, EntityTypeSchema, MinimalSchema, PartialSchema } from '../../index.ts';
3
3
  import { DIVESceneObject } from '../../types/index.ts';
4
4
  import { DIVEFloor } from '../floor/Floor.ts';
package/build/dive.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var R=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>R(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-BSJhZREN.cjs"),u=require("./chunks/PerspectiveCamera-iAsZqrnY.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three"),V=require("./chunks/findInterface-C6mrvf_t.cjs"),y=require("./chunks/isFileTypeSupported-Bh5Scxis.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),A=require("./chunks/parse-error-Dy_EE4rL.cjs"),P=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function O(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function v(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function x(r,i=0){if(r<0)return-x(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function H(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function z(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function G(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function C(r){return s.MathUtils.degToRad(r)}const S={ceilExp:O,floorExp:v,roundExp:x,toFixedExp:z,truncateExp:G,signedAngleTo:H,radToDeg:L,degToRad:C};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class T extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class N extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class F extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new T(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new j(e),this._gizmoPlane=new N,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class U{constructor(){n(this,"isMovable",!0)}}class K{constructor(){n(this,"isSelectable",!0)}}function X(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function q(r){return r.entityType==="group"}function B(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEEngine=c.DIVEEngine;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderPipeline=c.DIVERenderPipeline;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVEResizeManager=c.DIVEResizeManager;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=V.findInterface;exports.implementsInterface=V.implementsInterface;exports.getFileTypeFromUri=y.getFileTypeFromUri;exports.isFileTypeSupported=y.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=A.FileTypeError;exports.ParseError=A.ParseError;exports.isModelSchema=P.isModelSchema;exports.isPovSchema=P.isPovSchema;exports.DIVEGizmo=F;exports.DIVEMath=S;exports.DIVEMovable=U;exports.DIVESelectable=K;exports.applyMixins=X;exports.deepClone=f;exports.getObjectDelta=I;exports.isGroupSchema=q;exports.isLightSchema=B;exports.isPrimitiveSchema=Z;
1
+ "use strict";var b=Object.defineProperty;var R=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>R(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./chunks/FileTypes-Bvt5QTJC.cjs"),u=require("./chunks/PerspectiveCamera-DwQUmkDv.cjs"),_=require("./chunks/AxisHelperColors-BrGqktN5.cjs"),s=require("three/webgpu"),V=require("./chunks/findInterface-C6mrvf_t.cjs"),y=require("./chunks/isFileTypeSupported-MJWHcUsR.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),A=require("./chunks/parse-error-Dy_EE4rL.cjs"),x=require("./chunks/PovSchema-Co9FznEz.cjs");class m extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const l=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const g=new s.TorusGeometry(t,.1,3,48,o),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function p(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function O(r,i=0){const e=p(r,+i);return p(Math.ceil(e),-i)}function v(r,i=0){const e=p(r,+i);return p(Math.floor(e),-i)}function P(r,i=0){if(r<0)return-P(-r,i);const e=p(r,+i);return p(Math.round(e),-i)}function H(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function z(r,i=0){const e=p(r,+i);return p(Math.round(e),-i).toFixed(i)}function G(r,i=0){const e=p(r,+i);return p(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function C(r){return s.MathUtils.degToRad(r)}const S={ceilExp:O,floorExp:v,roundExp:P,toFixedExp:z,truncateExp:G,signedAngleTo:H,radToDeg:L,degToRad:C};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new m("x",1,Math.PI/2,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new m("y",1,-Math.PI/2,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new m("z",1,Math.PI/2,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),l=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,l)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const l=new s.Mesh(a,this._lineMaterial);l.layers.mask=u.UI_LAYER_MASK,l.renderOrder=1/0,l.rotateX(Math.PI/2),l.translateY(t/2),this.add(l);const d=new s.CylinderGeometry(.1,.1,t,3),g=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,g),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class T extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class M extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const l=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(l,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const g=new s.CylinderGeometry(.1,.1,t+a/2,3),E=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(g,E),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new M("x",1,new s.Vector3(1,0,0),_.AxesColorRed)),this.add(new M("y",1,new s.Vector3(0,1,0),_.AxesColorGreen)),this.add(new M("z",1,new s.Vector3(0,0,1),_.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class N extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const l=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(l,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class F extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new T(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new j(e),this._gizmoPlane=new N,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class U{constructor(){n(this,"isMovable",!0)}}class K{constructor(){n(this,"isSelectable",!0)}}function X(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function f(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let l=0;l<r.length;l++)a[l]=f(r[l],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[l,d]of r)a.set(f(l,i),f(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const l of r)a.add(f(l,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const l=Object.getOwnPropertyDescriptor(r,a);if(l)if(l.value!==void 0){const d=f(l.value,i);Object.defineProperty(t,a,{...l,value:d})}else Object.defineProperty(t,a,l)}return t}const I=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((l,d)=>{const g=I(o[d],h[d]);Object.keys(g).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=I(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function q(r){return r.entityType==="group"}function B(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.BoundingBox=c.BoundingBox;exports.DIVE=c.DIVE;exports.DIVEAmbientLight=c.DIVEAmbientLight;exports.DIVEClock=c.DIVEClock;exports.DIVEDefaultSettings=c.DIVEDefaultSettings;exports.DIVEEnvironment=c.DIVEEnvironment;exports.DIVEEnvironmentDefaultSettings=c.DIVEEnvironmentDefaultSettings;exports.DIVEFloor=c.DIVEFloor;exports.DIVEGrid=c.DIVEGrid;exports.DIVEGroup=c.DIVEGroup;exports.DIVEModel=c.DIVEModel;exports.DIVENode=c.DIVENode;exports.DIVEPointLight=c.DIVEPointLight;exports.DIVEPrimitive=c.DIVEPrimitive;exports.DIVERenderer=c.DIVERenderer;exports.DIVERendererDefaultSettings=c.DIVERendererDefaultSettings;exports.DIVEResizeManager=c.DIVEResizeManager;exports.DIVERoot=c.DIVERoot;exports.DIVEScene=c.DIVEScene;exports.DIVESceneDefaultSettings=c.DIVESceneDefaultSettings;exports.DIVESceneLight=c.DIVESceneLight;exports.DIVEView=c.DIVEView;exports.FILE_TYPES=c.FILE_TYPES;exports.GRID_MAJOR_LINE_COLOR=c.GRID_MAJOR_LINE_COLOR;exports.GRID_MINOR_LINE_COLOR=c.GRID_MINOR_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=c.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=c.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.DIVEPerspectiveCamera=u.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=u.DIVEPerspectiveCameraDefaultSettings;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.AxesColorBlue=_.AxesColorBlue;exports.AxesColorBlueLetter=_.AxesColorBlueLetter;exports.AxesColorGreen=_.AxesColorGreen;exports.AxesColorGreenLetter=_.AxesColorGreenLetter;exports.AxesColorRed=_.AxesColorRed;exports.AxesColorRedLetter=_.AxesColorRedLetter;exports.findInterface=V.findInterface;exports.implementsInterface=V.implementsInterface;exports.getFileTypeFromUri=y.getFileTypeFromUri;exports.isFileTypeSupported=y.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=A.FileTypeError;exports.ParseError=A.ParseError;exports.isModelSchema=x.isModelSchema;exports.isPovSchema=x.isPovSchema;exports.DIVEGizmo=F;exports.DIVEMath=S;exports.DIVEMovable=U;exports.DIVESelectable=K;exports.applyMixins=X;exports.deepClone=f;exports.getObjectDelta=I;exports.isGroupSchema=q;exports.isLightSchema=B;exports.isPrimitiveSchema=Z;
package/build/dive.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  var S = Object.defineProperty;
2
2
  var A = (r, s, t) => s in r ? S(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
3
  var i = (r, s, t) => A(r, typeof s != "symbol" ? s + "" : s, t);
4
- import { B as ot, b as ht, d as lt, e as ct, D as dt, f as pt, g as ut, h as ft, i as _t, j as gt, k as mt, c as Et, l as Dt, m as wt, n as yt, o as Mt, p as xt, q as It, r as Pt, s as Vt, t as bt, u as Ht, v as zt, w as vt, F as Ot, G as St, x as At, S as Gt, y as Rt } from "./chunks/FileTypes-CUf24rq6.mjs";
5
- import { U as d } from "./chunks/PerspectiveCamera-BFzE2TQU.mjs";
6
- import { C as Yt, b as jt, D as Lt, a as Ct, H as Nt, P as Xt } from "./chunks/PerspectiveCamera-BFzE2TQU.mjs";
4
+ import { B as ot, b as ht, d as lt, e as ct, D as dt, f as pt, g as ut, h as ft, i as _t, j as gt, c as mt, k as Dt, l as Et, m as wt, n as yt, o as Mt, p as xt, q as It, r as Pt, s as Vt, t as bt, u as Ht, F as zt, G as vt, v as Ot, S as St, w as At } from "./chunks/FileTypes-BB4_1gBJ.mjs";
5
+ import { U as d } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
6
+ import { C as Rt, b as Tt, D as Yt, a as jt, H as Lt, P as Ct } from "./chunks/PerspectiveCamera-B5TvUzTa.mjs";
7
7
  import { A as I, a as P, b as V } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
8
- import { e as Zt, d as qt, c as Qt } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
9
- import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as G, CylinderGeometry as E, BoxGeometry as R, PlaneGeometry as w } from "three";
10
- import { f as kt, i as Ut } from "./chunks/findInterface-DbJ5qzbc.mjs";
11
- import { g as Kt, i as Jt } from "./chunks/isFileTypeSupported-zLrD710P.mjs";
12
- import { F as te, N as ee } from "./chunks/network-error-BONfHWQq.mjs";
13
- import { F as se, P as ie } from "./chunks/parse-error-DfOPyLWM.mjs";
14
- import { i as ae, a as oe } from "./chunks/PovSchema-DWWvr_ED.mjs";
8
+ import { e as Xt, d as Ft, c as Zt } from "./chunks/AxisHelperColors-JLBHYQDi.mjs";
9
+ import { Object3D as f, Color as b, Vector3 as c, TorusGeometry as H, MeshBasicMaterial as g, Mesh as p, MathUtils as v, Euler as G, CylinderGeometry as D, BoxGeometry as R, PlaneGeometry as w } from "three/webgpu";
10
+ import { f as Qt, i as Wt } from "./chunks/findInterface-DbJ5qzbc.mjs";
11
+ import { g as Ut, i as Bt } from "./chunks/isFileTypeSupported-D1z0zckw.mjs";
12
+ import { F as Jt, N as $t } from "./chunks/network-error-BONfHWQq.mjs";
13
+ import { F as ee, P as re } from "./chunks/parse-error-DfOPyLWM.mjs";
14
+ import { i as ie, a as ne } from "./chunks/PovSchema-DWWvr_ED.mjs";
15
15
  class y extends f {
16
16
  constructor(t, e, n, o, a) {
17
17
  super();
@@ -34,14 +34,14 @@ class y extends f {
34
34
  });
35
35
  const l = new p(h, this._lineMaterial);
36
36
  l.layers.mask = d, l.renderOrder = 1 / 0, this.add(l);
37
- const _ = new H(e, 0.1, 3, 48, n), D = new g({
37
+ const _ = new H(e, 0.1, 3, 48, n), E = new g({
38
38
  color: 16711935,
39
39
  transparent: !0,
40
40
  opacity: 0.15,
41
41
  depthTest: !1,
42
42
  depthWrite: !1
43
43
  });
44
- this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
44
+ this._colliderMesh = new p(_, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this.add(this._colliderMesh), this.lookAt(o);
45
45
  }
46
46
  set debug(t) {
47
47
  this._colliderMesh.visible = t;
@@ -213,7 +213,7 @@ class M extends f {
213
213
  i(this, "_lineMaterial");
214
214
  i(this, "_colliderMesh");
215
215
  this.name = "DIVEAxisHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._highlight = !1, this._hovered = !1;
216
- const a = new E(0.01, 0.01, e, 13);
216
+ const a = new D(0.01, 0.01, e, 13);
217
217
  this._lineMaterial = new g({
218
218
  color: o,
219
219
  depthTest: !1,
@@ -221,7 +221,7 @@ class M extends f {
221
221
  });
222
222
  const h = new p(a, this._lineMaterial);
223
223
  h.layers.mask = d, h.renderOrder = 1 / 0, h.rotateX(Math.PI / 2), h.translateY(e / 2), this.add(h);
224
- const l = new E(0.1, 0.1, e, 3), _ = new g({
224
+ const l = new D(0.1, 0.1, e, 3), _ = new g({
225
225
  color: 16711935,
226
226
  transparent: !0,
227
227
  opacity: 0.15,
@@ -335,7 +335,7 @@ class x extends f {
335
335
  i(this, "_box");
336
336
  i(this, "_boxSize");
337
337
  this.name = "DIVEScaleHandle", this.axis = t, this._color.set(o), this._colorHover = this._color.clone().multiplyScalar(2), this._hovered = !1, this._highlight = !1, this._boxSize = a;
338
- const h = new E(
338
+ const h = new D(
339
339
  0.01,
340
340
  0.01,
341
341
  e - a / 2,
@@ -351,19 +351,19 @@ class x extends f {
351
351
  new R(a, a, a),
352
352
  this._lineMaterial
353
353
  ), this._box.layers.mask = d, this._box.renderOrder = 1 / 0, this._box.rotateX(Math.PI / 2), this._box.translateY(e - a / 2), this._box.rotateZ(n.x * Math.PI / 2), this._box.rotateX(n.z * Math.PI / 2), this.add(this._box);
354
- const _ = new E(
354
+ const _ = new D(
355
355
  0.1,
356
356
  0.1,
357
357
  e + a / 2,
358
358
  3
359
- ), D = new g({
359
+ ), E = new g({
360
360
  color: 16711935,
361
361
  transparent: !0,
362
362
  opacity: 0.15,
363
363
  depthTest: !1,
364
364
  depthWrite: !1
365
365
  });
366
- this._colliderMesh = new p(_, D), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
366
+ this._colliderMesh = new p(_, E), this._colliderMesh.visible = !1, this._colliderMesh.layers.mask = d, this._colliderMesh.renderOrder = 1 / 0, this._colliderMesh.rotateX(Math.PI / 2), this._colliderMesh.translateY(e / 2), this.add(this._colliderMesh), this.rotateX(n.y * -Math.PI / 2), this.rotateY(n.x * Math.PI / 2);
367
367
  }
368
368
  set debug(t) {
369
369
  this._colliderMesh.visible = t;
@@ -742,65 +742,63 @@ function it(r) {
742
742
  }
743
743
  export {
744
744
  V as AxesColorBlue,
745
- Zt as AxesColorBlueLetter,
745
+ Xt as AxesColorBlueLetter,
746
746
  P as AxesColorGreen,
747
- qt as AxesColorGreenLetter,
747
+ Ft as AxesColorGreenLetter,
748
748
  I as AxesColorRed,
749
- Qt as AxesColorRedLetter,
749
+ Zt as AxesColorRedLetter,
750
750
  ot as BoundingBox,
751
- Yt as COORDINATE_LAYER_MASK,
752
- jt as DEFAULT_LAYER_MASK,
751
+ Rt as COORDINATE_LAYER_MASK,
752
+ Tt as DEFAULT_LAYER_MASK,
753
753
  ht as DIVE,
754
754
  lt as DIVEAmbientLight,
755
755
  ct as DIVEClock,
756
756
  dt as DIVEDefaultSettings,
757
- pt as DIVEEngine,
758
- ut as DIVEEnvironment,
759
- ft as DIVEEnvironmentDefaultSettings,
760
- _t as DIVEFloor,
757
+ pt as DIVEEnvironment,
758
+ ut as DIVEEnvironmentDefaultSettings,
759
+ ft as DIVEFloor,
761
760
  J as DIVEGizmo,
762
- gt as DIVEGrid,
763
- mt as DIVEGroup,
761
+ _t as DIVEGrid,
762
+ gt as DIVEGroup,
764
763
  F as DIVEMath,
765
- Et as DIVEModel,
764
+ mt as DIVEModel,
766
765
  $ as DIVEMovable,
767
766
  Dt as DIVENode,
768
- Lt as DIVEPerspectiveCamera,
769
- Ct as DIVEPerspectiveCameraDefaultSettings,
770
- wt as DIVEPointLight,
771
- yt as DIVEPrimitive,
772
- Mt as DIVERenderPipeline,
773
- xt as DIVERenderer,
774
- It as DIVERendererDefaultSettings,
775
- Pt as DIVEResizeManager,
776
- Vt as DIVERoot,
777
- bt as DIVEScene,
778
- Ht as DIVESceneDefaultSettings,
779
- zt as DIVESceneLight,
767
+ Yt as DIVEPerspectiveCamera,
768
+ jt as DIVEPerspectiveCameraDefaultSettings,
769
+ Et as DIVEPointLight,
770
+ wt as DIVEPrimitive,
771
+ yt as DIVERenderer,
772
+ Mt as DIVERendererDefaultSettings,
773
+ xt as DIVEResizeManager,
774
+ It as DIVERoot,
775
+ Pt as DIVEScene,
776
+ Vt as DIVESceneDefaultSettings,
777
+ bt as DIVESceneLight,
780
778
  tt as DIVESelectable,
781
- vt as DIVEView,
782
- Ot as FILE_TYPES,
783
- te as FileContentError,
784
- se as FileTypeError,
785
- St as GRID_MAJOR_LINE_COLOR,
786
- At as GRID_MINOR_LINE_COLOR,
787
- Nt as HELPER_LAYER_MASK,
788
- ee as NetworkError,
789
- Xt as PRODUCT_LAYER_MASK,
790
- ie as ParseError,
791
- Gt as SUPPORTED_FILE_TYPES,
779
+ Ht as DIVEView,
780
+ zt as FILE_TYPES,
781
+ Jt as FileContentError,
782
+ ee as FileTypeError,
783
+ vt as GRID_MAJOR_LINE_COLOR,
784
+ Ot as GRID_MINOR_LINE_COLOR,
785
+ Lt as HELPER_LAYER_MASK,
786
+ $t as NetworkError,
787
+ Ct as PRODUCT_LAYER_MASK,
788
+ re as ParseError,
789
+ St as SUPPORTED_FILE_TYPES,
792
790
  d as UI_LAYER_MASK,
793
791
  et as applyMixins,
794
792
  m as deepClone,
795
- kt as findInterface,
796
- Rt as findSceneRecursive,
797
- Kt as getFileTypeFromUri,
793
+ Qt as findInterface,
794
+ At as findSceneRecursive,
795
+ Ut as getFileTypeFromUri,
798
796
  z as getObjectDelta,
799
- Ut as implementsInterface,
800
- Jt as isFileTypeSupported,
797
+ Wt as implementsInterface,
798
+ Bt as isFileTypeSupported,
801
799
  rt as isGroupSchema,
802
800
  st as isLightSchema,
803
- ae as isModelSchema,
804
- oe as isPovSchema,
801
+ ie as isModelSchema,
802
+ ne as isPovSchema,
805
803
  it as isPrimitiveSchema
806
804
  };
@@ -1,8 +1,8 @@
1
1
  import { DIVEClock } from './clock/Clock.ts';
2
2
  import { DIVEView } from './view/View.ts';
3
3
  import { DIVEScene, DIVESceneSettings } from './scene/Scene.ts';
4
- import { DIVEPerspectiveCamera, DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts';
5
- import { DIVERenderer, DIVERendererSettings } from './renderer/Renderer.ts';
4
+ import { DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts';
5
+ import { DIVERendererSettings } from './renderer/Renderer.ts';
6
6
  import { OrbitControllerSettings } from '../plugins/orbitcontroller/index.ts';
7
7
  declare global {
8
8
  interface Window {
@@ -56,10 +56,6 @@ export declare const DIVEDefaultSettings: Required<DIVESettings>;
56
56
  * @module
57
57
  */
58
58
  export declare class DIVE {
59
- /**
60
- * @deprecated This static method will be removed in a future version. Please use `import { QuickView, QuickViewSettings, QuickViewDefaultSettings } from '@shopware-ag/dive/quickview'` instead.
61
- */
62
- static QuickView(uri: string, settings?: Partial<import('../plugins/quickview/index.ts').QuickViewSettings>): Promise<import('../plugins/quickview/index.ts').QuickView>;
63
59
  private _instanceId;
64
60
  private _settings;
65
61
  private _views;
@@ -68,37 +64,13 @@ export declare class DIVE {
68
64
  private _clock;
69
65
  private _orientationDisplay;
70
66
  constructor(settings?: Partial<DIVESettings>);
71
- /**
72
- * @deprecated This property will be removed in a future version. Please use properties on the DIVE instance and mainView directly.
73
- */
74
- get engine(): {
75
- scene: DIVEScene;
76
- camera: DIVEPerspectiveCamera;
77
- renderer: DIVERenderer;
78
- setCanvas: (canvas: HTMLCanvasElement) => void;
79
- clock: DIVEClock;
80
- start: () => void;
81
- stop: () => void;
82
- dispose: () => void;
83
- };
84
67
  get views(): DIVEView[];
85
68
  get mainView(): DIVEView;
86
69
  get canvas(): HTMLCanvasElement;
87
70
  get scene(): DIVEScene;
88
71
  get clock(): DIVEClock;
89
72
  start(): void;
73
+ startAsync(): Promise<void>;
90
74
  stop(): void;
91
75
  dispose(): Promise<void>;
92
- /**
93
- * @deprecated This method will be removed in a future version. To create a new view, use `QuickView` instead.
94
- */
95
- createView(camera?: DIVEPerspectiveCamera): DIVEView;
96
- /**
97
- * @deprecated This method will be removed in a future version.
98
- */
99
- disposeView(view: DIVEView): void;
100
76
  }
101
- /**
102
- * @deprecated Use `import { DIVE } from '@shopware-ag/dive'` instead.
103
- */
104
- export declare const DIVEEngine: typeof DIVE;
@@ -1,4 +1,4 @@
1
- import { PerspectiveCamera } from 'three';
1
+ import { PerspectiveCamera } from 'three/webgpu';
2
2
  export type DIVEPerspectiveCameraSettings = {
3
3
  /** Field of view in degrees */
4
4
  fov: number;