@shopware-ag/dive 1.15.5 → 1.16.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.
- package/README.md +77 -40
- package/build/dive.cjs +665 -153
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +68 -52
- package/build/dive.d.ts +68 -52
- package/build/dive.js +706 -160
- package/build/dive.js.map +1 -1
- package/package.json +64 -60
- package/src/__test__/DIVE.test.ts +35 -31
- package/src/animation/AnimationSystem.ts +4 -4
- package/src/animation/__test__/AnimationSystem.test.ts +3 -3
- package/src/axiscamera/AxisCamera.ts +31 -11
- package/src/axiscamera/__test__/AxisCamera.test.ts +18 -10
- package/src/camera/PerspectiveCamera.ts +28 -13
- package/src/camera/__test__/PerspectiveCamera.test.ts +2 -2
- package/src/com/Communication.ts +297 -95
- package/src/com/__test__/Communication.test.ts +227 -140
- package/src/com/actions/camera/computeencompassingview.ts +7 -7
- package/src/com/actions/camera/getcameratransform.ts +7 -7
- package/src/com/actions/camera/movecamera.ts +15 -13
- package/src/com/actions/camera/resetcamera.ts +3 -3
- package/src/com/actions/camera/setcameralayer.ts +3 -3
- package/src/com/actions/camera/setcameratransform.ts +7 -7
- package/src/com/actions/camera/zoomcamera.ts +3 -3
- package/src/com/actions/index.ts +52 -50
- package/src/com/actions/media/generatemedia.ts +16 -13
- package/src/com/actions/object/addobject.ts +4 -4
- package/src/com/actions/object/deleteobject.ts +4 -4
- package/src/com/actions/object/deselectobject.ts +4 -4
- package/src/com/actions/object/getallobjects.ts +4 -4
- package/src/com/actions/object/getobjects.ts +4 -4
- package/src/com/actions/object/model/dropit.ts +3 -3
- package/src/com/actions/object/model/modelloaded.ts +3 -3
- package/src/com/actions/object/model/placeonfloor.ts +3 -3
- package/src/com/actions/object/selectobject.ts +4 -4
- package/src/com/actions/object/setparent.ts +7 -7
- package/src/com/actions/object/updateobject.ts +4 -4
- package/src/com/actions/scene/exportscene.ts +6 -0
- package/src/com/actions/scene/getallscenedata.ts +23 -18
- package/src/com/actions/scene/setbackground.ts +3 -3
- package/src/com/actions/scene/updatescene.ts +9 -9
- package/src/com/actions/toolbox/select/setgizmomode.ts +3 -3
- package/src/com/actions/toolbox/transform/setgizmovisible.ts +3 -3
- package/src/com/actions/toolbox/usetool.ts +4 -4
- package/src/com/types/COMBaseEntity.ts +2 -2
- package/src/com/types/COMEntity.ts +6 -6
- package/src/com/types/COMEntityType.ts +1 -1
- package/src/com/types/COMGeometry.ts +2 -2
- package/src/com/types/COMGroup.ts +3 -3
- package/src/com/types/COMLight.ts +3 -3
- package/src/com/types/COMMaterial.ts +2 -2
- package/src/com/types/COMModel.ts +4 -4
- package/src/com/types/COMPov.ts +3 -3
- package/src/com/types/COMPrimitive.ts +5 -5
- package/src/com/types/index.ts +10 -10
- package/src/constant/AxisHelperColors.ts +1 -1
- package/src/constant/GridColors.ts +1 -1
- package/src/controls/OrbitControls.ts +62 -29
- package/src/controls/__test__/OrbitControls.test.ts +133 -39
- package/src/dive.ts +82 -36
- package/src/gizmo/Gizmo.ts +21 -13
- package/src/gizmo/handles/AxisHandle.ts +40 -17
- package/src/gizmo/handles/RadialHandle.ts +39 -15
- package/src/gizmo/handles/ScaleHandle.ts +62 -25
- package/src/gizmo/plane/GizmoPlane.ts +5 -6
- package/src/gizmo/rotate/RotateGizmo.ts +58 -16
- package/src/gizmo/scale/ScaleGizmo.ts +37 -15
- package/src/gizmo/translate/TranslateGizmo.ts +34 -14
- package/src/grid/Grid.ts +13 -5
- package/src/grid/__test__/Grid.test.ts +5 -3
- package/src/group/Group.ts +9 -7
- package/src/group/__test__/Group.test.ts +8 -6
- package/src/helper/applyMixins/__test__/applyMixins.test.ts +9 -6
- package/src/helper/applyMixins/applyMixins.ts +6 -3
- package/src/helper/findInterface/__test__/findInterface.test.ts +28 -18
- package/src/helper/findInterface/findInterface.ts +7 -4
- package/src/helper/findSceneRecursive/__test__/findSceneRecursive.test.ts +1 -1
- package/src/helper/findSceneRecursive/findSceneRecursive.ts +1 -1
- package/src/helper/getObjectDelta/__test__/getObjectDelta.test.ts +43 -7
- package/src/helper/getObjectDelta/getObjectDelta.ts +13 -9
- package/src/helper/isInterface/__test__/implementsInterface.test.ts +1 -1
- package/src/helper/isInterface/implementsInterface.ts +6 -3
- package/src/info/Info.ts +20 -16
- package/src/info/__test__/Info.test.ts +67 -36
- package/src/interface/Draggable.ts +2 -2
- package/src/interface/Hoverable.ts +2 -2
- package/src/interface/Movable.ts +1 -1
- package/src/interface/Rotatable.ts +1 -1
- package/src/interface/Scalable.ts +1 -1
- package/src/io/IO.ts +85 -0
- package/src/io/__test__/IO.test.ts +99 -0
- package/src/io/gltf/GLTFIO.ts +56 -0
- package/src/io/gltf/__test__/GLTFIO.test.ts +185 -0
- package/src/light/PointLight.ts +42 -9
- package/src/light/SceneLight.ts +5 -5
- package/src/light/__test__/AmbientLight.test.ts +5 -4
- package/src/light/__test__/PointLight.test.ts +14 -10
- package/src/light/__test__/SceneLight.test.ts +19 -13
- package/src/loadingmanager/LoadingManager.ts +11 -6
- package/src/loadingmanager/__test__/LoadingManager.test.ts +14 -9
- package/src/math/__test__/DIVEMath.test.ts +1 -1
- package/src/math/ceil/__test__/ceilExp.test.ts +1 -1
- package/src/math/ceil/ceilExp.ts +2 -2
- package/src/math/floor/__test__/floorExp.test.ts +1 -1
- package/src/math/floor/floorExp.ts +2 -2
- package/src/math/helper/__test__/shift.test.ts +1 -1
- package/src/math/helper/shift.ts +1 -1
- package/src/math/index.ts +7 -7
- package/src/math/round/__test__/roundExp.test.ts +1 -1
- package/src/math/round/roundExp.ts +6 -3
- package/src/math/signedAngleTo/__test__/signedAngleTo.test.ts +10 -4
- package/src/math/signedAngleTo/signedAngleTo.ts +11 -4
- package/src/math/toFixed/__test__/toFixedExp.test.ts +9 -9
- package/src/math/toFixed/toFixedExp.ts +6 -3
- package/src/math/truncate/__test__/truncateExp.test.ts +1 -1
- package/src/math/truncate/truncateExp.ts +6 -3
- package/src/mediacreator/MediaCreator.ts +20 -10
- package/src/mediacreator/__test__/MediaCreator.test.ts +27 -12
- package/src/model/Model.ts +35 -7
- package/src/model/__test__/Model.test.ts +71 -44
- package/src/node/Node.ts +34 -12
- package/src/node/__test__/Node.test.ts +17 -13
- package/src/primitive/Primitive.ts +78 -13
- package/src/primitive/__test__/Primitive.test.ts +49 -38
- package/src/primitive/floor/Floor.ts +14 -3
- package/src/primitive/floor/__test__/Floor.test.ts +10 -4
- package/src/renderer/Renderer.ts +46 -15
- package/src/renderer/__test__/Renderer.test.ts +74 -24
- package/src/scene/Scene.ts +9 -3
- package/src/scene/__test__/Scene.test.ts +2 -2
- package/src/scene/root/Root.ts +142 -75
- package/src/scene/root/__test__/Root.test.ts +439 -111
- package/src/toolbox/BaseTool.ts +69 -33
- package/src/toolbox/Toolbox.ts +37 -17
- package/src/toolbox/__test__/BaseTool.test.ts +324 -160
- package/src/toolbox/__test__/Toolbox.test.ts +31 -14
- package/src/toolbox/select/SelectTool.ts +24 -19
- package/src/toolbox/select/__test__/SelectTool.test.ts +95 -59
- package/src/toolbox/transform/TransformTool.ts +40 -17
- package/src/toolbox/transform/__test__/TransformTool.test.ts +22 -15
- package/src/types/SceneObjects.ts +8 -8
- package/src/types/SceneType.ts +14 -0
- package/src/types/index.ts +3 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
2
|
|
|
3
3
|
export default interface COMPUTE_ENCOMPASSING_VIEW {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
position: Vector3Like
|
|
7
|
-
target: Vector3Like
|
|
8
|
-
}
|
|
9
|
-
}
|
|
4
|
+
PAYLOAD: object;
|
|
5
|
+
RETURN: {
|
|
6
|
+
position: Vector3Like;
|
|
7
|
+
target: Vector3Like;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
2
|
|
|
3
3
|
export default interface GET_CAMERA_TRANSFORM {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
position: Vector3Like
|
|
7
|
-
target: Vector3Like
|
|
8
|
-
}
|
|
9
|
-
}
|
|
4
|
+
PAYLOAD: object;
|
|
5
|
+
RETURN: {
|
|
6
|
+
position: Vector3Like;
|
|
7
|
+
target: Vector3Like;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
2
|
|
|
3
3
|
export default interface MOVE_CAMERA {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
4
|
+
PAYLOAD:
|
|
5
|
+
| {
|
|
6
|
+
position: Vector3Like;
|
|
7
|
+
target: Vector3Like;
|
|
8
|
+
locked: boolean;
|
|
9
|
+
duration: number;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
id: string;
|
|
13
|
+
locked: boolean;
|
|
14
|
+
duration: number;
|
|
15
|
+
};
|
|
16
|
+
RETURN: boolean;
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface RESET_CAMERA {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { duration: number };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface SET_CAMERA_LAYER {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { layer: 'LIVE' | 'EDITOR' };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
2
|
|
|
3
3
|
export default interface SET_CAMERA_TRANSFORM {
|
|
4
|
-
|
|
5
|
-
position: Vector3Like
|
|
6
|
-
target: Vector3Like
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
PAYLOAD: {
|
|
5
|
+
position: Vector3Like;
|
|
6
|
+
target: Vector3Like;
|
|
7
|
+
};
|
|
8
|
+
RETURN: boolean;
|
|
9
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface ZOOM_CAMERA {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { direction: 'IN' | 'OUT'; by: number };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
package/src/com/actions/index.ts
CHANGED
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
import SET_BACKGROUND from
|
|
2
|
-
import RESET_CAMERA from
|
|
3
|
-
import SET_CAMERA_LAYER from
|
|
4
|
-
import ZOOM_CAMERA from
|
|
5
|
-
import SET_GIZMO_MODE from
|
|
6
|
-
import SET_CAMERA_TRANSFORM from
|
|
7
|
-
import MOVE_CAMERA from
|
|
8
|
-
import PLACE_ON_FLOOR from
|
|
9
|
-
import GET_ALL_OBJECTS from
|
|
10
|
-
import GET_OBJECTS from
|
|
11
|
-
import ADD_OBJECT from
|
|
12
|
-
import DELETE_OBJECT from
|
|
13
|
-
import UPDATE_OBJECT from
|
|
14
|
-
import MODEL_LOADED from
|
|
15
|
-
import UPDATE_SCENE from
|
|
16
|
-
import GENERATE_MEDIA from
|
|
17
|
-
import GET_ALL_SCENE_DATA from
|
|
18
|
-
import SELECT_OBJECT from
|
|
19
|
-
import DESELECT_OBJECT from
|
|
20
|
-
import GET_CAMERA_TRANSFORM from
|
|
21
|
-
import DROP_IT from
|
|
22
|
-
import SET_GIZMO_VISIBILITY from
|
|
23
|
-
import COMPUTE_ENCOMPASSING_VIEW from
|
|
24
|
-
import USE_TOOL from
|
|
25
|
-
import SET_PARENT from
|
|
1
|
+
import SET_BACKGROUND from './scene/setbackground.ts';
|
|
2
|
+
import RESET_CAMERA from './camera/resetcamera.ts';
|
|
3
|
+
import SET_CAMERA_LAYER from './camera/setcameralayer.ts';
|
|
4
|
+
import ZOOM_CAMERA from './camera/zoomcamera.ts';
|
|
5
|
+
import SET_GIZMO_MODE from './toolbox/select/setgizmomode.ts';
|
|
6
|
+
import SET_CAMERA_TRANSFORM from './camera/setcameratransform.ts';
|
|
7
|
+
import MOVE_CAMERA from './camera/movecamera.ts';
|
|
8
|
+
import PLACE_ON_FLOOR from './object/model/placeonfloor.ts';
|
|
9
|
+
import GET_ALL_OBJECTS from './object/getallobjects.ts';
|
|
10
|
+
import GET_OBJECTS from './object/getobjects.ts';
|
|
11
|
+
import ADD_OBJECT from './object/addobject.ts';
|
|
12
|
+
import DELETE_OBJECT from './object/deleteobject.ts';
|
|
13
|
+
import UPDATE_OBJECT from './object/updateobject.ts';
|
|
14
|
+
import MODEL_LOADED from './object/model/modelloaded.ts';
|
|
15
|
+
import UPDATE_SCENE from './scene/updatescene.ts';
|
|
16
|
+
import GENERATE_MEDIA from './media/generatemedia.ts';
|
|
17
|
+
import GET_ALL_SCENE_DATA from './scene/getallscenedata.ts';
|
|
18
|
+
import SELECT_OBJECT from './object/selectobject.ts';
|
|
19
|
+
import DESELECT_OBJECT from './object/deselectobject.ts';
|
|
20
|
+
import GET_CAMERA_TRANSFORM from './camera/getcameratransform.ts';
|
|
21
|
+
import DROP_IT from './object/model/dropit.ts';
|
|
22
|
+
import SET_GIZMO_VISIBILITY from './toolbox/transform/setgizmovisible.js';
|
|
23
|
+
import COMPUTE_ENCOMPASSING_VIEW from './camera/computeencompassingview.ts';
|
|
24
|
+
import USE_TOOL from './toolbox/usetool.ts';
|
|
25
|
+
import SET_PARENT from './object/setparent.ts';
|
|
26
|
+
import EXPORT_SCENE from './scene/exportscene.ts';
|
|
26
27
|
|
|
27
28
|
export type Actions = {
|
|
28
|
-
GET_ALL_SCENE_DATA: GET_ALL_SCENE_DATA
|
|
29
|
-
GET_ALL_OBJECTS: GET_ALL_OBJECTS
|
|
30
|
-
GET_OBJECTS: GET_OBJECTS
|
|
31
|
-
ADD_OBJECT: ADD_OBJECT
|
|
32
|
-
UPDATE_OBJECT: UPDATE_OBJECT
|
|
33
|
-
DELETE_OBJECT: DELETE_OBJECT
|
|
34
|
-
SELECT_OBJECT: SELECT_OBJECT
|
|
35
|
-
DESELECT_OBJECT: DESELECT_OBJECT
|
|
36
|
-
SET_BACKGROUND: SET_BACKGROUND
|
|
37
|
-
DROP_IT: DROP_IT
|
|
38
|
-
PLACE_ON_FLOOR: PLACE_ON_FLOOR
|
|
39
|
-
SET_CAMERA_TRANSFORM: SET_CAMERA_TRANSFORM
|
|
40
|
-
GET_CAMERA_TRANSFORM: GET_CAMERA_TRANSFORM
|
|
41
|
-
MOVE_CAMERA: MOVE_CAMERA
|
|
42
|
-
RESET_CAMERA: RESET_CAMERA
|
|
43
|
-
COMPUTE_ENCOMPASSING_VIEW: COMPUTE_ENCOMPASSING_VIEW
|
|
44
|
-
SET_CAMERA_LAYER: SET_CAMERA_LAYER
|
|
45
|
-
ZOOM_CAMERA: ZOOM_CAMERA
|
|
46
|
-
SET_GIZMO_MODE: SET_GIZMO_MODE
|
|
47
|
-
SET_GIZMO_VISIBILITY: SET_GIZMO_VISIBILITY
|
|
48
|
-
USE_TOOL: USE_TOOL
|
|
49
|
-
MODEL_LOADED: MODEL_LOADED
|
|
50
|
-
UPDATE_SCENE: UPDATE_SCENE
|
|
51
|
-
GENERATE_MEDIA: GENERATE_MEDIA
|
|
52
|
-
SET_PARENT: SET_PARENT
|
|
29
|
+
GET_ALL_SCENE_DATA: GET_ALL_SCENE_DATA;
|
|
30
|
+
GET_ALL_OBJECTS: GET_ALL_OBJECTS;
|
|
31
|
+
GET_OBJECTS: GET_OBJECTS;
|
|
32
|
+
ADD_OBJECT: ADD_OBJECT;
|
|
33
|
+
UPDATE_OBJECT: UPDATE_OBJECT;
|
|
34
|
+
DELETE_OBJECT: DELETE_OBJECT;
|
|
35
|
+
SELECT_OBJECT: SELECT_OBJECT;
|
|
36
|
+
DESELECT_OBJECT: DESELECT_OBJECT;
|
|
37
|
+
SET_BACKGROUND: SET_BACKGROUND;
|
|
38
|
+
DROP_IT: DROP_IT;
|
|
39
|
+
PLACE_ON_FLOOR: PLACE_ON_FLOOR;
|
|
40
|
+
SET_CAMERA_TRANSFORM: SET_CAMERA_TRANSFORM;
|
|
41
|
+
GET_CAMERA_TRANSFORM: GET_CAMERA_TRANSFORM;
|
|
42
|
+
MOVE_CAMERA: MOVE_CAMERA;
|
|
43
|
+
RESET_CAMERA: RESET_CAMERA;
|
|
44
|
+
COMPUTE_ENCOMPASSING_VIEW: COMPUTE_ENCOMPASSING_VIEW;
|
|
45
|
+
SET_CAMERA_LAYER: SET_CAMERA_LAYER;
|
|
46
|
+
ZOOM_CAMERA: ZOOM_CAMERA;
|
|
47
|
+
SET_GIZMO_MODE: SET_GIZMO_MODE;
|
|
48
|
+
SET_GIZMO_VISIBILITY: SET_GIZMO_VISIBILITY;
|
|
49
|
+
USE_TOOL: USE_TOOL;
|
|
50
|
+
MODEL_LOADED: MODEL_LOADED;
|
|
51
|
+
UPDATE_SCENE: UPDATE_SCENE;
|
|
52
|
+
GENERATE_MEDIA: GENERATE_MEDIA;
|
|
53
|
+
SET_PARENT: SET_PARENT;
|
|
54
|
+
EXPORT_SCENE: EXPORT_SCENE;
|
|
53
55
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
2
|
|
|
3
3
|
export default interface GENERATE_MEDIA {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
PAYLOAD: (
|
|
5
|
+
| {
|
|
6
|
+
position: Vector3Like;
|
|
7
|
+
target: Vector3Like;
|
|
8
|
+
}
|
|
9
|
+
| {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
) & {
|
|
13
|
+
width: number; // image width in pixels
|
|
14
|
+
height: number; // image height in pixels
|
|
15
|
+
dataUri: string;
|
|
16
|
+
};
|
|
17
|
+
RETURN: boolean;
|
|
18
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { COMEntity } from
|
|
1
|
+
import { COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface DELETE_OBJECT {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: Partial<COMEntity> & { id: string };
|
|
5
|
+
RETURN: boolean;
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { COMEntity } from
|
|
1
|
+
import { COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface DESELECT_OBJECT {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: Partial<COMEntity> & { id: string };
|
|
5
|
+
RETURN: boolean;
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { COMEntity } from
|
|
1
|
+
import { COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface GET_ALL_OBJECTS {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: Map<string, COMEntity>;
|
|
5
|
+
RETURN: Map<string, COMEntity>;
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface DROP_IT {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { id: string };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface MODEL_LOADED {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { id: string };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface PLACE_ON_FLOOR {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { id: string };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { COMEntity } from
|
|
1
|
+
import { COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface SELECT_OBJECT {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: Partial<COMEntity> & { id: string };
|
|
5
|
+
RETURN: boolean;
|
|
6
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type COMEntity } from
|
|
1
|
+
import { type COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface SET_PARENT {
|
|
4
|
-
|
|
5
|
-
object: Partial<COMEntity> & { id: string }
|
|
6
|
-
parent: Partial<COMEntity> & { id: string } | null
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
PAYLOAD: {
|
|
5
|
+
object: Partial<COMEntity> & { id: string };
|
|
6
|
+
parent: (Partial<COMEntity> & { id: string }) | null;
|
|
7
|
+
};
|
|
8
|
+
RETURN: boolean;
|
|
9
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { COMEntity } from
|
|
1
|
+
import { COMEntity } from '../../types';
|
|
2
2
|
|
|
3
3
|
export default interface UPDATE_OBJECT {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: Partial<COMEntity> & { id: string };
|
|
5
|
+
RETURN: boolean;
|
|
6
|
+
}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import { Vector3Like } from
|
|
2
|
-
import {
|
|
1
|
+
import { Vector3Like } from 'three';
|
|
2
|
+
import {
|
|
3
|
+
type COMLight,
|
|
4
|
+
type COMModel,
|
|
5
|
+
type COMPov,
|
|
6
|
+
type COMPrimitive,
|
|
7
|
+
} from '../../types';
|
|
3
8
|
|
|
4
9
|
type SceneData = {
|
|
5
|
-
name: string
|
|
6
|
-
mediaItem: null
|
|
7
|
-
backgroundColor: string
|
|
8
|
-
floorEnabled: boolean
|
|
9
|
-
floorColor: string
|
|
10
|
+
name: string;
|
|
11
|
+
mediaItem: null;
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
floorEnabled: boolean;
|
|
14
|
+
floorColor: string;
|
|
10
15
|
userCamera: {
|
|
11
|
-
position: Vector3Like
|
|
12
|
-
target: Vector3Like
|
|
13
|
-
}
|
|
14
|
-
spotmarks: object[]
|
|
15
|
-
lights: COMLight[]
|
|
16
|
-
objects: COMModel[]
|
|
17
|
-
cameras: COMPov[]
|
|
18
|
-
primitives: COMPrimitive[]
|
|
16
|
+
position: Vector3Like;
|
|
17
|
+
target: Vector3Like;
|
|
18
|
+
};
|
|
19
|
+
spotmarks: object[];
|
|
20
|
+
lights: COMLight[];
|
|
21
|
+
objects: COMModel[];
|
|
22
|
+
cameras: COMPov[];
|
|
23
|
+
primitives: COMPrimitive[];
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
export default interface GET_ALL_SCENE_DATA {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
27
|
+
PAYLOAD: object;
|
|
28
|
+
RETURN: SceneData;
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface SET_BACKGROUND {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { color: string | number };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export default interface UPDATE_SCENE {
|
|
2
|
-
|
|
3
|
-
name?: string
|
|
4
|
-
backgroundColor?: string | number
|
|
5
|
-
gridEnabled?: boolean
|
|
6
|
-
floorEnabled?: boolean
|
|
7
|
-
floorColor?: string | number
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
PAYLOAD: {
|
|
3
|
+
name?: string;
|
|
4
|
+
backgroundColor?: string | number;
|
|
5
|
+
gridEnabled?: boolean;
|
|
6
|
+
floorEnabled?: boolean;
|
|
7
|
+
floorColor?: string | number;
|
|
8
|
+
};
|
|
9
|
+
RETURN: boolean;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface SET_GIZMO_MODE {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: { mode: 'translate' | 'rotate' | 'scale' };
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export default interface SET_GIZMO_VISIBILITY {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
PAYLOAD: boolean;
|
|
3
|
+
RETURN: boolean;
|
|
4
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ToolType } from
|
|
1
|
+
import { type ToolType } from '../../../toolbox/Toolbox';
|
|
2
2
|
|
|
3
3
|
export default interface USE_TOOL {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
PAYLOAD: { tool: ToolType };
|
|
5
|
+
RETURN: boolean;
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { COMEntityType } from
|
|
1
|
+
import { COMEntityType } from './COMEntityType';
|
|
2
2
|
|
|
3
3
|
export type COMBaseEntity = {
|
|
4
4
|
id: string;
|
|
@@ -6,4 +6,4 @@ export type COMBaseEntity = {
|
|
|
6
6
|
entityType: COMEntityType;
|
|
7
7
|
visible: boolean;
|
|
8
8
|
parentId?: string | null;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type COMPov } from
|
|
2
|
-
import { type COMLight } from
|
|
3
|
-
import { type COMModel } from
|
|
4
|
-
import { type COMPrimitive } from
|
|
5
|
-
import { type COMGroup } from
|
|
1
|
+
import { type COMPov } from './COMPov';
|
|
2
|
+
import { type COMLight } from './COMLight';
|
|
3
|
+
import { type COMModel } from './COMModel';
|
|
4
|
+
import { type COMPrimitive } from './COMPrimitive';
|
|
5
|
+
import { type COMGroup } from './COMGroup';
|
|
6
6
|
|
|
7
|
-
export type COMEntity = COMPov | COMLight | COMModel | COMPrimitive | COMGroup;
|
|
7
|
+
export type COMEntity = COMPov | COMLight | COMModel | COMPrimitive | COMGroup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type COMEntityType = 'pov' | 'light' | 'model' | 'primitive' | 'group';
|
|
1
|
+
export type COMEntityType = 'pov' | 'light' | 'model' | 'primitive' | 'group';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type Vector3Like } from
|
|
2
|
-
import { type COMBaseEntity } from
|
|
1
|
+
import { type Vector3Like } from 'three';
|
|
2
|
+
import { type COMBaseEntity } from './COMBaseEntity';
|
|
3
3
|
|
|
4
4
|
export type COMGroup = COMBaseEntity & {
|
|
5
5
|
position: Vector3Like;
|
|
6
6
|
rotation: Vector3Like;
|
|
7
7
|
scale: Vector3Like;
|
|
8
8
|
bbVisible?: boolean;
|
|
9
|
-
}
|
|
9
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Vector3Like } from
|
|
2
|
-
import { type COMBaseEntity } from
|
|
1
|
+
import { type Vector3Like } from 'three';
|
|
2
|
+
import { type COMBaseEntity } from './COMBaseEntity';
|
|
3
3
|
|
|
4
4
|
export type COMLight = COMBaseEntity & {
|
|
5
5
|
type: 'ambient' | 'point' | 'scene';
|
|
@@ -7,4 +7,4 @@ export type COMLight = COMBaseEntity & {
|
|
|
7
7
|
color: string | number;
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
position?: Vector3Like;
|
|
10
|
-
};
|
|
10
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Texture } from
|
|
1
|
+
import { type Texture } from 'three';
|
|
2
2
|
|
|
3
3
|
export type COMMaterial = {
|
|
4
4
|
vertexColors: boolean;
|
|
@@ -9,4 +9,4 @@ export type COMMaterial = {
|
|
|
9
9
|
roughnessMap: Texture | null;
|
|
10
10
|
metalness: number;
|
|
11
11
|
metalnessMap: Texture | null;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Vector3Like } from
|
|
2
|
-
import { type COMMaterial } from
|
|
3
|
-
import { type COMBaseEntity } from
|
|
1
|
+
import { type Vector3Like } from 'three';
|
|
2
|
+
import { type COMMaterial } from './COMMaterial';
|
|
3
|
+
import { type COMBaseEntity } from './COMBaseEntity';
|
|
4
4
|
|
|
5
5
|
export type COMModel = COMBaseEntity & {
|
|
6
6
|
uri: string;
|
|
@@ -9,4 +9,4 @@ export type COMModel = COMBaseEntity & {
|
|
|
9
9
|
scale: Vector3Like;
|
|
10
10
|
loaded: boolean;
|
|
11
11
|
material?: Partial<COMMaterial>;
|
|
12
|
-
};
|
|
12
|
+
};
|
package/src/com/types/COMPov.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Vector3Like } from
|
|
2
|
-
import { type COMBaseEntity } from
|
|
1
|
+
import { type Vector3Like } from 'three';
|
|
2
|
+
import { type COMBaseEntity } from './COMBaseEntity';
|
|
3
3
|
|
|
4
4
|
export type COMPov = COMBaseEntity & {
|
|
5
5
|
position: Vector3Like;
|
|
6
6
|
target: Vector3Like;
|
|
7
7
|
locked?: boolean;
|
|
8
|
-
};
|
|
8
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Vector3Like } from
|
|
2
|
-
import { type COMBaseEntity } from
|
|
3
|
-
import { type COMGeometry } from
|
|
4
|
-
import { type COMMaterial } from
|
|
1
|
+
import { type Vector3Like } from 'three';
|
|
2
|
+
import { type COMBaseEntity } from './COMBaseEntity';
|
|
3
|
+
import { type COMGeometry } from './COMGeometry';
|
|
4
|
+
import { type COMMaterial } from './COMMaterial';
|
|
5
5
|
|
|
6
6
|
export type COMPrimitive = COMBaseEntity & {
|
|
7
7
|
position: Vector3Like;
|
|
@@ -9,4 +9,4 @@ export type COMPrimitive = COMBaseEntity & {
|
|
|
9
9
|
scale: Vector3Like;
|
|
10
10
|
geometry: COMGeometry;
|
|
11
11
|
material?: Partial<COMMaterial>;
|
|
12
|
-
};
|
|
12
|
+
};
|