@vived/app 3.5.1 → 3.5.3

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeSerializeSceneRoot = exports.SerializeSceneRoot = void 0;
4
4
  const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
5
5
  const ValueObjects_1 = require("../../../ValueObjects");
6
+ const StoredView_1 = require("../../StoredView");
6
7
  const SceneRoot_1 = require("../Entities/SceneRoot");
7
8
  class SerializeSceneRoot extends AppObjectUC_1.AppObjectUC {
8
9
  constructor() {
@@ -27,6 +28,11 @@ class SerializeSceneRootImp extends SerializeSceneRoot {
27
28
  this.dispose();
28
29
  return;
29
30
  }
31
+ this.storedView = appObject.getComponent(StoredView_1.StoredView.type);
32
+ if (!this.storedView) {
33
+ console.warn("SerializeSceneRoot UC has been added to an App Object that does not have a StoredView Entity. Stored view won't work until one is added to the UC");
34
+ return;
35
+ }
30
36
  stateMachine.registerSerializedSystem(this);
31
37
  }
32
38
  getSystemState() {
@@ -34,12 +40,22 @@ class SerializeSceneRootImp extends SerializeSceneRoot {
34
40
  console.warn("[SerializeSceneRoot] No scene root entity");
35
41
  return {};
36
42
  }
37
- const data = {
38
- position: this.sceneRoot.position.dto,
39
- rotation: this.sceneRoot.rotation.dto,
40
- scale: this.sceneRoot.scale,
41
- };
42
- return data;
43
+ if (this.storedView && this.storedView.hasStoredView) {
44
+ const data = {
45
+ position: this.storedView.position.dto,
46
+ rotation: this.storedView.rotation.dto,
47
+ scale: this.storedView.scale,
48
+ };
49
+ return data;
50
+ }
51
+ else {
52
+ const data = {
53
+ position: this.sceneRoot.position.dto,
54
+ rotation: this.sceneRoot.rotation.dto,
55
+ scale: this.sceneRoot.scale,
56
+ };
57
+ return data;
58
+ }
43
59
  }
44
60
  applySystemState(serializedState, version, transitionTime) {
45
61
  try {
@@ -6,4 +6,5 @@ export * from "./Label";
6
6
  export * from "./Mesh";
7
7
  export * from "./OverlayColor";
8
8
  export * from "./SceneRoot";
9
+ export * from "./StoredView";
9
10
  export * from "./Transform3D";
@@ -18,4 +18,5 @@ __exportStar(require("./Label"), exports);
18
18
  __exportStar(require("./Mesh"), exports);
19
19
  __exportStar(require("./OverlayColor"), exports);
20
20
  __exportStar(require("./SceneRoot"), exports);
21
+ __exportStar(require("./StoredView"), exports);
21
22
  __exportStar(require("./Transform3D"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/app",
3
- "version": "3.5.1",
3
+ "version": "3.5.3",
4
4
  "description": "Public package for the VIVED Learning App system",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",