@shopware-ag/dive 2.0.1-beta.9 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -9
- package/build/chunks/AssetCache-CiC4wZkh.mjs +79 -0
- package/build/chunks/AssetCache-CuVztq_7.cjs +1 -0
- package/build/chunks/{AssetExporter-Ds2dAfxL.cjs → AssetExporter-DsbC2rqv.cjs} +18 -18
- package/build/chunks/{AssetExporter-CcSkkmZL.mjs → AssetExporter-brT7ogoM.mjs} +3 -4
- package/build/chunks/AssetLoader-DUhBw4FF.cjs +4 -0
- package/build/chunks/{AssetLoader-DjHz5xWK.mjs → AssetLoader-o_4syRGj.mjs} +32 -26
- package/build/chunks/FileTypes-B2VTJIm5.cjs +30 -0
- package/build/chunks/{FileTypes-Cu4s3c_0.mjs → FileTypes-C8pTXmiC.mjs} +155 -205
- package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
- package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
- package/build/chunks/PerspectiveCamera-BByyG5R4.cjs +1 -0
- package/build/chunks/PerspectiveCamera-PMJPzAn3.mjs +34 -0
- package/build/chunks/{SelectTool-w7sF1obN.mjs → SelectTool-6ZRGPwYE.mjs} +4 -4
- package/build/chunks/SelectTool-B1awJ9PA.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-BI7jPKdx.cjs +1 -0
- package/build/chunks/VisibilityLayerMask-CXgt1fJc.mjs +8 -0
- package/build/chunks/package-AmvzOXm_.cjs +1 -0
- package/build/chunks/package-BrpVRfq7.mjs +39 -0
- package/build/chunks/parse-error-DfOPyLWM.mjs +14 -0
- package/build/chunks/parse-error-Dy_EE4rL.cjs +1 -0
- package/build/dive.cjs +1 -1
- package/build/dive.mjs +293 -223
- package/build/plugins/ar/index.cjs +1 -1
- package/build/plugins/ar/index.mjs +2 -2
- package/build/plugins/assetcache/index.cjs +1 -1
- package/build/plugins/assetcache/index.mjs +1 -1
- package/build/plugins/assetexporter/index.cjs +1 -1
- package/build/plugins/assetexporter/index.mjs +1 -1
- package/build/plugins/assetloader/index.cjs +1 -1
- package/build/plugins/assetloader/index.mjs +1 -1
- package/build/plugins/mediacreator/index.cjs +1 -1
- package/build/plugins/mediacreator/index.mjs +13 -13
- package/build/plugins/orbitcontroller/index.cjs +1 -1
- package/build/plugins/orbitcontroller/index.mjs +1 -1
- package/build/plugins/orientationdisplay/index.cjs +1 -0
- package/build/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/plugins/orientationdisplay/index.mjs +5 -0
- package/build/plugins/state/index.cjs +6 -6
- package/build/plugins/state/index.mjs +728 -728
- package/build/plugins/toolbox/index.cjs +1 -1
- package/build/plugins/toolbox/index.mjs +12 -12
- package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
- package/build/src/components/light/AmbientLight.d.ts +3 -1
- package/build/src/components/light/SceneLight.d.ts +3 -1
- package/build/src/core/Dive.d.ts +1 -1
- package/build/src/helpers/deepClone/deepClone.d.ts +34 -0
- package/build/src/helpers/index.d.ts +5 -4
- package/build/src/plugins/ar/src/webxr/raycaster/WebXRRaycaster.d.ts +2 -2
- package/build/src/plugins/ar/src/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +2 -2
- package/build/src/plugins/assetcache/src/cache/AssetCache.d.ts +5 -4
- package/build/src/plugins/assetcache/src/chunk/Chunk.d.ts +4 -7
- package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +7 -0
- package/build/src/plugins/mediacreator/index.d.ts +1 -0
- package/build/src/plugins/mediacreator/src/MediaCreator.d.ts +2 -2
- package/build/src/plugins/mediacreator/types/MediaGenerationById.d.ts +5 -0
- package/build/src/plugins/mediacreator/types/MediaGenerationByPosition.d.ts +7 -0
- package/build/src/plugins/mediacreator/types/MediaGenerationResolution.d.ts +4 -0
- package/build/src/plugins/mediacreator/types/index.d.ts +3 -0
- package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +17 -2
- package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
- package/build/src/plugins/{axiscamera/src/AxisCamera.d.ts → orientationdisplay/src/OrientationDisplay.d.ts} +5 -5
- package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
- package/build/src/plugins/state/src/actions/action.d.ts +4 -4
- package/build/src/plugins/state/src/actions/media/generatemedia.d.ts +2 -18
- package/build/src/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +2 -2
- package/build/src/plugins/state/types/index.d.ts +2 -0
- package/build/src/plugins/toolbox/index.d.ts +1 -0
- package/build/src/plugins/toolbox/src/Toolbox.d.ts +2 -2
- package/build/src/plugins/toolbox/src/transform/TransformTool.d.ts +1 -1
- package/build/src/plugins/toolbox/types/ToolType.d.ts +1 -0
- package/build/src/plugins/toolbox/types/index.d.ts +1 -0
- package/package.json +7 -9
- package/build/chunks/AssetCache-CWeKL4PT.cjs +0 -1
- package/build/chunks/AssetCache-Y5G3mQU1.mjs +0 -84
- package/build/chunks/AssetLoader-CMKzMJ1u.cjs +0 -4
- package/build/chunks/FileTypes-CKOjpHjz.cjs +0 -30
- package/build/chunks/OrbitController-D-WNei2f.mjs +0 -940
- package/build/chunks/OrbitController-rMX8EHvJ.cjs +0 -1
- package/build/chunks/PerspectiveCamera-CONx93im.cjs +0 -1
- package/build/chunks/PerspectiveCamera-DUiWJJIj.mjs +0 -38
- package/build/chunks/SelectTool-BD6Ccy_2.cjs +0 -1
- package/build/chunks/file-type-error-BsK7IJt7.cjs +0 -1
- package/build/chunks/file-type-error-aWHfMumr.mjs +0 -8
- package/build/chunks/package-DXbIn_zz.mjs +0 -39
- package/build/chunks/package-DaKgG9tF.cjs +0 -1
- package/build/chunks/parse-error-IryNa_oq.mjs +0 -8
- package/build/chunks/parse-error-m5cNt1UV.cjs +0 -1
- package/build/plugins/axiscamera/index.cjs +0 -1
- package/build/plugins/axiscamera/index.d.ts +0 -2
- package/build/plugins/axiscamera/index.mjs +0 -4
- package/build/src/plugins/axiscamera/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var r=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var r=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var l=(t,e,o)=>r(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../chunks/SelectTool-B1awJ9PA.cjs");class i{constructor(e,o){l(this,"_scene");l(this,"_controller");l(this,"_activeTool");l(this,"_selectTool");this._scene=e,this._controller=o,this._selectTool=null,this._activeTool=null}get selectTool(){return this._selectTool||(this._selectTool=new n.DIVESelectTool(this._scene,this._controller)),this._selectTool}dispose(){this.removeEventListeners()}getActiveTool(){return this._activeTool}useTool(e){var o;switch((o=this._activeTool)==null||o.deactivate(),e){case"select":{this.addEventListeners(),this.selectTool.activate(),this._activeTool=this.selectTool;break}case"none":{this.removeEventListeners(),this._activeTool=null;break}default:console.warn(`DIVEToolBox.useTool: Unknown tool: ${e}`)}}setGizmoMode(e){this.selectTool.setGizmoMode(e)}setGizmoVisible(e){this.selectTool.setGizmoVisible(e)}setGizmoScaleLinked(e){this.selectTool.setGizmoScaleLinked(e)}onPointerMove(e){var o;(o=this._activeTool)==null||o.onPointerMove(e)}onPointerDown(e){var o;(o=this._activeTool)==null||o.onPointerDown(e)}onPointerUp(e){var o;(o=this._activeTool)==null||o.onPointerUp(e)}onWheel(e){var o;(o=this._activeTool)==null||o.onWheel(e)}addEventListeners(){this._controller.domElement.addEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.addEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.addEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.addEventListener("wheel",e=>this.onWheel(e))}removeEventListeners(){this._controller.domElement.removeEventListener("pointermove",e=>this.onPointerMove(e)),this._controller.domElement.removeEventListener("pointerdown",e=>this.onPointerDown(e)),this._controller.domElement.removeEventListener("pointerup",e=>this.onPointerUp(e)),this._controller.domElement.removeEventListener("wheel",e=>this.onWheel(e))}}l(i,"DefaultTool","select");exports.DIVEBaseTool=n.DIVEBaseTool;exports.DIVESelectTool=n.DIVESelectTool;exports.DIVETransformTool=n.DIVETransformTool;exports.isSelectTool=n.isSelectTool;exports.isTransformTool=n.isTransformTool;exports.Toolbox=i;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var s = (t, e, o) => e in t ?
|
|
3
|
-
var
|
|
4
|
-
import { D as l } from "../../chunks/SelectTool-
|
|
5
|
-
import { a as m, c as T, i as d, b as _ } from "../../chunks/SelectTool-
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var s = (t, e, o) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var n = (t, e, o) => s(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { D as l } from "../../chunks/SelectTool-6ZRGPwYE.mjs";
|
|
5
|
+
import { a as m, c as T, i as d, b as _ } from "../../chunks/SelectTool-6ZRGPwYE.mjs";
|
|
6
6
|
class r {
|
|
7
7
|
constructor(e, o) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
n(this, "_scene");
|
|
9
|
+
n(this, "_controller");
|
|
10
|
+
n(this, "_activeTool");
|
|
11
|
+
n(this, "_selectTool");
|
|
12
12
|
this._scene = e, this._controller = o, this._selectTool = null, this._activeTool = null;
|
|
13
13
|
}
|
|
14
14
|
get selectTool() {
|
|
@@ -41,8 +41,8 @@ class r {
|
|
|
41
41
|
setGizmoMode(e) {
|
|
42
42
|
this.selectTool.setGizmoMode(e);
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
this.selectTool.
|
|
44
|
+
setGizmoVisible(e) {
|
|
45
|
+
this.selectTool.setGizmoVisible(e);
|
|
46
46
|
}
|
|
47
47
|
setGizmoScaleLinked(e) {
|
|
48
48
|
this.selectTool.setGizmoScaleLinked(e);
|
|
@@ -94,7 +94,7 @@ class r {
|
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
n(r, "DefaultTool", "select");
|
|
98
98
|
export {
|
|
99
99
|
m as DIVEBaseTool,
|
|
100
100
|
l as DIVESelectTool,
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Box3, Object3D, Sphere, Vector3, ColorRepresentation } from 'three';
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { Color, Object3D } from 'three';
|
|
2
|
+
import { DIVESelectable } from '../../index.ts';
|
|
2
3
|
/**
|
|
3
4
|
* A basic ambient light.
|
|
4
5
|
*
|
|
@@ -6,9 +7,10 @@ import { Color, Object3D } from 'three';
|
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
|
-
export declare class DIVEAmbientLight extends Object3D {
|
|
10
|
+
export declare class DIVEAmbientLight extends Object3D implements DIVESelectable {
|
|
10
11
|
readonly isDIVELight: true;
|
|
11
12
|
readonly isDIVEAmbientLight: true;
|
|
13
|
+
readonly isSelectable: true;
|
|
12
14
|
private _light;
|
|
13
15
|
constructor();
|
|
14
16
|
setColor(color: Color): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DIVESelectable } from '../../index.ts';
|
|
1
2
|
import { Color, Object3D } from 'three';
|
|
2
3
|
/**
|
|
3
4
|
* A complex scene light.
|
|
@@ -6,9 +7,10 @@ import { Color, Object3D } from 'three';
|
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
|
-
export declare class DIVESceneLight extends Object3D {
|
|
10
|
+
export declare class DIVESceneLight extends Object3D implements DIVESelectable {
|
|
10
11
|
readonly isDIVELight: true;
|
|
11
12
|
readonly isDIVESceneLight: true;
|
|
13
|
+
readonly isSelectable: true;
|
|
12
14
|
private _hemiLight;
|
|
13
15
|
private _dirLight;
|
|
14
16
|
constructor();
|
package/build/src/core/Dive.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class DIVE {
|
|
|
50
50
|
get engine(): DIVEEngine;
|
|
51
51
|
private _engine;
|
|
52
52
|
private orbitController;
|
|
53
|
-
private
|
|
53
|
+
private orientationDisplay;
|
|
54
54
|
get canvas(): HTMLCanvasElement;
|
|
55
55
|
setCanvas(canvas: HTMLCanvasElement): void;
|
|
56
56
|
constructor(settings?: Partial<DIVESettings>);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive deep clone function that handles class instances, methods, and circular references
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // Cloning a simple object
|
|
7
|
+
* const obj = { a: 1, b: { c: 2 } };
|
|
8
|
+
* const cloned = deepClone(obj);
|
|
9
|
+
*
|
|
10
|
+
* // Cloning a class instance
|
|
11
|
+
* class MyClass {
|
|
12
|
+
* constructor(public value: number) {}
|
|
13
|
+
* getValue() { return this.value; }
|
|
14
|
+
* }
|
|
15
|
+
* const instance = new MyClass(42);
|
|
16
|
+
* const clonedInstance = deepClone(instance);
|
|
17
|
+
* console.log(clonedInstance.getValue()); // 42
|
|
18
|
+
*
|
|
19
|
+
* // Cloning Three.js Object3D (uses native .clone() method)
|
|
20
|
+
* const object3D = new Object3D();
|
|
21
|
+
* const clonedObject3D = deepClone(object3D);
|
|
22
|
+
*
|
|
23
|
+
* // Handles circular references
|
|
24
|
+
* const circular: any = { name: 'test' };
|
|
25
|
+
* circular.self = circular;
|
|
26
|
+
* const clonedCircular = deepClone(circular); // Won't cause infinite recursion
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param obj - The object to clone
|
|
30
|
+
* @param visited - Internal WeakMap for tracking circular references
|
|
31
|
+
* @returns A deep clone of the input object
|
|
32
|
+
*/
|
|
33
|
+
declare function deepClone<T>(obj: T, visited?: WeakMap<WeakKey, any>): T;
|
|
34
|
+
export { deepClone };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './applyMixins/applyMixins.ts';
|
|
2
|
+
export * from './deepClone/deepClone.ts';
|
|
3
|
+
export * from './findInterface/findInterface.ts';
|
|
3
4
|
export * from './findSceneRecursive/findSceneRecursive.ts';
|
|
5
|
+
export * from './getFileTypeFromUri/getFileTypeFromUri.ts';
|
|
4
6
|
export * from './getObjectDelta/getObjectDelta.ts';
|
|
5
7
|
export * from './implementsInterface/implementsInterface.ts';
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './applyMixins/applyMixins.ts';
|
|
8
|
+
export * from './isFileTypeSupported/isFileTypeSupported.ts';
|
|
8
9
|
export * from './math/index.ts';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Matrix4, Mesh, Vector3 } from 'three';
|
|
2
2
|
import { DIVERenderPipeline } from '../../../../../engine/renderer/Renderer.ts';
|
|
3
3
|
import { DIVEScene } from '../../../../../engine/scene/Scene.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { EventDispatcher } from '../../../../../events/index.ts';
|
|
5
5
|
/**
|
|
6
6
|
* object is undefined when AR world is hit.
|
|
7
7
|
*/
|
|
@@ -20,7 +20,7 @@ export type DIVEWebXRRaycasterEvents = {
|
|
|
20
20
|
};
|
|
21
21
|
SCENE_HIT_LOST: undefined;
|
|
22
22
|
};
|
|
23
|
-
export declare class DIVEWebXRRaycaster extends
|
|
23
|
+
export declare class DIVEWebXRRaycaster extends EventDispatcher<DIVEWebXRRaycasterEvents> {
|
|
24
24
|
private _session;
|
|
25
25
|
private _initialized;
|
|
26
26
|
private _threeRaycaster;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Vector2 } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { EventDispatcher } from '../../../../../events/index.ts';
|
|
3
3
|
export type DIVETouchscreenEvents = {
|
|
4
4
|
TOUCH_START: {
|
|
5
5
|
touches: {
|
|
@@ -41,7 +41,7 @@ export type DIVETouchscreenEvents = {
|
|
|
41
41
|
current: number;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
export declare class DIVEWebXRTouchscreenControls extends
|
|
44
|
+
export declare class DIVEWebXRTouchscreenControls extends EventDispatcher<DIVETouchscreenEvents> {
|
|
45
45
|
private _session;
|
|
46
46
|
private _touchCount;
|
|
47
47
|
private _touches;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Chunk } from '../chunk/Chunk.ts';
|
|
2
2
|
declare class AssetCacheClass {
|
|
3
3
|
private _cache;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
get(): Map<string, Chunk>;
|
|
5
|
+
create(key: string): Chunk;
|
|
6
|
+
write(key: string, chunk: Chunk): void;
|
|
7
|
+
read(key: string): Chunk | null;
|
|
8
|
+
delete(...keys: string[]): void;
|
|
8
9
|
clear(): void;
|
|
9
10
|
}
|
|
10
11
|
export declare const AssetCache: AssetCacheClass;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
export declare class Chunk
|
|
1
|
+
export declare class Chunk {
|
|
2
2
|
private _uri;
|
|
3
|
-
private _parse;
|
|
4
3
|
private _promise;
|
|
5
4
|
private _resolve;
|
|
6
5
|
private _arrayBuffer;
|
|
7
|
-
private _result;
|
|
8
6
|
private _size;
|
|
9
7
|
private _createdAt;
|
|
10
8
|
private _updatedAt;
|
|
11
|
-
get promise(): Promise<
|
|
12
|
-
get result(): T | null;
|
|
9
|
+
get promise(): Promise<ArrayBuffer>;
|
|
13
10
|
get size(): number;
|
|
14
11
|
get createdAt(): Date;
|
|
15
12
|
get updatedAt(): Date;
|
|
16
13
|
get arrayBuffer(): ArrayBuffer | null;
|
|
17
|
-
constructor(_uri: string
|
|
18
|
-
|
|
14
|
+
constructor(_uri: string);
|
|
15
|
+
load(): Promise<ArrayBuffer>;
|
|
19
16
|
}
|
|
@@ -4,4 +4,11 @@ export declare class AssetLoader {
|
|
|
4
4
|
private _usdzLoader;
|
|
5
5
|
constructor();
|
|
6
6
|
load(uri: string): Promise<Object3D>;
|
|
7
|
+
/**
|
|
8
|
+
* parse function for the chunk
|
|
9
|
+
* @param arrayBuffer - the array buffer to parse, will be provided within the chunk
|
|
10
|
+
* @param type - the file type of the array buffer
|
|
11
|
+
* @returns the parsed object, will be stored within the chunk
|
|
12
|
+
*/
|
|
13
|
+
private _parse;
|
|
7
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DIVEScene } from '../../../engine/scene/Scene.ts';
|
|
2
2
|
import { DIVERenderPipeline } from '../../../engine/renderer/Renderer.ts';
|
|
3
3
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { MediaGenerationByPosition } from '../types/index.ts';
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -10,6 +10,6 @@ export declare class MediaCreator {
|
|
|
10
10
|
private _scene;
|
|
11
11
|
private _controller;
|
|
12
12
|
constructor(renderer: DIVERenderPipeline, scene: DIVEScene, controller: OrbitController);
|
|
13
|
-
generateMedia(
|
|
13
|
+
generateMedia(options: MediaGenerationByPosition): string;
|
|
14
14
|
drawCanvas(canvasElement?: HTMLCanvasElement): HTMLCanvasElement;
|
|
15
15
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
2
2
|
import { Vector3Like } from 'three/src/math/Vector3.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Object3D } from 'three/src/core/Object3D.js';
|
|
4
4
|
import { DIVEPerspectiveCamera, DIVETicker } from '../../../index.ts';
|
|
5
|
+
import { BoundingBox } from 'src/components/boundingbox/BoundingBox.ts';
|
|
5
6
|
export type OrbitControllerSettings = {
|
|
6
7
|
/** Whether to enable damping for smooth camera movement */
|
|
7
8
|
enableDamping: boolean;
|
|
@@ -21,10 +22,24 @@ export declare class OrbitController extends OrbitControls implements DIVETicker
|
|
|
21
22
|
object: DIVEPerspectiveCamera;
|
|
22
23
|
constructor(camera: DIVEPerspectiveCamera, domElement: HTMLCanvasElement, settings?: Partial<OrbitControllerSettings>);
|
|
23
24
|
tick(): void;
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Computes the camera position and target to perfectly fit a bounding sphere into the camera's frustum.
|
|
27
|
+
* This robust approach ensures the entire object is always visible, regardless of rotation or aspect ratio.
|
|
28
|
+
*
|
|
29
|
+
* @param bb - The bounding box to encompass
|
|
30
|
+
* @param padding - Optional padding factor to add space around the object depending on the object's bounding sphere diameter (default: 0.0 = no padding)
|
|
31
|
+
* @returns Object containing the calculated camera position and target
|
|
32
|
+
*/
|
|
33
|
+
computeEncompassingView(bb: BoundingBox, padding?: number): {
|
|
25
34
|
position: Vector3Like;
|
|
26
35
|
target: Vector3Like;
|
|
27
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Focus the camera on a specific object by computing its bounding box
|
|
39
|
+
* @param object - The object to focus on
|
|
40
|
+
* @param padding - Optional padding factor to add space around the object depending on the object's bounding sphere diameter (default: 0.0 = no padding)
|
|
41
|
+
*/
|
|
42
|
+
focusOnObject(object: Object3D, padding?: number): void;
|
|
28
43
|
zoomIn(by?: number): void;
|
|
29
44
|
zoomOut(by?: number): void;
|
|
30
45
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Matrix4, OrthographicCamera } from 'three';
|
|
2
1
|
import { DIVERenderPipeline, DIVETicker, DIVEScene, DIVEPerspectiveCamera } from '../../../index.ts';
|
|
3
2
|
/**
|
|
4
3
|
* Shows the scene axes in the bottom left corner of the screen.
|
|
5
4
|
*
|
|
6
5
|
* @module
|
|
7
6
|
*/
|
|
8
|
-
export declare class
|
|
9
|
-
private axesHelper;
|
|
7
|
+
export declare class OrientationDisplay implements DIVETicker {
|
|
10
8
|
private _renderer;
|
|
11
9
|
private _scene;
|
|
12
10
|
private _camera;
|
|
11
|
+
uuid: string;
|
|
12
|
+
private _axes;
|
|
13
|
+
private _orthographicCamera;
|
|
13
14
|
private _restoreViewport;
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(_renderer: DIVERenderPipeline, _scene: DIVEScene, _camera: DIVEPerspectiveCamera);
|
|
15
16
|
tick(): void;
|
|
16
17
|
dispose(): void;
|
|
17
|
-
setFromCameraMatrix(matrix: Matrix4): void;
|
|
18
18
|
}
|
|
@@ -21,7 +21,7 @@ export declare abstract class Action<P = void, D extends Partial<ActionDependenc
|
|
|
21
21
|
/**
|
|
22
22
|
* Factory method to create a new Action class with the specified description and execution logic.
|
|
23
23
|
*
|
|
24
|
-
* @template
|
|
24
|
+
* @template P - The type of the payload (use void for actions without payload)
|
|
25
25
|
* @template D - The type of dependencies
|
|
26
26
|
* @template R - The return type of the action
|
|
27
27
|
* @param options - Configuration options for the action
|
|
@@ -29,8 +29,8 @@ export declare abstract class Action<P = void, D extends Partial<ActionDependenc
|
|
|
29
29
|
* @param options.execute - The function that implements the action's logic
|
|
30
30
|
* @returns A new Action class that can be instantiated with payload and dependencies
|
|
31
31
|
*/
|
|
32
|
-
static define<
|
|
32
|
+
static define<P = void, D extends Partial<ActionDependencies> = Partial<ActionDependencies>, R = void>({ description, execute, }: {
|
|
33
33
|
description: string;
|
|
34
|
-
execute: (payload:
|
|
35
|
-
}): new (payload:
|
|
34
|
+
execute: (payload: P, dependencies: D) => R;
|
|
35
|
+
}): new (payload: P, dependencies: D) => Action<P, D, R>;
|
|
36
36
|
}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { Action } from '../action.ts';
|
|
2
2
|
import { ActionDependencies } from '../../../types/index.ts';
|
|
3
|
-
import {
|
|
4
|
-
export declare const GenerateMediaAction: new (payload:
|
|
5
|
-
position: Vector3Like;
|
|
6
|
-
target: Vector3Like;
|
|
7
|
-
} | {
|
|
8
|
-
id: string;
|
|
9
|
-
}) & {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
}, dependencies: Pick<ActionDependencies, "registered" | "getMediaCreator">) => Action<({
|
|
13
|
-
position: Vector3Like;
|
|
14
|
-
target: Vector3Like;
|
|
15
|
-
} | {
|
|
16
|
-
id: string;
|
|
17
|
-
}) & {
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
}, Pick<ActionDependencies, "registered" | "getMediaCreator">, Promise<string>>;
|
|
3
|
+
import { MediaGenerationByPosition, MediaGenerationById } from '../../../../mediacreator/index.ts';
|
|
4
|
+
export declare const GenerateMediaAction: new (payload: MediaGenerationByPosition | MediaGenerationById, dependencies: Pick<ActionDependencies, "registered" | "getMediaCreator">) => Action<MediaGenerationByPosition | MediaGenerationById, Pick<ActionDependencies, "registered" | "getMediaCreator">, Promise<string>>;
|
|
21
5
|
declare global {
|
|
22
6
|
interface ActionTypes {
|
|
23
7
|
GENERATE_MEDIA: typeof GenerateMediaAction;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Action } from '../action.ts';
|
|
2
2
|
import { ActionDependencies } from '../../../types/index.ts';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const SetGizmoVisibleAction: new (payload: boolean, dependencies: Pick<ActionDependencies, "getToolbox">) => Action<boolean, Pick<ActionDependencies, "getToolbox">, Promise<void>>;
|
|
4
4
|
declare global {
|
|
5
5
|
interface ActionTypes {
|
|
6
|
-
SET_GIZMO_VISIBILITY: typeof
|
|
6
|
+
SET_GIZMO_VISIBILITY: typeof SetGizmoVisibleAction;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { DIVEScene } from '../../../index.ts';
|
|
|
2
2
|
import { DIVEBaseTool } from './BaseTool.ts';
|
|
3
3
|
import { DIVESelectTool } from './select/SelectTool.ts';
|
|
4
4
|
import { OrbitController } from '../../orbitcontroller/index.ts';
|
|
5
|
-
|
|
5
|
+
import { ToolType } from '../types/index.ts';
|
|
6
6
|
export declare class Toolbox {
|
|
7
7
|
static readonly DefaultTool = "select";
|
|
8
8
|
private _scene;
|
|
@@ -15,7 +15,7 @@ export declare class Toolbox {
|
|
|
15
15
|
getActiveTool(): DIVEBaseTool | null;
|
|
16
16
|
useTool(tool: ToolType): void;
|
|
17
17
|
setGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
|
|
18
|
-
|
|
18
|
+
setGizmoVisible(active: boolean): void;
|
|
19
19
|
setGizmoScaleLinked(linked: boolean): void;
|
|
20
20
|
onPointerMove(e: PointerEvent): void;
|
|
21
21
|
onPointerDown(e: PointerEvent): void;
|
|
@@ -17,7 +17,7 @@ export declare class DIVETransformTool extends DIVEBaseTool {
|
|
|
17
17
|
constructor(scene: DIVEScene, controller: OrbitController);
|
|
18
18
|
activate(): void;
|
|
19
19
|
setGizmoMode(mode: 'translate' | 'rotate' | 'scale'): void;
|
|
20
|
-
|
|
20
|
+
setGizmoVisible(visible: boolean): void;
|
|
21
21
|
setGizmoScaleLinked(linked: boolean): void;
|
|
22
22
|
private initGizmo;
|
|
23
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ToolType = 'select' | 'none';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ToolType.ts';
|