@preference-sl/pref-viewer 2.17.2-beta.1 → 2.17.2-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preference-sl/pref-viewer",
3
- "version": "2.17.2-beta.1",
3
+ "version": "2.17.2-beta.2",
4
4
  "description": "Web Component to preview GLTF models with Babylon.js",
5
5
  "author": "Alex Moreno Palacio <amoreno@preference.es>",
6
6
  "scripts": {
@@ -3396,7 +3396,8 @@ export default class BabylonJSController {
3396
3396
  getViewport: () => ({ width: this.#canvas.clientWidth, height: this.#canvas.clientHeight }),
3397
3397
  getCulture: this.#viewCubeConfig.getCulture,
3398
3398
  onLayout: this.#viewCubeConfig.onLayout,
3399
- requestRender: () => this.#requestRender({ frames: 2 }),
3399
+ // A cube drag is pointer interaction like a main-canvas drag: keep the loop continuous for the same window.
3400
+ requestRender: (options) => this.#requestRender({ frames: 2, continuousMs: options?.interaction ? BabylonJSController.config.render.interactionMs : 0 }),
3400
3401
  });
3401
3402
  }
3402
3403
 
@@ -139,7 +139,7 @@ export default class BabylonJSViewCubeController {
139
139
  * @param {function(import("@babylonjs/core").Camera|null|undefined): boolean} host.isLocked - Reports whether navigation is forbidden for the supplied camera, including unavailable cameras or active XR.
140
140
  * @param {function(): (ViewCubeBounds|null)} host.getBounds - Returns current model-only world bounds and their eight corners; null when geometry is unusable. Excludes the environment.
141
141
  * @param {function(): {width: number, height: number}} host.getViewport - Returns the current scene viewport dimensions in CSS pixels.
142
- * @param {function(): void} host.requestRender - Requests rendering through the host scheduler after accepted navigation.
142
+ * @param {function(Object=): void} host.requestRender - Requests rendering through the host scheduler after accepted navigation; `{ interaction: true }` marks a pointer drag step, for which the host keeps rendering continuously as it does for its own canvas drags.
143
143
  * @param {function(): string} [host.getCulture] - Returns the current localization culture; omitted callbacks use the translator's default culture.
144
144
  * @param {function(number, number): void} [host.onLayout] - Receives the measured cube viewport height and scene viewport height, in CSS pixels; zero cube height clears the menu offset, and disposal reports (0, 0).
145
145
  * @param {function(ViewCubeRendererOptions): BabylonJSViewCubeRenderer} [host.createRenderer] - Renderer factory, mainly for tests; defaults to a BabylonJSViewCubeRenderer with its own Engine.
@@ -581,7 +581,9 @@ export default class BabylonJSViewCubeController {
581
581
  const direction = directionFromAngles(applyDragDelta(angles, dAlpha, dBeta));
582
582
  this.#writePose(camera, pose.target.add(new Vector3(direction.x, direction.y, direction.z).scale(pose.distance)), pose.target, pose.distance);
583
583
  }
584
- this.#host.requestRender();
584
+ // A drag is pointer interaction: the host keeps its loop continuous for its interaction window, as it does for a
585
+ // main-canvas drag. A plain one-frame request would let its idle throttle pace the drag (seen at ~8 fps).
586
+ this.#host.requestRender({ interaction: true });
585
587
  }
586
588
 
587
589
  /**