@shopware-ag/dive 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +38 -25
  2. package/build/dive.cjs +717 -500
  3. package/build/dive.cjs.map +1 -1
  4. package/build/dive.d.cts +174 -113
  5. package/build/dive.d.ts +174 -113
  6. package/build/dive.js +716 -486
  7. package/build/dive.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/__test__/DIVE.test.ts +66 -22
  10. package/src/animation/AnimationSystem.ts +16 -0
  11. package/src/animation/__test__/AnimationSystem.test.ts +23 -2
  12. package/src/axiscamera/AxisCamera.ts +40 -2
  13. package/src/axiscamera/__test__/AxisCamera.test.ts +178 -5
  14. package/src/com/Communication.ts +50 -16
  15. package/src/com/__test__/Communication.test.ts +73 -24
  16. package/src/com/actions/camera/computeencompassingview.ts +9 -0
  17. package/src/com/actions/index.ts +2 -0
  18. package/src/com/actions/scene/updatescene.ts +1 -0
  19. package/src/controls/OrbitControls.ts +14 -2
  20. package/src/controls/__test__/OrbitControls.test.ts +31 -4
  21. package/src/dive.ts +93 -33
  22. package/src/grid/Grid.ts +4 -0
  23. package/src/grid/__test__/Grid.test.ts +7 -0
  24. package/src/interface/Selectable.ts +17 -0
  25. package/src/interface/__test__/Interfaces.test.ts +18 -0
  26. package/src/mediacreator/MediaCreator.ts +2 -2
  27. package/src/mediacreator/__test__/MediaCreator.test.ts +12 -10
  28. package/src/renderer/Renderer.ts +7 -1
  29. package/src/renderer/__test__/Renderer.test.ts +14 -5
  30. package/src/scene/Scene.ts +8 -2
  31. package/src/scene/__test__/Scene.test.ts +6 -0
  32. package/src/scene/root/Root.ts +11 -1
  33. package/src/scene/root/__test__/Root.test.ts +68 -2
  34. package/src/toolbox/BaseTool.ts +1 -1
  35. package/src/toolbox/Toolbox.ts +53 -37
  36. package/src/toolbox/__test__/BaseTool.test.ts +43 -7
  37. package/src/toolbox/__test__/Toolbox.test.ts +39 -44
  38. package/src/toolbox/select/SelectTool.ts +17 -28
  39. package/src/toolbox/select/__test__/SelectTool.test.ts +21 -12
  40. package/src/toolbox/transform/TransformTool.ts +7 -1
  41. 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 | Description
163
- |:-------------------------------------------------------------------------------| :---
164
- | [GET_ALL_SCENE_DATA](./src/com/actions/scene/getallscenedata.ts) | Return all scene data that is currently set
165
- | [GET_ALL_OBJECTS](./src/com/actions/object/getallobjects.ts) | Return a map of all objects
166
- | [GET_OBJECTS](./src/com/actions/object/getobjects.ts) | Return an array of all objects with given ids
167
- | [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts) | Set a model onto to the floor
168
- | [ADD_OBJECT](./src/com/actions/object/addobject.ts) | Add an object to the scene
169
- | [UPDATE_OBJECT](./src/com/actions/object/updateobject.ts) | Update an existing object
170
- | [DELETE_OBJECT](./src/com/actions/object/deleteobject.ts) | Delete an existing object
171
- | [SELECT_OBJECT](./src/com/actions/object/selectobject.ts) | Select an existing object in the scene
172
- | [DESELECT_OBJECT](./src/com/actions/object/deselectobject.ts) | Deselect an existing object in the scene
173
- | [SET_BACKGROUND](./src/com/actions/scene/setbackground.ts) | Set a background color
174
- | [DROP_IT](./src/com/actions/object/model/dropit.ts) | Places the model onto the next underlying object's bounding box
175
- | [PLACE_ON_FLOOR](./src/com/actions/object/model/placeonfloor.ts) | Places the model onto the floor (zero plane)
176
- | [SET_CAMERA_TRANSFORM](./src/com/actions/camera/setcameratransform.ts) | Set camera transformation (w/o animation, used to initially set up camera)
177
- | [GET_CAMERA_TRANSFORM](./src/com/actions/camera/getcameratransform.ts) | Return currenty camera transformation
178
- | [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)
179
- | [RESET_CAMERA](./src/com/actions/camera/resetcamera.ts) | Reset camera to original position after MOVE_CAMERA was performed
180
- | [SET_CAMERA_LAYER](./src/com/actions/camera/setcameralayer.ts) | Set camera layer to switch between live view and editor view
181
- | [ZOOM_CAMERA](./src/com/actions/camera/zoomcamera.ts) | Zoom in or out
182
- | [SET_GIZMO_MODE](./src/com/actions/toolbox/select/setgizmomode.ts) | Set gizmo mode
183
- | [SET_GIZMO_VISIBILITY](./src/com/actions/toolbox/select/setgizmovisibility.ts) | Set gizmo visibility
184
- | [MODEL_LOADED](./src/com/actions/object/model/modelloaded.ts) | Is performed when a model file is completely loaded
185
- | [UPDATE_SCENE](./src/com/actions/scene/updatescene.ts) | Update scene data
186
- | [GENERATE_MEDIA](./src/com/actions/media/generatemedia.ts) | Generate a screenshot with the specified parameters
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