@shopware-ag/dive 1.18.4 → 1.18.5-beta.1

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 (139) hide show
  1. package/build/AR-B6LRgTEL.js +1482 -0
  2. package/build/AR-B6LRgTEL.js.map +1 -0
  3. package/build/AR-YJZL1lm5.cjs +170 -0
  4. package/build/AR-YJZL1lm5.cjs.map +1 -0
  5. package/build/dive-BmDCwQRo.js +24811 -0
  6. package/build/dive-BmDCwQRo.js.map +1 -0
  7. package/build/dive-C-5_QywE.cjs +3857 -0
  8. package/build/dive-C-5_QywE.cjs.map +1 -0
  9. package/build/dive.cjs +2 -4860
  10. package/build/dive.cjs.map +1 -1
  11. package/build/dive.d.ts +6 -1186
  12. package/build/dive.js +7 -4889
  13. package/build/dive.js.map +1 -1
  14. package/build/src/animation/AnimationSystem.d.ts +16 -0
  15. package/build/src/ar/AR.d.ts +21 -0
  16. package/build/src/ar/arquicklook/ARQuickLook.d.ts +8 -0
  17. package/build/src/ar/sceneviewer/SceneViewer.d.ts +7 -0
  18. package/build/src/ar/webxr/WebXR.d.ts +21 -0
  19. package/build/src/ar/webxr/controller/WebXRController.d.ts +46 -0
  20. package/build/src/ar/webxr/crosshair/WebXRCrosshair.d.ts +7 -0
  21. package/build/src/ar/webxr/origin/WebXROrigin.d.ts +31 -0
  22. package/build/src/ar/webxr/overlay/Overlay.d.ts +8 -0
  23. package/build/src/ar/webxr/raycaster/WebXRRaycaster.d.ts +40 -0
  24. package/build/src/ar/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +15 -0
  25. package/build/src/ar/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +12 -0
  26. package/build/src/ar/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +73 -0
  27. package/build/src/axiscamera/AxisCamera.d.ts +18 -0
  28. package/build/src/camera/PerspectiveCamera.d.ts +20 -0
  29. package/build/src/com/Communication.d.ts +77 -0
  30. package/build/src/com/actions/camera/computeencompassingview.d.ts +9 -0
  31. package/build/src/com/actions/camera/getcameratransform.d.ts +9 -0
  32. package/build/src/com/actions/camera/movecamera.d.ts +15 -0
  33. package/build/src/com/actions/camera/resetcamera.d.ts +7 -0
  34. package/build/src/com/actions/camera/setcameralayer.d.ts +7 -0
  35. package/build/src/com/actions/camera/setcameratransform.d.ts +9 -0
  36. package/build/src/com/actions/camera/zoomcamera.d.ts +8 -0
  37. package/build/src/com/actions/index.d.ts +58 -0
  38. package/build/src/com/actions/media/generatemedia.d.ts +15 -0
  39. package/build/src/com/actions/object/addobject.d.ts +6 -0
  40. package/build/src/com/actions/object/deleteobject.d.ts +8 -0
  41. package/build/src/com/actions/object/deselectobject.d.ts +8 -0
  42. package/build/src/com/actions/object/getallobjects.d.ts +6 -0
  43. package/build/src/com/actions/object/getobjects.d.ts +8 -0
  44. package/build/src/com/actions/object/model/dropit.d.ts +7 -0
  45. package/build/src/com/actions/object/model/modelloaded.d.ts +7 -0
  46. package/build/src/com/actions/object/model/placeonfloor.d.ts +7 -0
  47. package/build/src/com/actions/object/selectobject.d.ts +8 -0
  48. package/build/src/com/actions/object/setparent.d.ts +13 -0
  49. package/build/src/com/actions/object/updateobject.d.ts +8 -0
  50. package/build/src/com/actions/scene/exportscene.d.ts +8 -0
  51. package/build/src/com/actions/scene/getallscenedata.d.ts +6 -0
  52. package/build/src/com/actions/scene/launchar.d.ts +6 -0
  53. package/build/src/com/actions/scene/setbackground.d.ts +7 -0
  54. package/build/src/com/actions/scene/updatescene.d.ts +11 -0
  55. package/build/src/com/actions/toolbox/select/setgizmomode.d.ts +7 -0
  56. package/build/src/com/actions/toolbox/transform/setgizmoscalelinked.d.ts +5 -0
  57. package/build/src/com/actions/toolbox/transform/setgizmovisible.d.ts +5 -0
  58. package/build/src/com/actions/toolbox/usetool.d.ts +8 -0
  59. package/build/src/com/types/COMBaseEntity.d.ts +8 -0
  60. package/build/src/com/types/COMEntity.d.ts +6 -0
  61. package/build/src/com/types/COMEntityType.d.ts +1 -0
  62. package/build/src/com/types/COMGeometry.d.ts +7 -0
  63. package/build/src/com/types/COMGeometryType.d.ts +1 -0
  64. package/build/src/com/types/COMGroup.d.ts +8 -0
  65. package/build/src/com/types/COMLight.d.ts +10 -0
  66. package/build/src/com/types/COMMaterial.d.ts +11 -0
  67. package/build/src/com/types/COMModel.d.ts +11 -0
  68. package/build/src/com/types/COMPov.d.ts +7 -0
  69. package/build/src/com/types/COMPrimitive.d.ts +11 -0
  70. package/build/src/com/types/index.d.ts +11 -0
  71. package/build/src/constant/AxisHelperColors.d.ts +6 -0
  72. package/build/src/constant/GridColors.d.ts +2 -0
  73. package/build/src/constant/VisibilityLayerMask.d.ts +5 -0
  74. package/build/src/controls/OrbitControls.d.ts +38 -0
  75. package/build/src/dive.d.ts +64 -0
  76. package/build/src/events/EventExecutor.d.ts +5 -0
  77. package/build/src/exporters/usdz/USDZExporter.d.ts +15 -0
  78. package/build/src/gizmo/Gizmo.d.ts +27 -0
  79. package/build/src/gizmo/handles/AxisHandle.d.ts +30 -0
  80. package/build/src/gizmo/handles/RadialHandle.d.ts +30 -0
  81. package/build/src/gizmo/handles/ScaleHandle.d.ts +33 -0
  82. package/build/src/gizmo/plane/GizmoPlane.d.ts +12 -0
  83. package/build/src/gizmo/rotate/RotateGizmo.d.ts +17 -0
  84. package/build/src/gizmo/scale/ScaleGizmo.d.ts +20 -0
  85. package/build/src/gizmo/translate/TranslateGizmo.d.ts +17 -0
  86. package/build/src/grid/Grid.d.ts +10 -0
  87. package/build/src/group/Group.d.ts +23 -0
  88. package/build/src/helper/applyMixins/applyMixins.d.ts +8 -0
  89. package/build/src/helper/findInterface/findInterface.d.ts +2 -0
  90. package/build/src/helper/findSceneRecursive/findSceneRecursive.d.ts +9 -0
  91. package/build/src/helper/getObjectDelta/getObjectDelta.d.ts +4 -0
  92. package/build/src/helper/isInterface/implementsInterface.d.ts +2 -0
  93. package/build/src/info/Info.d.ts +39 -0
  94. package/build/src/interface/Draggable.d.ts +7 -0
  95. package/build/src/interface/Hoverable.d.ts +7 -0
  96. package/build/src/interface/Movable.d.ts +11 -0
  97. package/build/src/interface/Rotatable.d.ts +9 -0
  98. package/build/src/interface/Scalable.d.ts +9 -0
  99. package/build/src/interface/Selectable.d.ts +10 -0
  100. package/build/src/io/IO.d.ts +10 -0
  101. package/build/src/io/gltf/GLTFIO.d.ts +12 -0
  102. package/build/src/light/AmbientLight.d.ts +17 -0
  103. package/build/src/light/PointLight.d.ts +29 -0
  104. package/build/src/light/SceneLight.d.ts +18 -0
  105. package/build/src/loadingmanager/LoadingManager.d.ts +14 -0
  106. package/build/src/math/ceil/ceilExp.d.ts +1 -0
  107. package/build/src/math/degToRad/degToRad.d.ts +1 -0
  108. package/build/src/math/floor/floorExp.d.ts +1 -0
  109. package/build/src/math/helper/shift.d.ts +1 -0
  110. package/build/src/math/index.d.ts +18 -0
  111. package/build/src/math/radToDeg/radToDeg.d.ts +1 -0
  112. package/build/src/math/round/roundExp.d.ts +1 -0
  113. package/build/src/math/signedAngleTo/signedAngleTo.d.ts +9 -0
  114. package/build/src/math/toFixed/toFixedExp.d.ts +1 -0
  115. package/build/src/math/truncate/truncateExp.d.ts +1 -0
  116. package/build/src/mediacreator/MediaCreator.d.ts +17 -0
  117. package/build/src/model/Model.d.ts +21 -0
  118. package/build/src/node/Node.d.ts +24 -0
  119. package/build/src/primitive/Primitive.d.ts +28 -0
  120. package/build/src/primitive/floor/Floor.d.ts +14 -0
  121. package/build/src/renderer/Renderer.d.ts +69 -0
  122. package/build/src/scene/Scene.d.ts +46 -0
  123. package/build/src/scene/root/Root.d.ts +42 -0
  124. package/build/src/scene/xrroot/XRRoot.d.ts +17 -0
  125. package/build/src/scene/xrroot/xrlightroot/XRLightRoot.d.ts +13 -0
  126. package/build/src/toolbox/BaseTool.d.ts +48 -0
  127. package/build/src/toolbox/Toolbox.d.ts +31 -0
  128. package/build/src/toolbox/select/SelectTool.d.ts +26 -0
  129. package/build/src/toolbox/transform/TransformTool.d.ts +27 -0
  130. package/build/src/types/SceneData.d.ts +19 -0
  131. package/build/src/types/SceneObjects.d.ts +7 -0
  132. package/build/src/types/SceneType.d.ts +4 -0
  133. package/build/src/types/index.d.ts +4 -0
  134. package/package.json +9 -8
  135. package/src/camera/PerspectiveCamera.ts +1 -1
  136. package/src/com/Communication.ts +33 -8
  137. package/src/com/__test__/Communication.test.ts +2 -1
  138. package/src/dive.ts +0 -3
  139. package/build/dive.d.cts +0 -1186
