@terraware/web-components 4.2.20-rc.0 → 4.2.20

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.
@@ -96,6 +96,13 @@ export declare class TfAnnotationManager extends PcAnnotationManager {
96
96
  * @private
97
97
  */
98
98
  _updateAnnotationPositions(annotation: any, resources: any, screenPos: any): void;
99
+ /**
100
+ * Override to also disable the hotspot mesh (not just the DOM) when the annotation is behind the
101
+ * camera. The base implementation leaves the mesh enabled, so a not-yet-scaled plane under a
102
+ * scaled content-root would stay huge in view until the camera moves the anchor in front.
103
+ * @private
104
+ */
105
+ _hideAnnotationElements(annotation: any, resources: any): void;
99
106
  /**
100
107
  * Override the scale update to clamp the world size to a maximum value.
101
108
  * Also scales the hotspot DOM element to match.
@@ -1 +1 @@
1
- {"version":3,"file":"TfAnnotationManager.d.ts","sourceRoot":"","sources":["../../../src/components/VirtualWalkthrough/TfAnnotationManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,OAAO,EAAQ,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,iBAAiB,IAAI,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAIlG,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAelD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,mBAAmB;IAC1D,MAAM,CAAC,UAAU,SAAyB;IAE1C,OAAO,CAAC,aAAa,CAAO;IAC5B,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,sBAAsB,CAAkB;IAChD,OAAO,CAAC,uBAAuB,CAAa;IAC5C,OAAO,CAAC,WAAW,CAAmD;IAEtE;;;;;;;;OAQG;IACH,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,EAE7B;IAED,IAAI,YAAY,IAJQ,MAAM,CAM7B;IAED;;;;;;;;;;OAUG;IACH,IAAI,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAE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E,MAAM;IAI7C;;;OAGG;IACH,0BAA0B,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IA6B1E;;;;;OAKG;IACH,uBAAuB,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAMvD;;;;OAIG;IACH,iCAAiC,CAAC,UAAU,EAAE,GAAG;IAiDjD;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,GAAG;IAUhC;;;OAGG;IACH,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,SAAuB,EAAE,WAAW,SAAI,EAAE,IAAI,CAAC,EAAE,kBAAkB;CAyD7G"}
@@ -161,6 +161,15 @@ export class TfAnnotationManager extends PcAnnotationManager {
161
161
  _registerAnnotation(annotation) {
162
162
  super._registerAnnotation(annotation);
163
163
  this._applyAnnotationIcon(annotation);
164
+
165
+ // Keep the hotspot mesh hidden until the first scale pass clamps it. The annotation entity
166
+ // starts at unit local scale, so under a scaled content-root the plane would render many world
167
+ // units across for the frames before _updateAnnotationRotationAndScale runs.
168
+ const resources = this._annotationResources.get(annotation);
169
+ if (resources) {
170
+ resources.baseEntity.enabled = false;
171
+ resources.overlayEntity.enabled = false;
172
+ }
164
173
  }
165
174
 
166
175
  /**
@@ -269,6 +278,18 @@ export class TfAnnotationManager extends PcAnnotationManager {
269
278
  }
270
279
  }
271
280
 
281
+ /**
282
+ * Override to also disable the hotspot mesh (not just the DOM) when the annotation is behind the
283
+ * camera. The base implementation leaves the mesh enabled, so a not-yet-scaled plane under a
284
+ * scaled content-root would stay huge in view until the camera moves the anchor in front.
285
+ * @private
286
+ */
287
+ _hideAnnotationElements(annotation, resources) {
288
+ super._hideAnnotationElements(annotation, resources);
289
+ resources.baseEntity.enabled = false;
290
+ resources.overlayEntity.enabled = false;
291
+ }
292
+
272
293
  /**
273
294
  * Override the scale update to clamp the world size to a maximum value.
274
295
  * Also scales the hotspot DOM element to match.
@@ -305,6 +326,12 @@ export class TfAnnotationManager extends PcAnnotationManager {
305
326
  // size, so it uses the true _hotspotSize and the clamp ratio only (never the
306
327
  // parent scale, which the DOM overlay does not inherit).
307
328
  const resources = this._annotationResources.get(annotation);
329
+ if (resources) {
330
+ // This branch only runs for annotations in front of the camera, and the scale above is now
331
+ // clamped, so it is safe to reveal the mesh (hidden on register / when behind the camera).
332
+ resources.baseEntity.enabled = true;
333
+ resources.overlayEntity.enabled = true;
334
+ }
308
335
  if (resources && resources.hotspotDom) {
309
336
  const clampRatio = clampedScale / unclampedScale;
310
337
  const baseSize = this._hotspotSize + 5; // Match the +5 from the stylesheet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraware/web-components",
3
- "version": "4.2.20-rc.0",
3
+ "version": "4.2.20",
4
4
  "author": "Terraformation Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {