@preference-sl/pref-viewer 2.17.2-beta.0 → 2.17.2-beta.1
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
|
@@ -168,7 +168,8 @@ export default class BabylonJSViewCubeRenderer {
|
|
|
168
168
|
/**
|
|
169
169
|
* Orients the cube like the host camera and follows its projection. An orthographic host gives an orthographic
|
|
170
170
|
* cube (radius 5, extents +-1.15). A perspective host gives a perspective cube with the host's vertical fov at
|
|
171
|
-
* radius 1.15 / tan(fov / 2), so the
|
|
171
|
+
* radius 0.5 + 1.15 / tan(fov / 2), so the near face and its corner knobs keep the on-screen size of the
|
|
172
|
+
* orthographic layout (the rest of the cube foreshortens behind it).
|
|
172
173
|
* @param {{alpha: number, beta: number, mode?: number, fov?: number}} pose - Host camera angles in radians (beta is clamped away from the poles), projection mode (Camera.ORTHOGRAPHIC_CAMERA or Camera.PERSPECTIVE_CAMERA; absent keeps the last one) and vertical field of view in radians (absent or not a finite positive number keeps the last one, 0.8 initially).
|
|
173
174
|
* @returns {void}
|
|
174
175
|
*/
|
|
@@ -393,13 +394,14 @@ export default class BabylonJSViewCubeRenderer {
|
|
|
393
394
|
return best?.id ?? null;
|
|
394
395
|
}
|
|
395
396
|
|
|
396
|
-
// Orthographic: fixed radius and extents. Perspective: the host fov and the radius that frames the same half extent
|
|
397
|
+
// Orthographic: fixed radius and extents. Perspective: the host fov and the radius that frames the same half extent
|
|
398
|
+
// at the near face plane (CUBE_HALF in front of the centre), where the corner knobs and the face in view are drawn.
|
|
397
399
|
#applyProjection(camera) {
|
|
398
400
|
if (this.#mode === Camera.PERSPECTIVE_CAMERA) {
|
|
399
401
|
camera.mode = Camera.PERSPECTIVE_CAMERA;
|
|
400
402
|
camera.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
|
|
401
403
|
camera.fov = this.#fov;
|
|
402
|
-
camera.radius = ORTHO_EXTENT / Math.tan(this.#fov / 2);
|
|
404
|
+
camera.radius = CUBE_HALF + ORTHO_EXTENT / Math.tan(this.#fov / 2);
|
|
403
405
|
// A wide fov brings the camera closer than the margin: keep the near plane positive and before the nearest corner.
|
|
404
406
|
camera.minZ = Math.max(camera.radius - PERSPECTIVE_DEPTH_MARGIN, Math.min(0.1, (camera.radius - CORNER_DISTANCE) / 2));
|
|
405
407
|
camera.maxZ = camera.radius + PERSPECTIVE_DEPTH_MARGIN;
|