@@ -0,0 +1,8 @@
1
+ import { COMEntity } from '../../types';
2
+ export default interface SELECT_OBJECT {
3
+ DESCRIPTION: 'Selects an existing object.';
4
+ PAYLOAD: Partial<COMEntity> & {
5
+ id: string;
6
+ };
7
+ RETURN: boolean;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { COMEntity } from '../../types';
2
+ export default interface SET_PARENT {
3
+ DESCRIPTION: 'Attach an object to another object.';
4
+ PAYLOAD: {
5
+ object: Partial<COMEntity> & {
6
+ id: string;
7
+ };
8
+ parent: (Partial<COMEntity> & {
9
+ id: string;
10
+ }) | null;
11
+ };
12
+ RETURN: boolean;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { COMEntity } from '../../types';
2
+ export default interface UPDATE_OBJECT {
3
+ DESCRIPTION: 'Updates an existing object.';
4
+ PAYLOAD: Partial<COMEntity> & {
5
+ id: string;
6
+ };
7
+ RETURN: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { DIVESceneFileType } from '../../../types';
2
+ export default interface EXPORT_SCENE {
3
+ DESCRIPTION: 'Exports the current scene to a blob and returns the URL.';
4
+ PAYLOAD: {
5
+ type: keyof DIVESceneFileType;
6
+ };
7
+ RETURN: Promise<string | null>;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { DIVESceneData } from '../../../types';
2
+ export default interface GET_ALL_SCENE_DATA {
3
+ DESCRIPTION: 'Retrieves all current scene data.';
4
+ PAYLOAD: object;
5
+ RETURN: DIVESceneData;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { DIVEAROptions } from '../../../ar/AR';
2
+ export default interface LAUNCH_AR {
3
+ DESCRIPTION: 'Launches AR mode in native capabilities. (iOS: AR Quick Look, Android: Google Scene Viewer)';
4
+ PAYLOAD?: DIVEAROptions;
5
+ RETURN: Promise<void>;
6
+ }
@@ -0,0 +1,7 @@
1
+ export default interface SET_BACKGROUND {
2
+ DESCRIPTION: 'Set the background color of the scene.';
3
+ PAYLOAD: {
4
+ color: string | number;
5
+ };
6
+ RETURN: boolean;
7
+ }
@@ -0,0 +1,11 @@
1
+ export default interface UPDATE_SCENE {
2
+ DESCRIPTION: 'Updates global scene data.';
3
+ PAYLOAD: {
4
+ name?: string;
5
+ backgroundColor?: string | number;
6
+ gridEnabled?: boolean;
7
+ floorEnabled?: boolean;
8
+ floorColor?: string | number;
9
+ };
10
+ RETURN: boolean;
11
+ }
@@ -0,0 +1,7 @@
1
+ export default interface SET_GIZMO_MODE {
2
+ DESCRIPTION: "Sets the gizmo's mode.";
3
+ PAYLOAD: {
4
+ mode: 'translate' | 'rotate' | 'scale';
5
+ };
6
+ RETURN: boolean;
7
+ }
@@ -0,0 +1,5 @@
1
+ export default interface SET_GIZMO_SCALE_LINKED {
2
+ DESCRIPTION: "Sets the gizmo's unified scale mode.";
3
+ PAYLOAD: boolean;
4
+ RETURN: boolean;
5
+ }
@@ -0,0 +1,5 @@
1
+ export default interface SET_GIZMO_VISIBILITY {
2
+ DESCRIPTION: "Sets the gizmo's visibility.";
3
+ PAYLOAD: boolean;
4
+ RETURN: boolean;
5
+ }
@@ -0,0 +1,8 @@
1
+ import { ToolType } from '../../../toolbox/Toolbox';
2
+ export default interface USE_TOOL {
3
+ DESCRIPTION: 'Activates a specific tool from the toolbox.';
4
+ PAYLOAD: {
5
+ tool: ToolType;
6
+ };
7
+ RETURN: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { COMEntityType } from './COMEntityType';
2
+ export type COMBaseEntity = {
3
+ id: string;
4
+ name: string;
5
+ entityType: COMEntityType;
6
+ visible: boolean;
7
+ parentId?: string | null;
8
+ };
@@ -0,0 +1,6 @@
1
+ import { COMPov } from './COMPov';
2
+ import { COMLight } from './COMLight';
3
+ import { COMModel } from './COMModel';
4
+ import { COMPrimitive } from './COMPrimitive';
5
+ import { COMGroup } from './COMGroup';
6
+ export type COMEntity = COMPov | COMLight | COMModel | COMPrimitive | COMGroup;
@@ -0,0 +1 @@
1
+ export type COMEntityType = 'pov' | 'light' | 'model' | 'primitive' | 'group';
@@ -0,0 +1,7 @@
1
+ import { COMGeometryType } from './COMGeometryType';
2
+ export type COMGeometry = {
3
+ name: COMGeometryType;
4
+ width: number;
5
+ height: number;
6
+ depth: number;
7
+ };
@@ -0,0 +1 @@
1
+ export type COMGeometryType = 'cylinder' | 'sphere' | 'pyramid' | 'cube' | 'box' | 'cone' | 'wall' | 'plane';
@@ -0,0 +1,8 @@
1
+ import { Vector3Like } from 'three';
2
+ import { COMBaseEntity } from './COMBaseEntity';
3
+ export type COMGroup = COMBaseEntity & {
4
+ position: Vector3Like;
5
+ rotation: Vector3Like;
6
+ scale: Vector3Like;
7
+ bbVisible?: boolean;
8
+ };
@@ -0,0 +1,10 @@
1
+ import { Vector3Like } from 'three';
2
+ import { COMBaseEntity } from './COMBaseEntity';
3
+ export type COMLight = COMBaseEntity & {
4
+ type: 'ambient' | 'point' | 'scene';
5
+ intensity: number;
6
+ color: string | number;
7
+ enabled: boolean;
8
+ position?: Vector3Like;
9
+ rotation?: Vector3Like;
10
+ };
@@ -0,0 +1,11 @@
1
+ import { Texture } from 'three';
2
+ export type COMMaterial = {
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
+ };
@@ -0,0 +1,11 @@
1
+ import { Vector3Like } from 'three';
2
+ import { COMMaterial } from './COMMaterial';
3
+ import { COMBaseEntity } from './COMBaseEntity';
4
+ export type COMModel = COMBaseEntity & {
5
+ uri: string;
6
+ position: Vector3Like;
7
+ rotation: Vector3Like;
8
+ scale: Vector3Like;
9
+ loaded: boolean;
10
+ material?: Partial<COMMaterial>;
11
+ };
@@ -0,0 +1,7 @@
1
+ import { Vector3Like } from 'three';
2
+ import { COMBaseEntity } from './COMBaseEntity';
3
+ export type COMPov = COMBaseEntity & {
4
+ position: Vector3Like;
5
+ target: Vector3Like;
6
+ locked?: boolean;
7
+ };
@@ -0,0 +1,11 @@
1
+ import { Vector3Like } from 'three';
2
+ import { COMBaseEntity } from './COMBaseEntity';
3
+ import { COMGeometry } from './COMGeometry';
4
+ import { COMMaterial } from './COMMaterial';
5
+ export type COMPrimitive = COMBaseEntity & {
6
+ position: Vector3Like;
7
+ rotation: Vector3Like;
8
+ scale: Vector3Like;
9
+ geometry: COMGeometry;
10
+ material?: Partial<COMMaterial>;
11
+ };
@@ -0,0 +1,11 @@
1
+ import { COMEntity } from './COMEntity';
2
+ import { COMPrimitive } from './COMPrimitive';
3
+ import { COMModel } from './COMModel';
4
+ import { COMLight } from './COMLight';
5
+ import { COMPov } from './COMPov';
6
+ import { COMGeometry } from './COMGeometry';
7
+ import { COMMaterial } from './COMMaterial';
8
+ import { COMGroup } from './COMGroup';
9
+ import { COMEntityType } from './COMEntityType';
10
+ import { COMGeometryType } from './COMGeometryType';
11
+ export type { COMEntity, COMPrimitive, COMModel, COMLight, COMPov, COMGeometry, COMMaterial, COMGroup, COMEntityType, COMGeometryType, };
@@ -0,0 +1,6 @@
1
+ export declare const AxesColorRedLetter = "#c20017";
2
+ export declare const AxesColorGreenLetter = "#00ab26";
3
+ export declare const AxesColorBlueLetter = "#0081d4";
4
+ export declare const AxesColorRed = "#c20017";
5
+ export declare const AxesColorGreen = "#00ab26";
6
+ export declare const AxesColorBlue = "#0081d4";
@@ -0,0 +1,2 @@
1
+ export declare const GRID_CENTER_LINE_COLOR = "#888888";
2
+ export declare const GRID_SIDE_LINE_COLOR = "#dddddd";
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_LAYER_MASK = 1;
2
+ export declare const COORDINATE_LAYER_MASK = 2;
3
+ export declare const UI_LAYER_MASK = 4;
4
+ export declare const HELPER_LAYER_MASK = 8;
5
+ export declare const PRODUCT_LAYER_MASK = 16;
@@ -0,0 +1,38 @@
1
+ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
2
+ import { default as DIVEPerspectiveCamera } from '../camera/PerspectiveCamera.ts';
3
+ import { DIVERenderer } from '../renderer/Renderer.ts';
4
+ import { Box3, Vector3Like } from 'three';
5
+ import { DIVEAnimationSystem } from '../animation/AnimationSystem.ts';
6
+ export type DIVEOrbitControlsSettings = {
7
+ enableDamping: boolean;
8
+ dampingFactor: number;
9
+ };
10
+ export declare const DIVEOrbitControlsDefaultSettings: DIVEOrbitControlsSettings;
11
+ /**
12
+ * Orbit Controls. Basic functionality to orbit around a given target point in the scene.
13
+ *
14
+ * @module
15
+ */
16
+ export default class DIVEOrbitControls extends OrbitControls {
17
+ static readonly DEFAULT_ZOOM_FACTOR = 1;
18
+ private _animationSystem;
19
+ private last;
20
+ private animating;
21
+ private locked;
22
+ private stopMoveTo;
23
+ private stopRevertLast;
24
+ object: DIVEPerspectiveCamera;
25
+ domElement: HTMLCanvasElement;
26
+ private _removePreRenderCallback;
27
+ constructor(camera: DIVEPerspectiveCamera, renderer: DIVERenderer, animationSystem: DIVEAnimationSystem, settings?: Partial<DIVEOrbitControlsSettings>);
28
+ Dispose(): void;
29
+ ComputeEncompassingView(bb: Box3): {
30
+ position: Vector3Like;
31
+ target: Vector3Like;
32
+ };
33
+ ZoomIn(by?: number): void;
34
+ ZoomOut(by?: number): void;
35
+ MoveTo(pos: Vector3Like | undefined, target: Vector3Like | undefined, duration: number, lock: boolean): void;
36
+ RevertLast(duration: number): void;
37
+ private preRenderCallback;
38
+ }
@@ -0,0 +1,64 @@
1
+ import { DIVERendererSettings } from './renderer/Renderer.ts';
2
+ import { DIVEPerspectiveCameraSettings } from './camera/PerspectiveCamera.ts';
3
+ import { DIVEOrbitControlsSettings } from './controls/OrbitControls.ts';
4
+ import { DIVECommunication } from './com/Communication.ts';
5
+ import { DIVEInfo } from './info/Info.ts';
6
+ export type DIVESettings = {
7
+ autoResize: boolean;
8
+ displayAxes: boolean;
9
+ renderer: Partial<DIVERendererSettings>;
10
+ perspectiveCamera: Partial<DIVEPerspectiveCameraSettings>;
11
+ orbitControls: Partial<DIVEOrbitControlsSettings>;
12
+ };
13
+ export declare const DIVEDefaultSettings: DIVESettings;
14
+ /**
15
+ * #### DIVE
16
+ * is the main class of the DIVE framework.
17
+ *
18
+ * An instance of this class delivers a complete 3D environment with a perspective camera, orbit controls, a toolbox, and a communication system.
19
+ * ```ts
20
+ * import { DIVE } from "@shopware-ag/dive";
21
+ *
22
+ * const myWrapper = document.getElementById('myWrapper');
23
+ *
24
+ * const dive = new DIVE();
25
+ *
26
+ * myWrapper.appendChild(dive.Canvas);
27
+ *
28
+ * dive.Communication.Subscribe('GET_ALL_SCENE_DATA', () => {
29
+ * // do something
30
+ * }));
31
+ *
32
+ * dive.Communication.PerformAction('GET_ALL_SCENE_DATA', {});
33
+ * ```
34
+ * @module
35
+ */
36
+ export default class DIVE {
37
+ static QuickView(uri: string, settings?: Partial<DIVESettings>): DIVE;
38
+ private _settings;
39
+ private _resizeObserverId;
40
+ private _width;
41
+ private _height;
42
+ private renderer;
43
+ private scene;
44
+ private perspectiveCamera;
45
+ private orbitControls;
46
+ private toolbox;
47
+ private communication;
48
+ private animationSystem;
49
+ private axisCamera;
50
+ get Communication(): DIVECommunication;
51
+ get Canvas(): HTMLCanvasElement;
52
+ get Info(): DIVEInfo;
53
+ set Settings(settings: Partial<DIVESettings>);
54
+ constructor(settings?: Partial<DIVESettings>);
55
+ Dispose(): void;
56
+ OnResize(width: number, height: number): void;
57
+ private addResizeObserver;
58
+ private removeResizeObserver;
59
+ }
60
+ export { DIVE, DIVECommunication };
61
+ export * from './math/index.ts';
62
+ export type * from './com/actions/index.ts';
63
+ export type * from './com/types';
64
+ export type * from './types';
@@ -0,0 +1,5 @@
1
+ export declare class DIVEEventExecutor<T> {
2
+ private _listeners;
3
+ Subscribe<S extends keyof T>(type: S, listener: (payload: T[S]) => void): () => boolean;
4
+ protected dispatch<S extends keyof T>(type: S, payload?: T[S]): void;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { Object3D } from 'three';
2
+ import { USDZExporter, USDZExporterOptions } from 'three/examples/jsm/exporters/USDZExporter';
3
+ export type DIVEUSDZExporterOptions = USDZExporterOptions & {
4
+ ar?: {
5
+ anchoring: {
6
+ type: 'plane' | 'image' | 'face' | 'none';
7
+ };
8
+ planeAnchoring: {
9
+ alignment: 'horizontal' | 'vertical' | 'any';
10
+ };
11
+ };
12
+ };
13
+ export declare class DIVEUSDZExporter extends USDZExporter {
14
+ parse(scene: Object3D, options?: DIVEUSDZExporterOptions): Promise<Uint8Array>;
15
+ }
@@ -0,0 +1,27 @@
1
+ import { Euler, Object3D, Vector3 } from 'three';
2
+ import { default as DIVEOrbitControls } from '../controls/OrbitControls';
3
+ import { DIVEGizmoPlane as DIVEGizmoPlane } from './plane/GizmoPlane';
4
+ import { DIVESelectable } from '../interface/Selectable';
5
+ export type DIVEGizmoMode = 'translate' | 'rotate' | 'scale';
6
+ export type DIVEGizmoAxis = 'x' | 'y' | 'z';
7
+ export declare class DIVEGizmo extends Object3D {
8
+ private _mode;
9
+ get mode(): DIVEGizmoMode;
10
+ set mode(value: DIVEGizmoMode);
11
+ set debug(value: boolean);
12
+ private _gizmoNode;
13
+ get gizmoNode(): Object3D;
14
+ private _translateGizmo;
15
+ private _rotateGizmo;
16
+ private _scaleGizmo;
17
+ private _gizmoPlane;
18
+ get gizmoPlane(): DIVEGizmoPlane;
19
+ private _object;
20
+ get object(): (Object3D & DIVESelectable) | null;
21
+ constructor(controller: DIVEOrbitControls);
22
+ attach(object: Object3D & DIVESelectable): this;
23
+ detach(): this;
24
+ onHover(mode: DIVEGizmoMode, axis: DIVEGizmoAxis, value: boolean): void;
25
+ onChange(position?: Vector3, rotation?: Euler, scale?: Vector3): void;
26
+ private assemble;
27
+ }
@@ -0,0 +1,30 @@
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three';
2
+ import { DIVEHoverable } from '../../interface/Hoverable';
3
+ import { DIVETranslateGizmo } from '../translate/TranslateGizmo';
4
+ import { DIVEDraggable } from '../../interface/Draggable';
5
+ import { DraggableEvent } from '../../toolbox/BaseTool';
6
+ export declare class DIVEAxisHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
7
+ readonly isHoverable: true;
8
+ readonly isDraggable: true;
9
+ set debug(value: boolean);
10
+ parent: DIVETranslateGizmo | null;
11
+ axis: 'x' | 'y' | 'z';
12
+ private _color;
13
+ private _colorHover;
14
+ private _hovered;
15
+ private _highlight;
16
+ get highlight(): boolean;
17
+ set highlight(highlight: boolean);
18
+ private _lineMaterial;
19
+ private _colliderMesh;
20
+ get forwardVector(): Vector3;
21
+ get rightVector(): Vector3;
22
+ get upVector(): Vector3;
23
+ constructor(axis: 'x' | 'y' | 'z', length: number, direction: Vector3, color: ColorRepresentation);
24
+ reset(): void;
25
+ onPointerEnter(): void;
26
+ onPointerLeave(): void;
27
+ onDragStart(): void;
28
+ onDrag(e: DraggableEvent): void;
29
+ onDragEnd(): void;
30
+ }
@@ -0,0 +1,30 @@
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three';
2
+ import { DIVEHoverable } from '../../interface/Hoverable';
3
+ import { DraggableEvent } from '../../toolbox/BaseTool';
4
+ import { DIVERotateGizmo } from '../rotate/RotateGizmo';
5
+ import { DIVEDraggable } from '../../interface/Draggable';
6
+ export declare class DIVERadialHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
7
+ readonly isHoverable: true;
8
+ readonly isDraggable: true;
9
+ set debug(value: boolean);
10
+ parent: DIVERotateGizmo | null;
11
+ axis: 'x' | 'y' | 'z';
12
+ private _color;
13
+ private _colorHover;
14
+ private _hovered;
15
+ private _highlight;
16
+ get highlight(): boolean;
17
+ set highlight(highlight: boolean);
18
+ private _lineMaterial;
19
+ private _colliderMesh;
20
+ get forwardVector(): Vector3;
21
+ get rightVector(): Vector3;
22
+ get upVector(): Vector3;
23
+ constructor(axis: 'x' | 'y' | 'z', radius: number, arc: number, direction: Vector3, color: ColorRepresentation);
24
+ reset(): void;
25
+ onPointerEnter(): void;
26
+ onPointerLeave(): void;
27
+ onDragStart(): void;
28
+ onDrag(e: DraggableEvent): void;
29
+ onDragEnd(): void;
30
+ }
@@ -0,0 +1,33 @@
1
+ import { ColorRepresentation, Object3D, Vector3 } from 'three';
2
+ import { DIVEHoverable } from '../../interface/Hoverable';
3
+ import { DIVEScaleGizmo } from '../scale/ScaleGizmo';
4
+ import { DIVEDraggable } from '../../interface/Draggable';
5
+ import { DraggableEvent } from '../../toolbox/BaseTool';
6
+ export declare class DIVEScaleHandle extends Object3D implements DIVEHoverable, DIVEDraggable {
7
+ readonly isHoverable: true;
8
+ readonly isDraggable: true;
9
+ set debug(value: boolean);
10
+ parent: DIVEScaleGizmo | null;
11
+ axis: 'x' | 'y' | 'z';
12
+ private _color;
13
+ private _colorHover;
14
+ private _hovered;
15
+ private _highlight;
16
+ get highlight(): boolean;
17
+ set highlight(highlight: boolean);
18
+ private _lineMaterial;
19
+ private _colliderMesh;
20
+ private _box;
21
+ private _boxSize;
22
+ get forwardVector(): Vector3;
23
+ get rightVector(): Vector3;
24
+ get upVector(): Vector3;
25
+ constructor(axis: 'x' | 'y' | 'z', length: number, direction: Vector3, color: ColorRepresentation, boxSize?: number);
26
+ reset(): void;
27
+ update(scale: Vector3): void;
28
+ onPointerEnter(): void;
29
+ onPointerLeave(): void;
30
+ onDragStart(): void;
31
+ onDrag(e: DraggableEvent): void;
32
+ onDragEnd(): void;
33
+ }
@@ -0,0 +1,12 @@
1
+ import { Mesh, Object3D } from 'three';
2
+ import { DIVEGizmoAxis, DIVEGizmoMode } from '../Gizmo';
3
+ export declare class DIVEGizmoPlane extends Object3D {
4
+ private _meshX;
5
+ get XPlane(): Mesh;
6
+ private _meshY;
7
+ get YPlane(): Mesh;
8
+ private _meshZ;
9
+ get ZPlane(): Mesh;
10
+ constructor();
11
+ assemble(mode: DIVEGizmoMode, axis: DIVEGizmoAxis): void;
12
+ }
@@ -0,0 +1,17 @@
1
+ import { Object3D } from 'three';
2
+ import { default as DIVEOrbitControls } from '../../controls/OrbitControls';
3
+ import { DIVERadialHandle } from '../handles/RadialHandle';
4
+ import { DraggableEvent } from '../../toolbox/BaseTool';
5
+ export declare class DIVERotateGizmo extends Object3D {
6
+ children: DIVERadialHandle[];
7
+ private _controller;
8
+ set debug(value: boolean);
9
+ private _startRot;
10
+ constructor(controller: DIVEOrbitControls);
11
+ reset(): void;
12
+ private handleHighlight;
13
+ onHandleHover(handle: DIVERadialHandle, value: boolean): void;
14
+ onHandleDragStart(handle: DIVERadialHandle): void;
15
+ onHandleDrag(handle: DIVERadialHandle, e: DraggableEvent): void;
16
+ onHandleDragEnd(handle: DIVERadialHandle): void;
17
+ }
@@ -0,0 +1,20 @@
1
+ import { Object3D, Vector3 } from 'three';
2
+ import { DIVEHoverable } from '../../interface/Hoverable';
3
+ import { default as DIVEOrbitControls } from '../../controls/OrbitControls';
4
+ import { DIVEScaleHandle } from '../handles/ScaleHandle';
5
+ import { DraggableEvent } from '../../toolbox/BaseTool';
6
+ export declare class DIVEScaleGizmo extends Object3D implements DIVEHoverable {
7
+ readonly isHoverable: true;
8
+ children: DIVEScaleHandle[];
9
+ private _controller;
10
+ set debug(value: boolean);
11
+ private _startScale;
12
+ constructor(controller: DIVEOrbitControls);
13
+ reset(): void;
14
+ update(scale: Vector3): void;
15
+ private handleHighlight;
16
+ onHoverAxis(handle: DIVEScaleHandle, value: boolean): void;
17
+ onAxisDragStart(handle: DIVEScaleHandle): void;
18
+ onAxisDrag(axis: DIVEScaleHandle, e: DraggableEvent): void;
19
+ onAxisDragEnd(handle: DIVEScaleHandle): void;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { Object3D } from 'three';
2
+ import { default as DIVEOrbitControls } from '../../controls/OrbitControls';
3
+ import { DIVEAxisHandle } from '../handles/AxisHandle';
4
+ import { DraggableEvent } from '../../toolbox/BaseTool';
5
+ export declare class DIVETranslateGizmo extends Object3D {
6
+ private _controller;
7
+ set debug(value: boolean);
8
+ children: DIVEAxisHandle[];
9
+ private _startPos;
10
+ constructor(controller: DIVEOrbitControls);
11
+ reset(): void;
12
+ private handleHighlight;
13
+ onHandleHover(handle: DIVEAxisHandle, value: boolean): void;
14
+ onHandleDragStart(handle: DIVEAxisHandle): void;
15
+ onHandleDrag(handle: DIVEAxisHandle, e: DraggableEvent): void;
16
+ onHandleDragEnd(handle: DIVEAxisHandle): void;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { Object3D } from 'three';
2
+ /**
3
+ * A basic grid for the scene.
4
+ *
5
+ * @module
6
+ */
7
+ export declare class DIVEGrid extends Object3D {
8
+ constructor();
9
+ SetVisibility(visible: boolean): void;
10
+ }
@@ -0,0 +1,23 @@
1
+ import { Vector3Like, Object3D } from 'three';
2
+ import { DIVENode } from '../node/Node';
3
+ import { DIVESceneObject } from '../types';
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
+ remove(object: DIVESceneObject): this;
14
+ UpdateLineTo(object: Object3D): void;
15
+ /**
16
+ * Adds a line to this grouo as last child.
17
+ */
18
+ private createLine;
19
+ /**
20
+ * Updates a line to the object.
21
+ */
22
+ private updateLineTo;
23
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Merges two class prototypes to a new one.
3
+ */
4
+ export declare const applyMixins: (derivedCtor: {
5
+ prototype: object;
6
+ }, constructors: {
7
+ prototype: object;
8
+ }[]) => void;
@@ -0,0 +1,2 @@
1
+ import { Object3D } from 'three';
2
+ export declare function findInterface<T>(object: Object3D | null | undefined, discriminator: string): (Object3D & T) | undefined;
@@ -0,0 +1,9 @@
1
+ import { Object3D } from 'three';
2
+ import { DIVEScene } from '../../scene/Scene';
3
+ /**
4
+ * Find the scene object of an object.
5
+ *
6
+ * @param object - The object to find the scene of.
7
+ * @returns The scene object.
8
+ */
9
+ export declare const findSceneRecursive: (object: Object3D) => DIVEScene;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Find the difference between two objects.
3
+ */
4
+ export declare const getObjectDelta: <T extends object>(a: T, b: Partial<T>) => Partial<T>;
@@ -0,0 +1,2 @@
1
+ import { Object3D } from 'three';
2
+ export declare function implementsInterface<T>(object: Object3D | null | undefined, discriminator: string): object is Object3D & T;