@shopware-ag/dive 3.0.11 → 4.0.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 (200) hide show
  1. package/README.md +31 -5
  2. package/build/chunks/{AssetCache-MtISiPD2.cjs → AssetCache-DdxevusY.cjs} +1 -1
  3. package/build/chunks/{AssetCache-DOB996Vk.mjs → AssetCache-MXFCGzZU.mjs} +1 -1
  4. package/build/chunks/AssetExporter-CD2iuQce.mjs +108 -0
  5. package/build/chunks/AssetExporter-CoL-QXkB.cjs +1 -0
  6. package/build/chunks/{AssetLoader-B1n3KGOu.cjs → AssetLoader-BDDJG9JL.cjs} +2 -2
  7. package/build/chunks/{AssetLoader-BY5D3Cvc.mjs → AssetLoader-kRhuVN4p.mjs} +12 -21
  8. package/build/chunks/FileTypes-DGSsi-AX.mjs +2294 -0
  9. package/build/chunks/FileTypes-gD_1MonW.cjs +29 -0
  10. package/build/chunks/ModelComponent-Cj3ff6nL.cjs +1 -0
  11. package/build/chunks/ModelComponent-DkfAgTL0.mjs +87 -0
  12. package/build/chunks/OrbitController-DFPcXvlO.cjs +1 -0
  13. package/build/chunks/OrbitController-DLEyTvUt.mjs +612 -0
  14. package/build/chunks/SpriteTextComponent-ByefJLeU.cjs +1 -0
  15. package/build/chunks/SpriteTextComponent-CG5vfiFy.mjs +83 -0
  16. package/build/chunks/collectAnimations-BgYCN1le.mjs +35 -0
  17. package/build/chunks/collectAnimations-C3HfZHte.cjs +1 -0
  18. package/build/chunks/contributesToBounds-C1mva__U.cjs +1 -0
  19. package/build/chunks/contributesToBounds-DYmHYES4.mjs +14 -0
  20. package/build/chunks/detachTransformControls-2XQrpLN-.cjs +1 -0
  21. package/build/chunks/detachTransformControls-Dr3TIdVy.mjs +209 -0
  22. package/build/chunks/{isFileTypeSupported-C-hfGk-7.mjs → isFileExtensionSupported-CgcqpgqN.mjs} +1 -1
  23. package/build/chunks/{isFileTypeSupported-xoGjHFuz.cjs → isFileExtensionSupported-RvlnH2dr.cjs} +1 -1
  24. package/build/chunks/isVisibleInHierarchy-D9JcLqR5.cjs +1 -0
  25. package/build/chunks/isVisibleInHierarchy-KzVGvDEw.mjs +21 -0
  26. package/build/components/boundingbox/BoundingBoxComponent.d.ts +100 -0
  27. package/build/components/boundingbox/index.d.ts +1 -0
  28. package/build/components/camera/CameraComponent.d.ts +75 -0
  29. package/build/components/camera/index.d.ts +2 -0
  30. package/build/components/camera/perspective/PerspectiveCameraComponent.d.ts +39 -0
  31. package/build/components/grid/GridComponent.d.ts +50 -0
  32. package/build/components/index.d.ts +6 -9
  33. package/build/components/light/LightComponent.d.ts +65 -0
  34. package/build/components/light/ambient/AmbientLightComponent.d.ts +10 -0
  35. package/build/components/light/directional/DirectionalLightComponent.d.ts +23 -0
  36. package/build/components/light/hemi/HemisphereLightComponent.d.ts +21 -0
  37. package/build/components/light/index.d.ts +5 -3
  38. package/build/components/light/point/PointLightComponent.d.ts +26 -0
  39. package/build/components/line/MultiLineComponent.d.ts +133 -0
  40. package/build/components/line/index.d.ts +1 -0
  41. package/build/components/mesh/MeshComponent.d.ts +74 -0
  42. package/build/components/mesh/floor/FloorComponent.d.ts +36 -0
  43. package/build/components/mesh/index.d.ts +4 -0
  44. package/build/components/mesh/model/ModelComponent.d.ts +67 -0
  45. package/build/components/mesh/primitive/PrimitiveComponent.d.ts +43 -0
  46. package/build/components/spritetext/SpriteTextComponent.d.ts +58 -0
  47. package/build/constants/VisibilityLayerMask.d.ts +23 -0
  48. package/build/dive.cjs +1 -1
  49. package/build/dive.mjs +252 -774
  50. package/build/engine/Dive.d.ts +17 -13
  51. package/build/engine/boundingbox/BoundingBox.d.ts +76 -0
  52. package/build/engine/component/Component.d.ts +236 -0
  53. package/build/engine/environment/Environment.d.ts +8 -18
  54. package/build/engine/index.d.ts +4 -1
  55. package/build/engine/node/Node.d.ts +189 -0
  56. package/build/engine/promise/abortable/AbortablePromise.d.ts +8 -0
  57. package/build/engine/renderer/Renderer.d.ts +43 -7
  58. package/build/engine/scene/Scene.d.ts +88 -4
  59. package/build/engine/scene/root/Root.d.ts +29 -0
  60. package/build/engine/scene/xrroot/XRRoot.d.ts +1 -1
  61. package/build/engine/view/View.d.ts +15 -4
  62. package/build/helpers/collectAnimations/collectAnimations.d.ts +23 -0
  63. package/build/helpers/computeProductBounds/computeProductBounds.d.ts +18 -0
  64. package/build/helpers/contributesToBounds/contributesToBounds.d.ts +17 -0
  65. package/build/helpers/detachTransformControls/detachTransformControls.d.ts +15 -0
  66. package/build/helpers/disposeComponents/disposeComponents.d.ts +20 -0
  67. package/build/helpers/findSceneRecursive/findSceneRecursive.d.ts +7 -3
  68. package/build/helpers/implementsInterface/implementsInterface.d.ts +11 -0
  69. package/build/helpers/index.d.ts +6 -1
  70. package/build/helpers/isVisibleInHierarchy/isVisibleInHierarchy.d.ts +12 -0
  71. package/build/index.d.ts +0 -1
  72. package/build/plugins/animation/index.mjs +3 -2
  73. package/build/plugins/animation/src/system/AnimationSystem.d.ts +3 -2
  74. package/build/plugins/ar/index.cjs +1 -1
  75. package/build/plugins/ar/index.mjs +2 -2
  76. package/build/plugins/ar/src/webxr/WebXR.d.ts +7 -0
  77. package/build/plugins/assetcache/index.cjs +1 -1
  78. package/build/plugins/assetcache/index.mjs +1 -1
  79. package/build/plugins/assetexporter/index.cjs +1 -1
  80. package/build/plugins/assetexporter/index.mjs +1 -1
  81. package/build/plugins/assetexporter/src/AssetExporter.d.ts +12 -0
  82. package/build/plugins/assetloader/index.cjs +1 -1
  83. package/build/plugins/assetloader/index.mjs +2 -2
  84. package/build/plugins/mediacreator/index.cjs +1 -1
  85. package/build/plugins/mediacreator/index.mjs +32 -30
  86. package/build/plugins/mediacreator/src/MediaCreator.d.ts +1 -2
  87. package/build/plugins/orbitcontroller/index.cjs +1 -1
  88. package/build/plugins/orbitcontroller/index.d.ts +1 -0
  89. package/build/plugins/orbitcontroller/index.mjs +1 -1
  90. package/build/plugins/orbitcontroller/src/OrbitController.d.ts +39 -6
  91. package/build/plugins/orientationdisplay/index.cjs +1 -1
  92. package/build/plugins/orientationdisplay/index.mjs +41 -33
  93. package/build/plugins/orientationdisplay/src/OrientationDisplay.d.ts +3 -3
  94. package/build/plugins/quickview/index.cjs +1 -1
  95. package/build/plugins/quickview/index.mjs +71 -19
  96. package/build/plugins/quickview/src/QuickView.d.ts +40 -8
  97. package/build/plugins/quickview/types/QuickViewSettings.d.ts +14 -0
  98. package/build/plugins/state/index.cjs +1 -27
  99. package/build/plugins/state/index.mjs +2031 -4135
  100. package/build/plugins/state/src/EngineGateway.d.ts +98 -0
  101. package/build/plugins/state/src/EntityRegistry.d.ts +51 -0
  102. package/build/plugins/state/src/State.d.ts +20 -9
  103. package/build/plugins/state/src/actions/camera/computeencompassingview.d.ts +1 -1
  104. package/build/plugins/state/src/actions/camera/movecamera.d.ts +2 -2
  105. package/build/plugins/state/src/actions/index.d.ts +1 -0
  106. package/build/plugins/state/src/actions/media/generatemedia.d.ts +1 -1
  107. package/build/plugins/state/src/actions/object/addobject.d.ts +2 -3
  108. package/build/plugins/state/src/actions/object/deleteobject.d.ts +3 -4
  109. package/build/plugins/state/src/actions/object/deselectobject.d.ts +3 -4
  110. package/build/plugins/state/src/actions/object/dropit.d.ts +2 -2
  111. package/build/plugins/state/src/actions/object/getallobjects.d.ts +2 -3
  112. package/build/plugins/state/src/actions/object/getobjects.d.ts +3 -4
  113. package/build/plugins/state/src/actions/object/index.d.ts +0 -1
  114. package/build/plugins/state/src/actions/object/modelloaded.d.ts +2 -2
  115. package/build/plugins/state/src/actions/object/selectobject.d.ts +3 -4
  116. package/build/plugins/state/src/actions/object/setparent.d.ts +3 -4
  117. package/build/plugins/state/src/actions/object/updateobject.d.ts +3 -4
  118. package/build/plugins/state/src/actions/renderer/startrender.d.ts +1 -1
  119. package/build/plugins/state/src/actions/scene/exportscene.d.ts +2 -2
  120. package/build/plugins/state/src/actions/scene/index.d.ts +0 -1
  121. package/build/plugins/state/src/actions/scene/setbackground.d.ts +2 -2
  122. package/build/plugins/state/src/actions/scene/updatescene.d.ts +2 -2
  123. package/build/plugins/state/src/actions/state/getstate.d.ts +8 -0
  124. package/build/plugins/state/src/actions/state/index.d.ts +2 -0
  125. package/build/plugins/state/src/actions/state/setstate.d.ts +8 -0
  126. package/build/plugins/state/src/helpers/copyVectors/copyVectors.d.ts +17 -0
  127. package/build/plugins/state/src/helpers/updateParentLink/updateParentLink.d.ts +29 -0
  128. package/build/plugins/state/src/helpers/watchEntity/watchEntity.d.ts +30 -0
  129. package/build/plugins/state/types/ActionTypes.d.ts +18 -3
  130. package/build/plugins/state/types/RegisteredEntity.d.ts +27 -0
  131. package/build/plugins/state/types/{StateSceneData.d.ts → StateData.d.ts} +7 -8
  132. package/build/plugins/state/types/index.d.ts +3 -1
  133. package/build/plugins/state/types/schema/BaseEntitySchema.d.ts +25 -0
  134. package/build/plugins/state/types/schema/CameraSchema.d.ts +18 -0
  135. package/build/plugins/state/types/schema/EntitySchema.d.ts +21 -0
  136. package/build/plugins/state/types/schema/EntityTypeSchema.d.ts +9 -0
  137. package/build/{types → plugins/state/types}/schema/GroupSchema.d.ts +8 -1
  138. package/build/{types → plugins/state/types}/schema/LightSchema.d.ts +16 -0
  139. package/build/plugins/state/types/schema/ModelSchema.d.ts +33 -0
  140. package/build/{types → plugins/state/types}/schema/PrimitiveSchema.d.ts +8 -4
  141. package/build/{types → plugins/state/types}/schema/index.d.ts +1 -4
  142. package/build/plugins/toolbox/index.cjs +1 -1
  143. package/build/plugins/toolbox/index.mjs +194 -150
  144. package/build/plugins/toolbox/src/PointerContext.d.ts +7 -0
  145. package/build/plugins/toolbox/src/SelectionState.d.ts +21 -0
  146. package/build/plugins/toolbox/src/Toolbox.d.ts +9 -2
  147. package/build/{components → plugins/toolbox/src}/gizmo/Gizmo.d.ts +16 -2
  148. package/build/{components → plugins/toolbox/src}/gizmo/handles/AxisHandle.d.ts +2 -3
  149. package/build/{components → plugins/toolbox/src}/gizmo/handles/RadialHandle.d.ts +2 -3
  150. package/build/{components → plugins/toolbox/src}/gizmo/handles/ScaleHandle.d.ts +2 -3
  151. package/build/{components → plugins/toolbox/src}/gizmo/rotate/RotateGizmo.d.ts +2 -2
  152. package/build/{components → plugins/toolbox/src}/gizmo/scale/ScaleGizmo.d.ts +3 -3
  153. package/build/{components → plugins/toolbox/src}/gizmo/translate/TranslateGizmo.d.ts +2 -2
  154. package/build/types/components/DIVESceneObject.d.ts +13 -6
  155. package/build/types/components/index.d.ts +0 -1
  156. package/build/types/events/DIVEComponentEventMap.d.ts +14 -0
  157. package/build/types/events/DIVEEntityEventMap.d.ts +47 -0
  158. package/build/types/events/index.d.ts +2 -0
  159. package/build/types/geometry/DIVEGeometry.d.ts +16 -0
  160. package/build/types/geometry/DIVEGeometryType.d.ts +7 -0
  161. package/build/types/geometry/index.d.ts +2 -0
  162. package/build/types/index.d.ts +3 -1
  163. package/build/types/material/DIVEMaterial.d.ts +21 -0
  164. package/build/types/material/index.d.ts +1 -0
  165. package/package.json +8 -9
  166. package/build/chunks/AssetExporter-Cdxb04b3.cjs +0 -1
  167. package/build/chunks/AssetExporter-DLL_vJae.mjs +0 -67
  168. package/build/chunks/FileTypes-DMTSUCcK.cjs +0 -29
  169. package/build/chunks/FileTypes-DYtXCJQV.mjs +0 -2141
  170. package/build/chunks/PerspectiveCamera-B5TvUzTa.mjs +0 -39
  171. package/build/chunks/PerspectiveCamera-DwQUmkDv.cjs +0 -1
  172. package/build/chunks/PovSchema-Co9FznEz.cjs +0 -1
  173. package/build/chunks/PovSchema-DWWvr_ED.mjs +0 -10
  174. package/build/chunks/findInterface-C6mrvf_t.cjs +0 -1
  175. package/build/chunks/findInterface-DbJ5qzbc.mjs +0 -11
  176. package/build/components/boundingbox/BoundingBox.d.ts +0 -136
  177. package/build/components/floor/Floor.d.ts +0 -14
  178. package/build/components/grid/Grid.d.ts +0 -23
  179. package/build/components/group/Group.d.ts +0 -28
  180. package/build/components/light/AmbientLight.d.ts +0 -19
  181. package/build/components/light/PointLight.d.ts +0 -29
  182. package/build/components/light/SceneLight.d.ts +0 -20
  183. package/build/components/model/Model.d.ts +0 -26
  184. package/build/components/node/Node.d.ts +0 -24
  185. package/build/components/primitive/Primitive.d.ts +0 -27
  186. package/build/components/root/Root.d.ts +0 -34
  187. package/build/engine/camera/PerspectiveCamera.d.ts +0 -24
  188. package/build/helpers/isFileTypeSupported/isFileTypeSupported.d.ts +0 -9
  189. package/build/plugins/state/src/actions/object/placeonfloor.d.ts +0 -12
  190. package/build/plugins/state/src/actions/scene/getallscenedata.d.ts +0 -9
  191. package/build/types/components/DIVELight.d.ts +0 -4
  192. package/build/types/schema/BaseEntitySchema.d.ts +0 -8
  193. package/build/types/schema/EntitySchema.d.ts +0 -11
  194. package/build/types/schema/EntityTypeSchema.d.ts +0 -1
  195. package/build/types/schema/GeometrySchema.d.ts +0 -7
  196. package/build/types/schema/GeometryTypeSchema.d.ts +0 -1
  197. package/build/types/schema/MaterialSchema.d.ts +0 -11
  198. package/build/types/schema/ModelSchema.d.ts +0 -14
  199. package/build/types/schema/PovSchema.d.ts +0 -10
  200. /package/build/{components → plugins/toolbox/src}/gizmo/plane/GizmoPlane.d.ts +0 -0
