@shopware-ag/dive 1.5.0 → 1.6.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 +38 -25
- package/build/dive.cjs +717 -500
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +174 -113
- package/build/dive.d.ts +174 -113
- package/build/dive.js +716 -486
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/__test__/DIVE.test.ts +66 -22
- package/src/animation/AnimationSystem.ts +16 -0
- package/src/animation/__test__/AnimationSystem.test.ts +23 -2
- package/src/axiscamera/AxisCamera.ts +40 -2
- package/src/axiscamera/__test__/AxisCamera.test.ts +178 -5
- package/src/com/Communication.ts +50 -16
- package/src/com/__test__/Communication.test.ts +73 -24
- package/src/com/actions/camera/computeencompassingview.ts +9 -0
- package/src/com/actions/index.ts +2 -0
- package/src/com/actions/scene/updatescene.ts +1 -0
- package/src/controls/OrbitControls.ts +14 -2
- package/src/controls/__test__/OrbitControls.test.ts +31 -4
- package/src/dive.ts +93 -33
- package/src/grid/Grid.ts +4 -0
- package/src/grid/__test__/Grid.test.ts +7 -0
- package/src/interface/Selectable.ts +17 -0
- package/src/interface/__test__/Interfaces.test.ts +18 -0
- package/src/mediacreator/MediaCreator.ts +2 -2
- package/src/mediacreator/__test__/MediaCreator.test.ts +12 -10
- package/src/model/Model.ts +1 -1
- package/src/model/__test__/Model.test.ts +8 -1
- package/src/renderer/Renderer.ts +7 -1
- package/src/renderer/__test__/Renderer.test.ts +14 -5
- package/src/scene/Scene.ts +8 -2
- package/src/scene/__test__/Scene.test.ts +6 -0
- package/src/scene/root/Root.ts +11 -1
- package/src/scene/root/__test__/Root.test.ts +68 -2
- package/src/toolbox/BaseTool.ts +1 -1
- package/src/toolbox/Toolbox.ts +53 -37
- package/src/toolbox/__test__/BaseTool.test.ts +43 -7
- package/src/toolbox/__test__/Toolbox.test.ts +39 -44
- package/src/toolbox/select/SelectTool.ts +17 -28
- package/src/toolbox/select/__test__/SelectTool.test.ts +21 -12
- package/src/toolbox/transform/TransformTool.ts +7 -1
- package/src/toolbox/transform/__test__/TransformTool.test.ts +22 -5
package/README.md
CHANGED
|
@@ -77,6 +77,18 @@ module.exports = () => {
|
|
|
77
77
|
};
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
# Quick View
|
|
81
|
+
QuickView is used to quickly display your assets with as few lines of code as possible. Simply call the static ``QuickView()`` method (with your data-uri as a parameter) to create an instance of DIVE with your asset to use in further code.
|
|
82
|
+
```ts
|
|
83
|
+
import { DIVE } from '@shopware-ag/dive';
|
|
84
|
+
|
|
85
|
+
const dive = DIVE.QuickView('your/asset/uri.glb'); // <-- call QuickView()
|
|
86
|
+
|
|
87
|
+
const myCanvasWrapper = document.createElement('div');
|
|
88
|
+
myCanvasWrapper.appendChild(dive.Canvas);
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
|
|
80
92
|
# Getting started
|
|
81
93
|
Import:
|
|
82
94
|
```ts
|
|
@@ -159,28 +171,29 @@ unsubscribe(); // <-- execute unsubscribe callback when done
|
|
|
159
171
|
|
|
160
172
|
In the following you find a list of all available actions to perform on DIVECommunication class via `com.PerformAction()`.
|
|
161
173
|
|
|
162
|
-
| Action
|
|
163
|
-
|
|
164
|
-
| [GET_ALL_SCENE_DATA](./src/com/actions/scene/getallscenedata.ts)
|
|
165
|
-
| [GET_ALL_OBJECTS](./src/com/actions/object/getallobjects.ts)
|
|
166
|
-
| [GET_OBJECTS](./src/com/actions/object/getobjects.ts)
|
|
167
|
-
| [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts)
|
|
168
|
-
| [ADD_OBJECT](./src/com/actions/object/addobject.ts)
|
|
169
|
-
| [UPDATE_OBJECT](./src/com/actions/object/updateobject.ts)
|
|
170
|
-
| [DELETE_OBJECT](./src/com/actions/object/deleteobject.ts)
|
|
171
|
-
| [SELECT_OBJECT](./src/com/actions/object/selectobject.ts)
|
|
172
|
-
| [DESELECT_OBJECT](./src/com/actions/object/deselectobject.ts)
|
|
173
|
-
| [SET_BACKGROUND](./src/com/actions/scene/setbackground.ts)
|
|
174
|
-
| [DROP_IT](./src/com/actions/object/model/dropit.ts)
|
|
175
|
-
| [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts)
|
|
176
|
-
| [SET_CAMERA_TRANSFORM](./src/com/actions/camera/setcameratransform.ts)
|
|
177
|
-
| [GET_CAMERA_TRANSFORM](./src/com/actions/camera/getcameratransform.ts)
|
|
178
|
-
| [MOVE_CAMERA](./src/com/actions/camera/movecamera.ts)
|
|
179
|
-
| [RESET_CAMERA](./src/com/actions/camera/resetcamera.ts)
|
|
180
|
-
| [
|
|
181
|
-
| [
|
|
182
|
-
| [
|
|
183
|
-
| [
|
|
184
|
-
| [
|
|
185
|
-
| [
|
|
186
|
-
| [
|
|
174
|
+
| Action | Description
|
|
175
|
+
|:--------------------------------------------------------------------------------------| :---
|
|
176
|
+
| [GET_ALL_SCENE_DATA](./src/com/actions/scene/getallscenedata.ts) | Return all scene data that is currently set
|
|
177
|
+
| [GET_ALL_OBJECTS](./src/com/actions/object/getallobjects.ts) | Return a map of all objects
|
|
178
|
+
| [GET_OBJECTS](./src/com/actions/object/getobjects.ts) | Return an array of all objects with given ids
|
|
179
|
+
| [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts) | Set a model onto to the floor
|
|
180
|
+
| [ADD_OBJECT](./src/com/actions/object/addobject.ts) | Add an object to the scene
|
|
181
|
+
| [UPDATE_OBJECT](./src/com/actions/object/updateobject.ts) | Update an existing object
|
|
182
|
+
| [DELETE_OBJECT](./src/com/actions/object/deleteobject.ts) | Delete an existing object
|
|
183
|
+
| [SELECT_OBJECT](./src/com/actions/object/selectobject.ts) | Select an existing object in the scene
|
|
184
|
+
| [DESELECT_OBJECT](./src/com/actions/object/deselectobject.ts) | Deselect an existing object in the scene
|
|
185
|
+
| [SET_BACKGROUND](./src/com/actions/scene/setbackground.ts) | Set a background color
|
|
186
|
+
| [DROP_IT](./src/com/actions/object/model/dropit.ts) | Places the model onto the next underlying object's bounding box
|
|
187
|
+
| [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts) | Places the model onto the floor (zero plane)
|
|
188
|
+
| [SET_CAMERA_TRANSFORM](./src/com/actions/camera/setcameratransform.ts) | Set camera transformation (w/o animation, used to initially set up camera)
|
|
189
|
+
| [GET_CAMERA_TRANSFORM](./src/com/actions/camera/getcameratransform.ts) | Return currenty camera transformation
|
|
190
|
+
| [MOVE_CAMERA](./src/com/actions/camera/movecamera.ts) | Move camera to a specific position or the position of a previously defined POV (with an animation)
|
|
191
|
+
| [RESET_CAMERA](./src/com/actions/camera/resetcamera.ts) | Reset camera to original position after MOVE_CAMERA was performed
|
|
192
|
+
| [COMPUTE_ENCOMPASSING_VIEW](./src/com/actions/camera/computeencompassingview.ts), | Calculates the camera position and target to view the whole scene
|
|
193
|
+
| [SET_CAMERA_LAYER](./src/com/actions/camera/setcameralayer.ts) | Set camera layer to switch between live view and editor view
|
|
194
|
+
| [ZOOM_CAMERA](./src/com/actions/camera/zoomcamera.ts) | Zoom in or out
|
|
195
|
+
| [SET_GIZMO_MODE](./src/com/actions/toolbox/select/setgizmomode.ts) | Set gizmo mode
|
|
196
|
+
| [SET_GIZMO_VISIBILITY](./src/com/actions/toolbox/select/setgizmovisibility.ts) | Set gizmo visibility
|
|
197
|
+
| [MODEL_LOADED](./src/com/actions/object/model/modelloaded.ts) | Is performed when a model file is completely loaded
|
|
198
|
+
| [UPDATE_SCENE](./src/com/actions/scene/updatescene.ts) | Update scene data
|
|
199
|
+
| [GENERATE_MEDIA](./src/com/actions/media/generatemedia.ts) | Generate a screenshot with the specified parameters
|