@configura/babylon-view 1.6.0-iotest.4 → 1.6.1-alpha.2

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.
@@ -29,7 +29,7 @@ export declare class CfgProductNode extends CfgTransformNode implements Animatab
29
29
  private _originalMatrixWithModelTransform;
30
30
  private _anchorTarget;
31
31
  private _stretchedAnchorPointMatrix;
32
- readonly anchorRef: CfgAnchorRef | undefined;
32
+ anchorRef: CfgAnchorRef | undefined;
33
33
  private constructor();
34
34
  get cfgClassName(): string;
35
35
  destroy(): void;
@@ -40,6 +40,7 @@ export declare class CfgProductNode extends CfgTransformNode implements Animatab
40
40
  */
41
41
  private scheduleForRemoval;
42
42
  isDestroyed(): boolean;
43
+ private _refreshTransformAndAnchoring;
43
44
  /**
44
45
  * The passed function is recursively applied on every descendant CfgProductNode in the tree.
45
46
  * This node is included. Destroyed products are not included.
@@ -108,7 +109,7 @@ export declare class CfgProductNode extends CfgTransformNode implements Animatab
108
109
  setAnchorTarget(anchorTarget: CfgAnchorTargetNode | undefined): void;
109
110
  refreshStretch(): void;
110
111
  get originalMatrix(): Matrix;
111
- protected initTransform(): void;
112
+ protected refreshTransform(): void;
112
113
  _applyDebugSymRoots(symRootPromises: Promise<CfgSymRootNode | undefined>[]): Promise<void>;
113
114
  _addDebugMtrlApplication(debugMtrlApplication: CfgMtrlApplication): Promise<void>;
114
115
  get boundingBox(): CfgBoundingBox;
@@ -55,15 +55,10 @@ export class CfgProductNode extends CfgTransformNode {
55
55
  // Useful debug tool:
56
56
  if (false) {
57
57
  window.product = this;
58
- console.log(`Use "window.product" to access "${this.key}" product node.`);
58
+ window[this.key] = this;
59
+ console.log(`Use "window.product" or 'window["${this.key}"]' to access "${this.key}" product node.`);
59
60
  }
60
- this.anchorRef = CfgAnchorRef.make(this._product._internal.anchor);
61
- const modelTransform = _product.transform;
62
- if (modelTransform !== undefined) {
63
- const modelSymTransform = modelTransformToSymTransform(modelTransform);
64
- this._modelMatrix = symTransformToMatrix(modelSymTransform.transform());
65
- }
66
- this.initTransform();
61
+ this._refreshTransformAndAnchoring();
67
62
  }
68
63
  static make(renderEnvironment, product) {
69
64
  return new this(renderEnvironment, product);
@@ -92,6 +87,16 @@ export class CfgProductNode extends CfgTransformNode {
92
87
  isDestroyed() {
93
88
  return this._destroyed;
94
89
  }
90
+ _refreshTransformAndAnchoring() {
91
+ const product = this._product._internal;
92
+ const modelTransform = product.transform;
93
+ if (modelTransform !== undefined) {
94
+ const modelSymTransform = modelTransformToSymTransform(modelTransform);
95
+ this._modelMatrix = symTransformToMatrix(modelSymTransform.transform());
96
+ }
97
+ this.anchorRef = CfgAnchorRef.make(product.anchor);
98
+ this.refreshTransform();
99
+ }
95
100
  /**
96
101
  * This function will apply either of tree passed functions on the additional products/ in the
97
102
  * passed CfgProduct and the additional products in the CfgProductNode.
@@ -223,6 +228,7 @@ export class CfgProductNode extends CfgTransformNode {
223
228
  additionalProductLoadPromises.push(additionalProductNode.loadGeo(coordinatorWithMeta));
224
229
  },
225
230
  both: (_additionalProduct, additionalProductNode) => {
231
+ additionalProductNode._refreshTransformAndAnchoring();
226
232
  additionalProductLoadPromises.push(additionalProductNode.loadGeo(coordinatorWithMeta));
227
233
  },
228
234
  });
@@ -380,8 +386,7 @@ export class CfgProductNode extends CfgTransformNode {
380
386
  const updated = updatedStretchedAnchorPointMatrix(this.anchorRef, this._anchorTarget, this._stretchedAnchorPointMatrix, true);
381
387
  if (updated !== undefined) {
382
388
  this._stretchedAnchorPointMatrix = updated;
383
- this._originalMatrixWithModelTransform = undefined; // Reset the matrix
384
- this.initTransform();
389
+ this.refreshTransform();
385
390
  }
386
391
  // anchoredToAnchors is sorted so that anchors always are before what
387
392
  // is anchored to them. That way we know that if we refreshStretch on
@@ -413,7 +418,8 @@ export class CfgProductNode extends CfgTransformNode {
413
418
  }
414
419
  return this._originalMatrixWithModelTransform;
415
420
  }
416
- initTransform() {
421
+ refreshTransform() {
422
+ this._originalMatrixWithModelTransform = undefined; // Reset the matrix
417
423
  this.setPreTransformMatrix(this.originalMatrix);
418
424
  }
419
425
  _applyDebugSymRoots(symRootPromises) {
@@ -8,7 +8,7 @@ export declare class CfgBoundingBox {
8
8
  */
9
9
  private _isEmpty;
10
10
  reConstruct(minimum: Vector3, maximum: Vector3): CfgBoundingBox;
11
- copyFrom(otherBoundingBox: CfgBoundingBox): CfgBoundingBox;
11
+ copyFrom(source: CfgBoundingBox): CfgBoundingBox;
12
12
  clone(): CfgBoundingBox;
13
13
  get center(): Vector3;
14
14
  translate(vec: Vector3): CfgBoundingBox;
@@ -15,9 +15,9 @@ export class CfgBoundingBox {
15
15
  this._isEmpty = false;
16
16
  return this;
17
17
  }
18
- copyFrom(otherBoundingBox) {
19
- this.reConstruct(otherBoundingBox.minimum, otherBoundingBox.maximum);
20
- this._isEmpty = otherBoundingBox.isEmpty;
18
+ copyFrom(source) {
19
+ this.reConstruct(source.minimum, source.maximum);
20
+ this._isEmpty = source.isEmpty;
21
21
  return this;
22
22
  }
23
23
  clone() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/babylon-view",
3
- "version": "1.6.0-iotest.4",
3
+ "version": "1.6.1-alpha.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -16,16 +16,16 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@babylonjs/core": "4.2.0",
19
- "@configura/web-core": "1.6.0-iotest.4",
20
- "@configura/web-utilities": "1.6.0-iotest.4"
19
+ "@configura/web-core": "1.6.1-alpha.2",
20
+ "@configura/web-utilities": "1.6.1-alpha.2"
21
21
  },
22
22
  "devDependencies": {
23
- "@configura/web-api": "1.6.0-iotest.4",
23
+ "@configura/web-api": "1.6.1-alpha.2",
24
24
  "del-cli": "^3.0.0",
25
25
  "typescript": "4.2"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "d6eb7775e09c974d24dc5f44c97a26d4d42c3c68"
30
+ "gitHead": "e4b98f07293de3363e402a343194a9931d00732a"
31
31
  }