@@ -1,39 +0,0 @@
1
- var L = Object.defineProperty;
2
- var R = (e, s, a) => s in e ? L(e, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[s] = a;
3
- var r = (e, s, a) => R(e, typeof s != "symbol" ? s + "" : s, a);
4
- import { PerspectiveCamera as n } from "three/webgpu";
5
- const c = 1, K = 2, S = 4, i = 8, A = 16, E = {
6
- fov: 70,
7
- near: 1e-3,
8
- far: 1e3
9
- }, t = class t extends n {
10
- constructor(a = E) {
11
- super(
12
- a.fov || E.fov,
13
- 1,
14
- a.near || E.near,
15
- a.far || E.far
16
- );
17
- r(this, "isDIVEPerspectiveCamera", !0);
18
- r(this, "onSetCameraLayer", () => {
19
- });
20
- this.layers.mask = t.EDITOR_VIEW_LAYER_MASK;
21
- }
22
- onResize(a, o) {
23
- this.aspect = a / o, this.updateProjectionMatrix();
24
- }
25
- setCameraLayer(a) {
26
- this.layers.mask = a === "LIVE" ? t.LIVE_VIEW_LAYER_MASK : t.EDITOR_VIEW_LAYER_MASK, this.onSetCameraLayer(this.layers.mask);
27
- }
28
- };
29
- r(t, "EDITOR_VIEW_LAYER_MASK", c | S | i | A), r(t, "LIVE_VIEW_LAYER_MASK", A);
30
- let _ = t;
31
- export {
32
- K as C,
33
- _ as D,
34
- i as H,
35
- A as P,
36
- S as U,
37
- E as a,
38
- c as b
39
- };
@@ -1 +0,0 @@
1
- "use strict";var o=Object.defineProperty;var i=(A,E,e)=>E in A?o(A,E,{enumerable:!0,configurable:!0,writable:!0,value:e}):A[E]=e;var a=(A,E,e)=>i(A,typeof E!="symbol"?E+"":E,e);const n=require("three/webgpu"),L=1,I=2,R=4,S=8,_=16,s={fov:70,near:.001,far:1e3},t=class t extends n.PerspectiveCamera{constructor(e=s){super(e.fov||s.fov,1,e.near||s.near,e.far||s.far);a(this,"isDIVEPerspectiveCamera",!0);a(this,"onSetCameraLayer",()=>{});this.layers.mask=t.EDITOR_VIEW_LAYER_MASK}onResize(e,c){this.aspect=e/c,this.updateProjectionMatrix()}setCameraLayer(e){this.layers.mask=e==="LIVE"?t.LIVE_VIEW_LAYER_MASK:t.EDITOR_VIEW_LAYER_MASK,this.onSetCameraLayer(this.layers.mask)}};a(t,"EDITOR_VIEW_LAYER_MASK",L|R|S|_),a(t,"LIVE_VIEW_LAYER_MASK",_);let r=t;exports.COORDINATE_LAYER_MASK=I;exports.DEFAULT_LAYER_MASK=L;exports.DIVEPerspectiveCamera=r;exports.DIVEPerspectiveCameraDefaultSettings=s;exports.HELPER_LAYER_MASK=S;exports.PRODUCT_LAYER_MASK=_;exports.UI_LAYER_MASK=R;
@@ -1 +0,0 @@
1
- "use strict";function t(e){return e.entityType==="model"}function i(e){return e.entityType==="pov"}exports.isModelSchema=t;exports.isPovSchema=i;
@@ -1,10 +0,0 @@
1
- function t(e) {
2
- return e.entityType === "model";
3
- }
4
- function n(e) {
5
- return e.entityType === "pov";
6
- }
7
- export {
8
- n as a,
9
- t as i
10
- };
@@ -1 +0,0 @@
1
- "use strict";function r(n,e){return n?e in n:!1}function f(n,e){if(n)return r(n,e)?n:f(n.parent,e)}exports.findInterface=f;exports.implementsInterface=r;
@@ -1,11 +0,0 @@
1
- function e(n, r) {
2
- return n ? r in n : !1;
3
- }
4
- function f(n, r) {
5
- if (n)
6
- return e(n, r) ? n : f(n.parent, r);
7
- }
8
- export {
9
- f,
10
- e as i
11
- };
@@ -1,136 +0,0 @@
1
- import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three/webgpu';
2
- import { DIVENode } from '../node/Node.ts';
3
- /**
4
- * A bounding box component that provides both axis-aligned and oriented bounding boxes
5
- * along with bounding spheres for 3D objects.
6
- *
7
- * The BoundingBox class extends DIVENode and creates visual representations of the
8
- * bounding volumes of 3D objects. It supports two modes:
9
- * - **Axis-aligned bounding box (AABB)**: Aligned with the world coordinate system
10
- * - **Oriented bounding box (OBB)**: Aligned with the object's local coordinate system
11
- *
12
- * The class also automatically computes a bounding sphere that encompasses the entire object.
13
- * Both the bounding box and sphere can be visualized as wireframe helpers.
14
- *
15
- * @example
16
- * ```typescript
17
- * // Create a bounding box for a 3D object
18
- * const mesh = new Mesh(geometry, material);
19
- * const boundingBox = new BoundingBox(mesh, false, 0x00ff00);
20
- *
21
- * // Show the bounding box wireframe
22
- * boundingBox.setBoxHelperVisible(true);
23
- *
24
- * // Access bounding box properties
25
- * console.log('Center:', boundingBox.center);
26
- * console.log('Size:', boundingBox.size);
27
- * console.log('Radius:', boundingBox.radius);
28
- * ```
29
- *
30
- * @example
31
- * ```typescript
32
- * // Create an axis-aligned bounding box
33
- * const aabb = new BoundingBox(mesh, true, 0xff0000);
34
- *
35
- * // Show the bounding sphere wireframe
36
- * aabb.setSphereHelperVisible(true);
37
- * ```
38
- */
39
- export declare class BoundingBox extends DIVENode {
40
- /** The computed bounding box (Box3) */
41
- private _box;
42
- /** The computed bounding sphere (Sphere) */
43
- private _sphere;
44
- /** The center point of the bounding box */
45
- private _center;
46
- /** The radius of the bounding sphere */
47
- private _radius;
48
- /** Visual helper for the bounding box wireframe */
49
- private _boxHelper;
50
- /** Visual helper for the bounding sphere wireframe */
51
- private _sphereHelper;
52
- /** The dimensions (width, height, depth) of the bounding box */
53
- private _size;
54
- /**
55
- * Gets the computed bounding box.
56
- * @returns The Box3 instance representing the bounding box
57
- */
58
- get box(): Box3;
59
- /**
60
- * Gets the computed bounding sphere.
61
- * @returns The Sphere instance representing the bounding sphere
62
- */
63
- get sphere(): Sphere;
64
- /**
65
- * Gets the center point of the bounding box.
66
- * @returns A Vector3 representing the center coordinates
67
- */
68
- get center(): Vector3;
69
- /**
70
- * Gets the radius of the bounding sphere.
71
- * @returns The radius as a number
72
- */
73
- get radius(): number;
74
- /**
75
- * Gets the dimensions of the bounding box.
76
- * @returns A Vector3 representing width, height, and depth
77
- */
78
- get size(): Vector3;
79
- /**
80
- * Creates a new BoundingBox instance for the specified 3D object.
81
- *
82
- * The constructor computes both a bounding box and bounding sphere for the given object.
83
- * It handles complex objects with multiple meshes and nested transformations.
84
- *
85
- * @param object - The 3D object to compute bounding volumes for
86
- * @param axisAligned - Whether to create an axis-aligned bounding box (true) or oriented bounding box (false). Defaults to false.
87
- * @param wireframeColor - The color for the wireframe helpers. Can be a hex number or ColorRepresentation. Defaults to green (0x00ff00).
88
- *
89
- * @example
90
- * ```typescript
91
- * // Create an oriented bounding box (aligned with object's rotation)
92
- * const obb = new BoundingBox(mesh, false, 0x00ff00);
93
- *
94
- * // Create an axis-aligned bounding box (aligned with world coordinates)
95
- * const aabb = new BoundingBox(mesh, true, 0xff0000);
96
- *
97
- * // Use default green color
98
- * const defaultBox = new BoundingBox(mesh);
99
- * ```
100
- */
101
- constructor(object: Object3D, axisAligned?: boolean, wireframeColor?: ColorRepresentation | number);
102
- /**
103
- * Sets the visibility of the bounding box wireframe helper.
104
- *
105
- * @param visible - Whether the box helper should be visible
106
- *
107
- * @example
108
- * ```typescript
109
- * const boundingBox = new BoundingBox(mesh);
110
- *
111
- * // Show the bounding box wireframe
112
- * boundingBox.setBoxHelperVisible(true);
113
- *
114
- * // Hide the bounding box wireframe
115
- * boundingBox.setBoxHelperVisible(false);
116
- * ```
117
- */
118
- setBoxHelperVisible(visible: boolean): void;
119
- /**
120
- * Sets the visibility of the bounding sphere wireframe helper.
121
- *
122
- * @param visible - Whether the sphere helper should be visible
123
- *
124
- * @example
125
- * ```typescript
126
- * const boundingBox = new BoundingBox(mesh);
127
- *
128
- * // Show the bounding sphere wireframe
129
- * boundingBox.setSphereHelperVisible(true);
130
- *
131
- * // Hide the bounding sphere wireframe
132
- * boundingBox.setSphereHelperVisible(false);
133
- * ```
134
- */
135
- setSphereHelperVisible(visible: boolean): void;
136
- }
@@ -1,14 +0,0 @@
1
- import { ColorRepresentation, Mesh } from 'three/webgpu';
2
- /**
3
- * A basic floor geometry.
4
- *
5
- * Can change the color and visibility of the floor.
6
- *
7
- * @module
8
- */
9
- export declare class DIVEFloor extends Mesh {
10
- readonly isDIVEFloor: true;
11
- constructor();
12
- setVisibility(visible: boolean): void;
13
- setColor(color: ColorRepresentation): void;
14
- }
@@ -1,23 +0,0 @@
1
- import { Object3D } from 'three/webgpu';
2
- export interface DIVEGridSettings {
3
- /** Distance between minor grid lines in meters. @default 1 */
4
- gridSize?: number;
5
- /** Draw a thicker major line every N cells. @default 5 */
6
- majorLineEvery?: number;
7
- }
8
- /**
9
- * An infinite shader-based grid that follows the camera.
10
- *
11
- * Draws anti-aliased minor and major grid lines with a radial distance fade.
12
- */
13
- export declare class DIVEGrid extends Object3D {
14
- private _mesh;
15
- private _material;
16
- private _uniforms;
17
- private _gridSize;
18
- constructor(settings?: DIVEGridSettings);
19
- setVisibility(visible: boolean): void;
20
- setGridSize(size: number): void;
21
- setMajorLineEvery(n: number): void;
22
- dispose(): void;
23
- }
@@ -1,28 +0,0 @@
1
- import { Vector3Like, Object3D } from 'three/webgpu';
2
- import { DIVENode } from '../node/Node.ts';
3
- import { DIVESceneObject } from '../../types/index.ts';
4
- export declare class DIVEGroup extends DIVENode {
5
- readonly isDIVEGroup: true;
6
- private _members;
7
- get members(): Object3D[];
8
- private _lines;
9
- constructor();
10
- setPosition(position: Vector3Like): void;
11
- setLinesVisibility(visible: boolean, object?: Object3D): void;
12
- attach(object: DIVESceneObject): this;
13
- /**
14
- * Removes an object from the group.
15
- * @param object - The object to remove.
16
- * @returns The group instance.
17
- */
18
- remove(object: DIVESceneObject): this;
19
- updateLineTo(object: Object3D): void;
20
- /**
21
- * Creates a line for visualization.
22
- */
23
- private createLine;
24
- /**
25
- * Updates a line to the object.
26
- */
27
- private _updateLineTo;
28
- }
@@ -1,19 +0,0 @@
1
- import { Color, Object3D } from 'three/webgpu';
2
- import { DIVESelectable } from '../../index.ts';
3
- /**
4
- * A basic ambient light.
5
- *
6
- * Can change the color, intensity, and visibility of the light.
7
- *
8
- * @module
9
- */
10
- export declare class DIVEAmbientLight extends Object3D implements DIVESelectable {
11
- readonly isDIVELight: true;
12
- readonly isDIVEAmbientLight: true;
13
- readonly isSelectable: true;
14
- private _light;
15
- constructor();
16
- setColor(color: Color): void;
17
- setIntensity(intensity: number): void;
18
- setEnabled(enabled: boolean): void;
19
- }
@@ -1,29 +0,0 @@
1
- import { Color, Object3D } from 'three/webgpu';
2
- import { DIVEMovable } from '../../interfaces/Movable.ts';
3
- import { DIVESelectable } from '../../interfaces/Selectable.ts';
4
- import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
5
- /**
6
- * A basic point light.
7
- *
8
- * Can change the color, intensity, and visibility of the light.
9
- *
10
- * Can be moved and selected.
11
- *
12
- * @module
13
- */
14
- export declare class DIVEPointLight extends Object3D implements DIVESelectable, DIVEMovable {
15
- readonly isDIVELight: true;
16
- readonly isDIVEPointLight: true;
17
- readonly isMovable: true;
18
- readonly isSelectable: true;
19
- gizmo: TransformControls | null;
20
- private light;
21
- private mesh;
22
- constructor();
23
- setColor(color: Color): void;
24
- setIntensity(intensity: number): void;
25
- setEnabled(enabled: boolean): void;
26
- onMove(): void;
27
- onSelect(): void;
28
- onDeselect(): void;
29
- }
@@ -1,20 +0,0 @@
1
- import { DIVESelectable } from '../../index.ts';
2
- import { Color, Object3D } from 'three/webgpu';
3
- /**
4
- * A complex scene light.
5
- *
6
- * Can change the color, intensity, and visibility of the light.
7
- *
8
- * @module
9
- */
10
- export declare class DIVESceneLight extends Object3D implements DIVESelectable {
11
- readonly isDIVELight: true;
12
- readonly isDIVESceneLight: true;
13
- readonly isSelectable: true;
14
- private _hemiLight;
15
- private _dirLight;
16
- constructor();
17
- setColor(color: Color): void;
18
- setIntensity(intensity: number): void;
19
- setEnabled(enabled: boolean): void;
20
- }
@@ -1,26 +0,0 @@
1
- import { Mesh, MeshStandardMaterial, Object3D } from 'three/webgpu';
2
- import { DIVENode } from '../node/Node.ts';
3
- import { MaterialSchema } from 'src/types/index.ts';
4
- /**
5
- * A basic model class.
6
- *
7
- * It does calculate it's own bounding box which is used for positioning on the floor.
8
- *
9
- * Can be moved and selected.
10
- *
11
- * @module
12
- */
13
- export declare class DIVEModel extends DIVENode {
14
- readonly isDIVEModel: true;
15
- protected _gltf: Object3D | null;
16
- protected _mesh: Mesh | null;
17
- protected _material: MeshStandardMaterial | null;
18
- constructor();
19
- private _assetLoader;
20
- private _getAssetLoader;
21
- setFromURL(url: string): Promise<this>;
22
- setFromGLTF(gltf: Object3D): this;
23
- setMaterial(material: Partial<MaterialSchema>): void;
24
- placeOnFloor(): void;
25
- dropIt(): void;
26
- }
@@ -1,24 +0,0 @@
1
- import { Box3, Object3D, Vector3, Vector3Like } from 'three/webgpu';
2
- import { DIVEMovable } from '../../interfaces/Movable.ts';
3
- import { DIVESelectable } from '../../interfaces/Selectable.ts';
4
- import { TransformControls } from 'three/examples/jsm/controls/TransformControls.ts';
5
- export declare class DIVENode extends Object3D implements DIVESelectable, DIVEMovable {
6
- readonly isSelectable: true;
7
- readonly isMovable: true;
8
- readonly isDIVENode: true;
9
- gizmo: TransformControls | null;
10
- protected _positionWorldBuffer: Vector3;
11
- protected _boundingBox: Box3;
12
- constructor();
13
- setPosition(position: Vector3Like): void;
14
- setRotation(rotation: Vector3Like): void;
15
- setScale(scale: Vector3Like): void;
16
- setVisibility(visible: boolean): void;
17
- setToWorldOrigin(): void;
18
- /**
19
- * Can be called when the object is moved from a foreign object (gizmo, parent, etc.) to update the object's position.
20
- */
21
- onMove(): void;
22
- onSelect(): void;
23
- onDeselect(): void;
24
- }
@@ -1,27 +0,0 @@
1
- import { Mesh, MeshStandardMaterial } from 'three/webgpu';
2
- import { DIVEModel } from '../model/Model.ts';
3
- import { GeometrySchema } from '../../types/index.ts';
4
- /**
5
- * A basic model class.
6
- *
7
- * It does calculate it's own bounding box which is used for positioning on the floor.
8
- *
9
- * Can be moved and selected.
10
- *
11
- * @module
12
- */
13
- export declare class DIVEPrimitive extends DIVEModel {
14
- readonly isDIVEPrimitive: true;
15
- protected _mesh: Mesh;
16
- protected _material: MeshStandardMaterial;
17
- constructor();
18
- setGeometry(geometry: GeometrySchema): void;
19
- private assembleGeometry;
20
- private createCylinderGeometry;
21
- private createSphereGeometry;
22
- private createPyramidGeometry;
23
- private createBoxGeometry;
24
- private createConeGeometry;
25
- private createWallGeometry;
26
- private createPlaneGeometry;
27
- }
@@ -1,34 +0,0 @@
1
- import { Box3, Object3D } from 'three/webgpu';
2
- import { EntitySchema, EntityTypeSchema, MinimalSchema, PartialSchema } from '../../index.ts';
3
- import { DIVESceneObject } from '../../types/index.ts';
4
- import { DIVEFloor } from '../floor/Floor.ts';
5
- /**
6
- * A basic scene node to hold grid, floor and all lower level roots.
7
- *
8
- * @module
9
- */
10
- export declare class DIVERoot extends Object3D {
11
- readonly isDIVERoot: true;
12
- get floor(): DIVEFloor;
13
- private _floor;
14
- constructor();
15
- computeSceneBB(): Box3;
16
- getSceneObject<E extends EntityTypeSchema>(object: Partial<EntitySchema> & {
17
- id: string;
18
- entityType: E;
19
- }): DIVESceneObject<E> | undefined;
20
- addSceneObject(object: EntitySchema): DIVESceneObject | undefined;
21
- updateSceneObject(object: PartialSchema): void;
22
- deleteSceneObject(object: MinimalSchema<EntitySchema>): void;
23
- private _updateLight;
24
- private _updateModel;
25
- private _updatePrimitive;
26
- private _updateGroup;
27
- private _deleteLight;
28
- private _deleteModel;
29
- private _deletePrimitive;
30
- private _deleteGroup;
31
- private _setParent;
32
- private _detachTransformControls;
33
- private _findScene;
34
- }
@@ -1,24 +0,0 @@
1
- import { PerspectiveCamera } from 'three/webgpu';
2
- export type DIVEPerspectiveCameraSettings = {
3
- /** Field of view in degrees */
4
- fov: number;
5
- /** Near clipping plane */
6
- near: number;
7
- /** Far clipping plane */
8
- far: number;
9
- };
10
- export declare const DIVEPerspectiveCameraDefaultSettings: Required<DIVEPerspectiveCameraSettings>;
11
- /**
12
- * A Perspective camera. Can change the layer mask to show different objects.
13
- *
14
- * @module
15
- */
16
- export declare class DIVEPerspectiveCamera extends PerspectiveCamera {
17
- readonly isDIVEPerspectiveCamera: true;
18
- static readonly EDITOR_VIEW_LAYER_MASK: number;
19
- static readonly LIVE_VIEW_LAYER_MASK = 16;
20
- onSetCameraLayer: (mask: number) => void;
21
- constructor(settings?: Partial<DIVEPerspectiveCameraSettings>);
22
- onResize(width: number, height: number): void;
23
- setCameraLayer(layer: 'LIVE' | 'EDITOR'): void;
24
- }
@@ -1,9 +0,0 @@
1
- import { FileType } from '../../types/file/index.ts';
2
- /**
3
- * Checks if a file extension is supported
4
- * @param extension The file extension to check
5
- * @returns True if the extension is supported, false otherwise
6
- *
7
- * @deprecated Use isFileExtensionSupported instead
8
- */
9
- export declare function isFileTypeSupported(extension: string): extension is FileType;
@@ -1,12 +0,0 @@
1
- import { Action } from '../action.ts';
2
- import { ActionDependencies } from '../../../types/index.ts';
3
- export declare const PlaceOnFloorAction: new (payload: {
4
- id: string;
5
- }, dependencies: Pick<ActionDependencies, "registered" | "engine">) => Action<{
6
- id: string;
7
- }, Pick<ActionDependencies, "registered" | "engine">, void>;
8
- declare global {
9
- interface ActionTypes {
10
- PLACE_ON_FLOOR: typeof PlaceOnFloorAction;
11
- }
12
- }
@@ -1,9 +0,0 @@
1
- import { Action } from '../action.ts';
2
- import { ActionDependencies } from '../../../types/index.ts';
3
- import { StateSceneData } from '../../../types/StateSceneData.ts';
4
- export declare const GetAllSceneDataAction: new (payload: object, dependencies: Pick<ActionDependencies, "registered" | "engine" | "controller">) => Action<object, Pick<ActionDependencies, "registered" | "engine" | "controller">, StateSceneData>;
5
- declare global {
6
- interface ActionTypes {
7
- GET_ALL_SCENE_DATA: typeof GetAllSceneDataAction;
8
- }
9
- }
@@ -1,4 +0,0 @@
1
- import { DIVEAmbientLight } from '../../components/light/AmbientLight.ts';
2
- import { DIVEPointLight } from '../../components/light/PointLight.ts';
3
- import { DIVESceneLight } from '../../components/light/SceneLight.ts';
4
- export type DIVELight = DIVEAmbientLight | DIVEPointLight | DIVESceneLight;
@@ -1,8 +0,0 @@
1
- import { EntityTypeSchema } from './EntityTypeSchema.ts';
2
- export type BaseEntitySchema = {
3
- id: string;
4
- name: string;
5
- entityType: EntityTypeSchema;
6
- visible: boolean;
7
- parentId?: string | null;
8
- };
@@ -1,11 +0,0 @@
1
- import { PovSchema } from './PovSchema.ts';
2
- import { LightSchema } from './LightSchema.ts';
3
- import { ModelSchema } from './ModelSchema.ts';
4
- import { PrimitiveSchema } from './PrimitiveSchema.ts';
5
- import { GroupSchema } from './GroupSchema.ts';
6
- export type MinimalSchema<T extends EntitySchema> = T extends EntitySchema ? {
7
- id: string;
8
- entityType: T['entityType'];
9
- } : never;
10
- export type PartialSchema<T extends EntitySchema | void = void> = T extends EntitySchema ? MinimalSchema<T> & Partial<T> : MinimalSchema<EntitySchema> & Partial<EntitySchema>;
11
- export type EntitySchema = PovSchema | LightSchema | ModelSchema | PrimitiveSchema | GroupSchema;
@@ -1 +0,0 @@
1
- export type EntityTypeSchema = 'pov' | 'light' | 'model' | 'primitive' | 'group';
@@ -1,7 +0,0 @@
1
- import { GeometryTypeSchema } from './GeometryTypeSchema.ts';
2
- export type GeometrySchema = {
3
- name: GeometryTypeSchema;
4
- width: number;
5
- height: number;
6
- depth: number;
7
- };
@@ -1 +0,0 @@
1
- export type GeometryTypeSchema = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
@@ -1,11 +0,0 @@
1
- import { Texture } from 'three/webgpu';
2
- export type MaterialSchema = {
3
- vertexColors: boolean;
4
- color: string | number;
5
- map: Texture | null;
6
- normalMap: Texture | null;
7
- roughness: number;
8
- roughnessMap: Texture | null;
9
- metalness: number;
10
- metalnessMap: Texture | null;
11
- };
@@ -1,14 +0,0 @@
1
- import { Vector3Like } from 'three/webgpu';
2
- import { MaterialSchema } from './MaterialSchema.ts';
3
- import { BaseEntitySchema } from './BaseEntitySchema.ts';
4
- import { EntitySchema } from './EntitySchema.ts';
5
- export declare function isModelSchema(entity: EntitySchema): entity is ModelSchema;
6
- export type ModelSchema = BaseEntitySchema & {
7
- entityType: 'model';
8
- uri: string;
9
- position: Vector3Like;
10
- rotation: Vector3Like;
11
- scale: Vector3Like;
12
- loaded: boolean;
13
- material?: Partial<MaterialSchema>;
14
- };
@@ -1,10 +0,0 @@
1
- import { Vector3Like } from 'three/webgpu';
2
- import { BaseEntitySchema } from './BaseEntitySchema.ts';
3
- import { EntitySchema } from './EntitySchema.ts';
4
- export declare function isPovSchema(entity: EntitySchema): entity is PovSchema;
5
- export type PovSchema = BaseEntitySchema & {
6
- entityType: 'pov';
7
- position: Vector3Like;
8
- target: Vector3Like;
9
- locked?: boolean;
10
- };