@ifc-lite/renderer 3.2.0 → 4.2.0
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/dist/aabb-edges.d.ts +10 -0
- package/dist/aabb-edges.d.ts.map +1 -1
- package/dist/aabb-edges.js +13 -0
- package/dist/aabb-edges.js.map +1 -1
- package/dist/ao-params.d.ts +85 -0
- package/dist/ao-params.d.ts.map +1 -0
- package/dist/ao-params.js +109 -0
- package/dist/ao-params.js.map +1 -0
- package/dist/ao-pass.d.ts +47 -0
- package/dist/ao-pass.d.ts.map +1 -0
- package/dist/ao-pass.js +157 -0
- package/dist/ao-pass.js.map +1 -0
- package/dist/camera-matrices.d.ts +3 -0
- package/dist/camera-matrices.d.ts.map +1 -1
- package/dist/camera-matrices.js +12 -1
- package/dist/camera-matrices.js.map +1 -1
- package/dist/camera-orientation.d.ts +62 -0
- package/dist/camera-orientation.d.ts.map +1 -0
- package/dist/camera-orientation.js +155 -0
- package/dist/camera-orientation.js.map +1 -0
- package/dist/camera-projection.d.ts +3 -1
- package/dist/camera-projection.d.ts.map +1 -1
- package/dist/camera-projection.js +26 -20
- package/dist/camera-projection.js.map +1 -1
- package/dist/camera-surface-zoom.d.ts +32 -0
- package/dist/camera-surface-zoom.d.ts.map +1 -0
- package/dist/camera-surface-zoom.js +37 -0
- package/dist/camera-surface-zoom.js.map +1 -0
- package/dist/camera.d.ts +32 -61
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +71 -167
- package/dist/camera.js.map +1 -1
- package/dist/clash-solid-pipeline.d.ts +9 -3
- package/dist/clash-solid-pipeline.d.ts.map +1 -1
- package/dist/clash-solid-pipeline.js +31 -8
- package/dist/clash-solid-pipeline.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -3
- package/dist/constants.js.map +1 -1
- package/dist/depth-reconstruct.d.ts +43 -0
- package/dist/depth-reconstruct.d.ts.map +1 -0
- package/dist/depth-reconstruct.js +35 -0
- package/dist/depth-reconstruct.js.map +1 -0
- package/dist/device.js +1 -1
- package/dist/device.js.map +1 -1
- package/dist/environment.d.ts +26 -15
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +24 -13
- package/dist/environment.js.map +1 -1
- package/dist/federation-registry.d.ts +16 -0
- package/dist/federation-registry.d.ts.map +1 -1
- package/dist/federation-registry.js +80 -9
- package/dist/federation-registry.js.map +1 -1
- package/dist/gpu-static-upload.d.ts +39 -0
- package/dist/gpu-static-upload.d.ts.map +1 -0
- package/dist/gpu-static-upload.js +70 -0
- package/dist/gpu-static-upload.js.map +1 -0
- package/dist/gpu-upload-guard.d.ts +12 -23
- package/dist/gpu-upload-guard.d.ts.map +1 -1
- package/dist/gpu-upload-guard.js +12 -26
- package/dist/gpu-upload-guard.js.map +1 -1
- package/dist/index.d.ts +29 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +201 -252
- package/dist/index.js.map +1 -1
- package/dist/instanced-render.d.ts +22 -2
- package/dist/instanced-render.d.ts.map +1 -1
- package/dist/instanced-render.js +47 -10
- package/dist/instanced-render.js.map +1 -1
- package/dist/instanced-rte.d.ts +17 -0
- package/dist/instanced-rte.d.ts.map +1 -0
- package/dist/instanced-rte.js +32 -0
- package/dist/instanced-rte.js.map +1 -0
- package/dist/mesh-rte-uniforms.d.ts +46 -0
- package/dist/mesh-rte-uniforms.d.ts.map +1 -0
- package/dist/mesh-rte-uniforms.js +59 -0
- package/dist/mesh-rte-uniforms.js.map +1 -0
- package/dist/model-bounds-tracker.d.ts +7 -0
- package/dist/model-bounds-tracker.d.ts.map +1 -1
- package/dist/model-bounds-tracker.js +16 -5
- package/dist/model-bounds-tracker.js.map +1 -1
- package/dist/model-translation.d.ts +1 -1
- package/dist/model-translation.d.ts.map +1 -1
- package/dist/model-translation.js +50 -2
- package/dist/model-translation.js.map +1 -1
- package/dist/pick-rte-snapshot.d.ts +7 -0
- package/dist/pick-rte-snapshot.d.ts.map +1 -0
- package/dist/pick-rte-snapshot.js +15 -0
- package/dist/pick-rte-snapshot.js.map +1 -0
- package/dist/pick-types.d.ts +17 -0
- package/dist/pick-types.d.ts.map +1 -0
- package/dist/pick-types.js +5 -0
- package/dist/pick-types.js.map +1 -0
- package/dist/pick-uniforms.d.ts +6 -0
- package/dist/pick-uniforms.d.ts.map +1 -1
- package/dist/pick-uniforms.js +22 -18
- package/dist/pick-uniforms.js.map +1 -1
- package/dist/pick-world-position.d.ts +18 -0
- package/dist/pick-world-position.d.ts.map +1 -0
- package/dist/pick-world-position.js +21 -0
- package/dist/pick-world-position.js.map +1 -0
- package/dist/picker-readbacks.d.ts +6 -0
- package/dist/picker-readbacks.d.ts.map +1 -0
- package/dist/picker-readbacks.js +20 -0
- package/dist/picker-readbacks.js.map +1 -0
- package/dist/picker-rte-uniforms.d.ts +6 -0
- package/dist/picker-rte-uniforms.d.ts.map +1 -0
- package/dist/picker-rte-uniforms.js +41 -0
- package/dist/picker-rte-uniforms.js.map +1 -0
- package/dist/picker.d.ts +6 -7
- package/dist/picker.d.ts.map +1 -1
- package/dist/picker.js +88 -115
- package/dist/picker.js.map +1 -1
- package/dist/picking-manager.d.ts +8 -0
- package/dist/picking-manager.d.ts.map +1 -1
- package/dist/picking-manager.js +46 -19
- package/dist/picking-manager.js.map +1 -1
- package/dist/pipeline.d.ts +1 -7
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +17 -20
- package/dist/pipeline.js.map +1 -1
- package/dist/point-picker.d.ts +5 -1
- package/dist/point-picker.d.ts.map +1 -1
- package/dist/point-picker.js +49 -9
- package/dist/point-picker.js.map +1 -1
- package/dist/pointcloud/point-cloud-handle-ids.d.ts +22 -0
- package/dist/pointcloud/point-cloud-handle-ids.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-handle-ids.js +31 -0
- package/dist/pointcloud/point-cloud-handle-ids.js.map +1 -0
- package/dist/pointcloud/point-cloud-node.d.ts +14 -6
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/pointcloud/point-cloud-pick-sources.d.ts +47 -0
- package/dist/pointcloud/point-cloud-pick-sources.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-pick-sources.js +32 -0
- package/dist/pointcloud/point-cloud-pick-sources.js.map +1 -0
- package/dist/pointcloud/point-cloud-placement.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-placement.js +20 -5
- package/dist/pointcloud/point-cloud-placement.js.map +1 -1
- package/dist/pointcloud/point-cloud-ray-transform.d.ts +78 -4
- package/dist/pointcloud/point-cloud-ray-transform.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-ray-transform.js +31 -84
- package/dist/pointcloud/point-cloud-ray-transform.js.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.d.ts +21 -19
- package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.js +46 -52
- package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
- package/dist/pointcloud/point-cloud-stream-lifecycle.d.ts +44 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.js +44 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.js.map +1 -0
- package/dist/pointcloud/point-cloud-uniforms.d.ts +5 -0
- package/dist/pointcloud/point-cloud-uniforms.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-uniforms.js +55 -44
- package/dist/pointcloud/point-cloud-uniforms.js.map +1 -1
- package/dist/pointcloud/point-cloud-visibility.d.ts +10 -0
- package/dist/pointcloud/point-cloud-visibility.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-visibility.js +18 -0
- package/dist/pointcloud/point-cloud-visibility.js.map +1 -0
- package/dist/pointcloud/point-pipeline.d.ts +4 -9
- package/dist/pointcloud/point-pipeline.d.ts.map +1 -1
- package/dist/pointcloud/point-pipeline.js +4 -9
- package/dist/pointcloud/point-pipeline.js.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.d.ts +1 -21
- package/dist/pointcloud/point-shader.wgsl.d.ts.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.js +25 -5
- package/dist/pointcloud/point-shader.wgsl.js.map +1 -1
- package/dist/post-pass-chain.d.ts +38 -0
- package/dist/post-pass-chain.d.ts.map +1 -0
- package/dist/post-pass-chain.js +99 -0
- package/dist/post-pass-chain.js.map +1 -0
- package/dist/post-processor.d.ts +12 -26
- package/dist/post-processor.d.ts.map +1 -1
- package/dist/post-processor.js +14 -72
- package/dist/post-processor.js.map +1 -1
- package/dist/raycast-engine.d.ts +7 -5
- package/dist/raycast-engine.d.ts.map +1 -1
- package/dist/raycast-engine.js +17 -20
- package/dist/raycast-engine.js.map +1 -1
- package/dist/raycast-point-cloud-query.d.ts +1 -1
- package/dist/raycast-point-cloud-query.d.ts.map +1 -1
- package/dist/reference-image-pipeline.d.ts +1 -1
- package/dist/reference-image-pipeline.d.ts.map +1 -1
- package/dist/reference-image-pipeline.js +25 -7
- package/dist/reference-image-pipeline.js.map +1 -1
- package/dist/reference-images.d.ts +1 -1
- package/dist/reference-images.d.ts.map +1 -1
- package/dist/reference-images.js +13 -5
- package/dist/reference-images.js.map +1 -1
- package/dist/relative-to-eye.d.ts +146 -0
- package/dist/relative-to-eye.d.ts.map +1 -0
- package/dist/relative-to-eye.js +326 -0
- package/dist/relative-to-eye.js.map +1 -0
- package/dist/render-section-draw.d.ts +11 -0
- package/dist/render-section-draw.d.ts.map +1 -1
- package/dist/render-section-draw.js +6 -3
- package/dist/render-section-draw.js.map +1 -1
- package/dist/renderer-color-readback.d.ts +50 -0
- package/dist/renderer-color-readback.d.ts.map +1 -0
- package/dist/renderer-color-readback.js +145 -0
- package/dist/renderer-color-readback.js.map +1 -0
- package/dist/renderer-overlays.d.ts +12 -3
- package/dist/renderer-overlays.d.ts.map +1 -1
- package/dist/renderer-overlays.js +33 -20
- package/dist/renderer-overlays.js.map +1 -1
- package/dist/renderer-screenshot.d.ts +4 -0
- package/dist/renderer-screenshot.d.ts.map +1 -0
- package/dist/renderer-screenshot.js +17 -0
- package/dist/renderer-screenshot.js.map +1 -0
- package/dist/renderer-symbolic-overlays.d.ts +4 -2
- package/dist/renderer-symbolic-overlays.d.ts.map +1 -1
- package/dist/renderer-symbolic-overlays.js +33 -13
- package/dist/renderer-symbolic-overlays.js.map +1 -1
- package/dist/renderer-viewport.d.ts +45 -0
- package/dist/renderer-viewport.d.ts.map +1 -1
- package/dist/renderer-viewport.js +44 -0
- package/dist/renderer-viewport.js.map +1 -1
- package/dist/rte-clip-space.d.ts +12 -0
- package/dist/rte-clip-space.d.ts.map +1 -0
- package/dist/rte-clip-space.js +22 -0
- package/dist/rte-clip-space.js.map +1 -0
- package/dist/rte-frustum.d.ts +24 -0
- package/dist/rte-frustum.d.ts.map +1 -0
- package/dist/rte-frustum.js +45 -0
- package/dist/rte-frustum.js.map +1 -0
- package/dist/scene-batch-upload.d.ts.map +1 -1
- package/dist/scene-batch-upload.js +14 -38
- package/dist/scene-batch-upload.js.map +1 -1
- package/dist/scene-device-recovery.d.ts.map +1 -1
- package/dist/scene-device-recovery.js +5 -9
- package/dist/scene-device-recovery.js.map +1 -1
- package/dist/scene-finalize-regroup.d.ts +54 -0
- package/dist/scene-finalize-regroup.d.ts.map +1 -0
- package/dist/scene-finalize-regroup.js +136 -0
- package/dist/scene-finalize-regroup.js.map +1 -0
- package/dist/scene-instance-bounds.d.ts +12 -0
- package/dist/scene-instance-bounds.d.ts.map +1 -0
- package/dist/scene-instance-bounds.js +48 -0
- package/dist/scene-instance-bounds.js.map +1 -0
- package/dist/scene-instance-materialization.d.ts +4 -1
- package/dist/scene-instance-materialization.d.ts.map +1 -1
- package/dist/scene-instance-materialization.js +21 -6
- package/dist/scene-instance-materialization.js.map +1 -1
- package/dist/scene-instance-translation.d.ts +17 -0
- package/dist/scene-instance-translation.d.ts.map +1 -0
- package/dist/scene-instance-translation.js +50 -0
- package/dist/scene-instance-translation.js.map +1 -0
- package/dist/scene-instance-types.d.ts +6 -0
- package/dist/scene-instance-types.d.ts.map +1 -1
- package/dist/scene-model-translation.d.ts +2 -0
- package/dist/scene-model-translation.d.ts.map +1 -1
- package/dist/scene-model-translation.js +1 -1
- package/dist/scene-model-translation.js.map +1 -1
- package/dist/scene-rect-select.d.ts +11 -1
- package/dist/scene-rect-select.d.ts.map +1 -1
- package/dist/scene-rect-select.js +7 -4
- package/dist/scene-rect-select.js.map +1 -1
- package/dist/scene.d.ts +17 -19
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +109 -238
- package/dist/scene.js.map +1 -1
- package/dist/section-2d-lift.d.ts +10 -2
- package/dist/section-2d-lift.d.ts.map +1 -1
- package/dist/section-2d-lift.js +14 -6
- package/dist/section-2d-lift.js.map +1 -1
- package/dist/section-2d-line-buffer.d.ts +12 -4
- package/dist/section-2d-line-buffer.d.ts.map +1 -1
- package/dist/section-2d-line-buffer.js +59 -33
- package/dist/section-2d-line-buffer.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +18 -72
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +72 -103
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/section-2d-types.d.ts +38 -0
- package/dist/section-2d-types.d.ts.map +1 -0
- package/dist/section-2d-types.js +6 -0
- package/dist/section-2d-types.js.map +1 -0
- package/dist/section-cap-pipelines.d.ts +6 -0
- package/dist/section-cap-pipelines.d.ts.map +1 -0
- package/dist/section-cap-pipelines.js +87 -0
- package/dist/section-cap-pipelines.js.map +1 -0
- package/dist/section-plane-geometry.d.ts +24 -0
- package/dist/section-plane-geometry.d.ts.map +1 -0
- package/dist/section-plane-geometry.js +93 -0
- package/dist/section-plane-geometry.js.map +1 -0
- package/dist/section-plane.d.ts +23 -24
- package/dist/section-plane.d.ts.map +1 -1
- package/dist/section-plane.js +58 -174
- package/dist/section-plane.js.map +1 -1
- package/dist/shaders/ao.wgsl.d.ts +2 -0
- package/dist/shaders/ao.wgsl.d.ts.map +1 -0
- package/dist/shaders/ao.wgsl.js +234 -0
- package/dist/shaders/ao.wgsl.js.map +1 -0
- package/dist/shaders/color-transfer.wgsl.d.ts +26 -0
- package/dist/shaders/color-transfer.wgsl.d.ts.map +1 -0
- package/dist/shaders/color-transfer.wgsl.js +53 -0
- package/dist/shaders/color-transfer.wgsl.js.map +1 -0
- package/dist/shaders/depth-reconstruct.wgsl.d.ts +16 -0
- package/dist/shaders/depth-reconstruct.wgsl.d.ts.map +1 -0
- package/dist/shaders/depth-reconstruct.wgsl.js +69 -0
- package/dist/shaders/depth-reconstruct.wgsl.js.map +1 -0
- package/dist/shaders/main-rte-shadow.wgsl.d.ts +4 -0
- package/dist/shaders/main-rte-shadow.wgsl.d.ts.map +1 -0
- package/dist/shaders/main-rte-shadow.wgsl.js +54 -0
- package/dist/shaders/main-rte-shadow.wgsl.js.map +1 -0
- package/dist/shaders/main.wgsl.d.ts +1 -6
- package/dist/shaders/main.wgsl.d.ts.map +1 -1
- package/dist/shaders/main.wgsl.js +110 -159
- package/dist/shaders/main.wgsl.js.map +1 -1
- package/dist/shaders/relative-to-eye.wgsl.d.ts +12 -0
- package/dist/shaders/relative-to-eye.wgsl.d.ts.map +1 -0
- package/dist/shaders/relative-to-eye.wgsl.js +40 -0
- package/dist/shaders/relative-to-eye.wgsl.js.map +1 -0
- package/dist/shaders/section-2d-overlay.wgsl.d.ts +28 -12
- package/dist/shaders/section-2d-overlay.wgsl.d.ts.map +1 -1
- package/dist/shaders/section-2d-overlay.wgsl.js +40 -13
- package/dist/shaders/section-2d-overlay.wgsl.js.map +1 -1
- package/dist/shaders/shadow.wgsl.d.ts +1 -1
- package/dist/shaders/shadow.wgsl.d.ts.map +1 -1
- package/dist/shaders/shadow.wgsl.js +25 -7
- package/dist/shaders/shadow.wgsl.js.map +1 -1
- package/dist/shaders/sky.wgsl.d.ts +1 -11
- package/dist/shaders/sky.wgsl.d.ts.map +1 -1
- package/dist/shaders/sky.wgsl.js +17 -19
- package/dist/shaders/sky.wgsl.js.map +1 -1
- package/dist/shaders/symbolic-overlay.wgsl.d.ts +2 -9
- package/dist/shaders/symbolic-overlay.wgsl.d.ts.map +1 -1
- package/dist/shaders/symbolic-overlay.wgsl.js +88 -17
- package/dist/shaders/symbolic-overlay.wgsl.js.map +1 -1
- package/dist/shaders/textured.wgsl.d.ts.map +1 -1
- package/dist/shaders/textured.wgsl.js +11 -9
- package/dist/shaders/textured.wgsl.js.map +1 -1
- package/dist/shadow-light-matrix.d.ts +7 -0
- package/dist/shadow-light-matrix.d.ts.map +1 -1
- package/dist/shadow-light-matrix.js +11 -0
- package/dist/shadow-light-matrix.js.map +1 -1
- package/dist/shadow-occluder-batches.d.ts +10 -0
- package/dist/shadow-occluder-batches.d.ts.map +1 -0
- package/dist/shadow-occluder-batches.js +39 -0
- package/dist/shadow-occluder-batches.js.map +1 -0
- package/dist/shadow-occluders.d.ts.map +1 -1
- package/dist/shadow-occluders.js +4 -0
- package/dist/shadow-occluders.js.map +1 -1
- package/dist/shadow-pass.d.ts +5 -51
- package/dist/shadow-pass.d.ts.map +1 -1
- package/dist/shadow-pass.js +49 -45
- package/dist/shadow-pass.js.map +1 -1
- package/dist/shadow-types.d.ts +39 -0
- package/dist/shadow-types.d.ts.map +1 -0
- package/dist/shadow-types.js +15 -0
- package/dist/shadow-types.js.map +1 -0
- package/dist/symbolic-overlay-geometry.d.ts +7 -0
- package/dist/symbolic-overlay-geometry.d.ts.map +1 -0
- package/dist/symbolic-overlay-geometry.js +43 -0
- package/dist/symbolic-overlay-geometry.js.map +1 -0
- package/dist/symbolic-overlay-pipelines.d.ts +24 -36
- package/dist/symbolic-overlay-pipelines.d.ts.map +1 -1
- package/dist/symbolic-overlay-pipelines.js +175 -182
- package/dist/symbolic-overlay-pipelines.js.map +1 -1
- package/dist/symbolic-text-atlas.d.ts +21 -0
- package/dist/symbolic-text-atlas.d.ts.map +1 -1
- package/dist/symbolic-text-atlas.js +29 -1
- package/dist/symbolic-text-atlas.js.map +1 -1
- package/dist/types.d.ts +20 -26
- package/dist/types.d.ts.map +1 -1
- package/dist/visual-enhancement.d.ts +23 -1
- package/dist/visual-enhancement.d.ts.map +1 -1
- package/dist/visual-enhancement.js +38 -12
- package/dist/visual-enhancement.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { areFiniteNumbers, isUsableDistance } from './camera-guards.js';
|
|
5
|
+
import { CAMERA_CONSTANTS } from './constants.js';
|
|
6
|
+
/** Absolute orientation and readouts share the camera's authored f64 pose. */
|
|
7
|
+
export class CameraOrientation {
|
|
8
|
+
state;
|
|
9
|
+
animator;
|
|
10
|
+
updateMatrices;
|
|
11
|
+
constructor(state, animator, updateMatrices) {
|
|
12
|
+
this.state = state;
|
|
13
|
+
this.animator = animator;
|
|
14
|
+
this.updateMatrices = updateMatrices;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get distance from camera position to target.
|
|
18
|
+
*
|
|
19
|
+
* Deliberately **unsanitized**: it reports the pose as it actually is, so a
|
|
20
|
+
* malformed one (a BCF viewpoint restored from a file reaches the public
|
|
21
|
+
* setters unvalidated) yields NaN rather than a substituted number. This is
|
|
22
|
+
* a measurement, not a control input: it is what `useBCF` reads back when
|
|
23
|
+
* restoring a viewpoint and what the BCF overlay scales markers by. There is
|
|
24
|
+
* no substitute that is right for every reader — a plausible-looking `1`
|
|
25
|
+
* would place every restored target one unit from the eye — and returning a
|
|
26
|
+
* number here would contradict `getPosition()`/`getTarget()`, which are raw,
|
|
27
|
+
* leaving callers no way to tell that the pose is broken. Gesture code inside
|
|
28
|
+
* this package guards with {@link isUsableDistance} instead; each gesture
|
|
29
|
+
* needs a different fallback. Callers OUTSIDE the package cannot use that
|
|
30
|
+
* predicate (it is package-internal) and are not all guarded — see #2466 for
|
|
31
|
+
* the viewpoint-restore path (#2441).
|
|
32
|
+
*/
|
|
33
|
+
getDistance() {
|
|
34
|
+
const dir = {
|
|
35
|
+
x: this.state.camera.position.x - this.state.camera.target.x,
|
|
36
|
+
y: this.state.camera.position.y - this.state.camera.target.y,
|
|
37
|
+
z: this.state.camera.position.z - this.state.camera.target.z,
|
|
38
|
+
};
|
|
39
|
+
return Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get current camera rotation angles in degrees
|
|
43
|
+
* Returns { azimuth, elevation } where:
|
|
44
|
+
* - azimuth: horizontal rotation (0-360), 0 = front
|
|
45
|
+
* - elevation: vertical rotation (-90 to 90), 0 = horizon
|
|
46
|
+
*/
|
|
47
|
+
getRotation() {
|
|
48
|
+
const dir = {
|
|
49
|
+
x: this.state.camera.position.x - this.state.camera.target.x,
|
|
50
|
+
y: this.state.camera.position.y - this.state.camera.target.y,
|
|
51
|
+
z: this.state.camera.position.z - this.state.camera.target.z,
|
|
52
|
+
};
|
|
53
|
+
const distance = Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
|
|
54
|
+
// `distance < 1e-6` alone is a magnitude test, not a finiteness one: the
|
|
55
|
+
// comparison is false for NaN, so a malformed pose fell through the guard
|
|
56
|
+
// that looked like it was catching it, and `Math.asin(Math.max(-1,
|
|
57
|
+
// Math.min(1, NaN)))` is NaN — a NaN elevation that leaves the renderer
|
|
58
|
+
// entirely, into the viewer's rotation readout and the measurement
|
|
59
|
+
// handlers (#2441). Same neutral answer as the degenerate pose, which is
|
|
60
|
+
// preserved verbatim.
|
|
61
|
+
if (!isUsableDistance(distance, 1e-6))
|
|
62
|
+
return { azimuth: 0, elevation: 0 };
|
|
63
|
+
// Elevation: angle from horizontal plane
|
|
64
|
+
const elevation = Math.asin(Math.max(-1, Math.min(1, dir.y / distance))) * 180 / Math.PI;
|
|
65
|
+
// Calculate azimuth smoothly using up vector
|
|
66
|
+
// The up vector defines the "screen up" direction, which determines rotation
|
|
67
|
+
const upX = this.state.camera.up.x;
|
|
68
|
+
const upY = this.state.camera.up.y;
|
|
69
|
+
const upZ = this.state.camera.up.z;
|
|
70
|
+
// Project up vector onto horizontal plane (XZ plane)
|
|
71
|
+
const upLen = Math.sqrt(upX * upX + upZ * upZ);
|
|
72
|
+
let azimuth;
|
|
73
|
+
if (upLen > 0.01) {
|
|
74
|
+
// Use up vector projection for azimuth (smooth and consistent)
|
|
75
|
+
azimuth = (Math.atan2(-upX, -upZ) * 180 / Math.PI + 360) % 360;
|
|
76
|
+
// For bottom view, flip azimuth
|
|
77
|
+
if (elevation < -80 && upY < 0) {
|
|
78
|
+
azimuth = (azimuth + 180) % 360;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
// Fallback: use position-based azimuth when up vector is vertical
|
|
83
|
+
azimuth = (Math.atan2(dir.x, dir.z) * 180 / Math.PI + 360) % 360;
|
|
84
|
+
}
|
|
85
|
+
return { azimuth, elevation };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Place the camera at an ABSOLUTE orientation around its current target,
|
|
89
|
+
* in the same angle convention {@link getRotation} reports — the exact
|
|
90
|
+
* inverse of it, so `setRotation(a, e)` then `getRotation()` returns
|
|
91
|
+
* `{ azimuth: a, elevation: e }` (modulo the normalisation and pole clamp
|
|
92
|
+
* below).
|
|
93
|
+
*
|
|
94
|
+
* This is the only absolute-orientation entry point on the camera. Everything
|
|
95
|
+
* else is relative (`orbit`, and the viewer's 90° rotate steppers built on it)
|
|
96
|
+
* or names a direction rather than an angle (`setPresetView`), which is why a
|
|
97
|
+
* host command that says "go to azimuth 120°, elevation 30°" had nothing to
|
|
98
|
+
* call and silently did nothing (#2934).
|
|
99
|
+
*
|
|
100
|
+
* The orbit radius and the target are preserved — this rotates the camera on
|
|
101
|
+
* its current sphere, it does not reframe. `up` is reset to world Y, matching
|
|
102
|
+
* `orbit`, so the reported azimuth comes back through `getRotation`'s
|
|
103
|
+
* position-based branch.
|
|
104
|
+
*
|
|
105
|
+
* @param azimuth Horizontal angle in degrees; normalised into [0, 360).
|
|
106
|
+
* @param elevation Vertical angle in degrees, 0 = horizon. Clamped to just
|
|
107
|
+
* inside ±90° (the same `MIN_PHI` margin `orbit` uses) — the exact poles
|
|
108
|
+
* collapse `cross(forward, up)` and flip the model.
|
|
109
|
+
*/
|
|
110
|
+
setRotation(azimuth, elevation) {
|
|
111
|
+
// Angles are an input class of their own, and both of them reach the
|
|
112
|
+
// trigonometry below unguarded: a non-finite one writes a NaN position and
|
|
113
|
+
// destroys an otherwise valid pose. Same rejection `orbit` applies to its
|
|
114
|
+
// deltas — a rejected call changes nothing at all.
|
|
115
|
+
if (!areFiniteNumbers(azimuth, elevation))
|
|
116
|
+
return;
|
|
117
|
+
const target = this.state.camera.target;
|
|
118
|
+
const dir = {
|
|
119
|
+
x: this.state.camera.position.x - target.x,
|
|
120
|
+
y: this.state.camera.position.y - target.y,
|
|
121
|
+
z: this.state.camera.position.z - target.z,
|
|
122
|
+
};
|
|
123
|
+
const current = Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z);
|
|
124
|
+
// A degenerate pose (position === target, or a non-finite one) has no orbit
|
|
125
|
+
// radius to preserve. Any positive radius yields a well-formed view matrix
|
|
126
|
+
// at the requested direction, which is strictly better than propagating the
|
|
127
|
+
// degeneracy — and leaves the caller's angles observable, which is the
|
|
128
|
+
// whole point of the command.
|
|
129
|
+
const distance = isUsableDistance(current, 1e-6) ? current : 1;
|
|
130
|
+
// The TARGET is the other unguarded input, and `isUsableDistance` above only
|
|
131
|
+
// rescues the radius. `setTarget` accepts non-finite coordinates, and every
|
|
132
|
+
// position component below is `target.<axis> + ...`, so one NaN there makes
|
|
133
|
+
// the whole pose NaN -- and this method's contract is that it RECOVERS a
|
|
134
|
+
// pose, so silently writing an unrecoverable one is worse than refusing.
|
|
135
|
+
// Same rejection shape as the angle guard at the top: change nothing.
|
|
136
|
+
if (!areFiniteNumbers(target.x, target.y, target.z))
|
|
137
|
+
return;
|
|
138
|
+
// An in-flight tween or leftover inertia writes position/target on the next
|
|
139
|
+
// `update()` and would erase this pose a frame later. Cancel it only after
|
|
140
|
+
// every input has been accepted: rejected commands must change nothing.
|
|
141
|
+
this.animator.reset();
|
|
142
|
+
const theta = ((((azimuth % 360) + 360) % 360) * Math.PI) / 180;
|
|
143
|
+
const poleMargin = CAMERA_CONSTANTS.MIN_PHI;
|
|
144
|
+
const phi = Math.max(poleMargin, Math.min(Math.PI - poleMargin, ((90 - elevation) * Math.PI) / 180));
|
|
145
|
+
const sinPhi = Math.sin(phi);
|
|
146
|
+
this.state.camera.position = {
|
|
147
|
+
x: target.x + distance * sinPhi * Math.sin(theta),
|
|
148
|
+
y: target.y + distance * Math.cos(phi),
|
|
149
|
+
z: target.z + distance * sinPhi * Math.cos(theta),
|
|
150
|
+
};
|
|
151
|
+
this.state.camera.up = { x: 0, y: 1, z: 0 };
|
|
152
|
+
this.updateMatrices();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=camera-orientation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-orientation.js","sourceRoot":"","sources":["../src/camera-orientation.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAI/D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,8EAA8E;AAC9E,MAAM,OAAO,iBAAiB;IAET;IACA;IACA;IAHnB,YACmB,KAA0B,EAC1B,QAAwB,EACxB,cAA0B;QAF1B,UAAK,GAAL,KAAK,CAAqB;QAC1B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,mBAAc,GAAd,c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IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YACtC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;SAClD,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CAEF"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { Vec3 } from './types.js';
|
|
6
6
|
import type { CameraInternalState } from './camera-state.js';
|
|
7
|
+
import type { RelativeToEyeFrame } from './relative-to-eye.js';
|
|
7
8
|
/**
|
|
8
9
|
* Handles projection math: screen-to-world and world-to-screen conversions,
|
|
9
10
|
* bounding box fitting, and near/far plane management.
|
|
@@ -11,7 +12,8 @@ import type { CameraInternalState } from './camera-state.js';
|
|
|
11
12
|
export declare class CameraProjection {
|
|
12
13
|
private readonly state;
|
|
13
14
|
private readonly updateMatrices;
|
|
14
|
-
|
|
15
|
+
private readonly relativeToEyeFrame;
|
|
16
|
+
constructor(state: CameraInternalState, updateMatrices: () => void, relativeToEyeFrame: RelativeToEyeFrame);
|
|
15
17
|
/**
|
|
16
18
|
* Project a world position to screen coordinates
|
|
17
19
|
* @param worldPos - Position in world space
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera-projection.d.ts","sourceRoot":"","sources":["../src/camera-projection.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"camera-projection.d.ts","sourceRoot":"","sources":["../src/camera-projection.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAgB/D;;;GAGG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAFlB,KAAK,EAAE,mBAAmB,EAC1B,cAAc,EAAE,MAAM,IAAI,EAC1B,kBAAkB,EAAE,kBAAkB;IAGzD;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAqC3G;;;;;;;OAOG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE;IAgG9H;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI;IAiCvC;;;;OAIG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAG7C"}
|
|
@@ -24,9 +24,11 @@ function usableNdc(screen, extent, scale, offset) {
|
|
|
24
24
|
export class CameraProjection {
|
|
25
25
|
state;
|
|
26
26
|
updateMatrices;
|
|
27
|
-
|
|
27
|
+
relativeToEyeFrame;
|
|
28
|
+
constructor(state, updateMatrices, relativeToEyeFrame) {
|
|
28
29
|
this.state = state;
|
|
29
30
|
this.updateMatrices = updateMatrices;
|
|
31
|
+
this.relativeToEyeFrame = relativeToEyeFrame;
|
|
30
32
|
}
|
|
31
33
|
/**
|
|
32
34
|
* Project a world position to screen coordinates
|
|
@@ -36,13 +38,18 @@ export class CameraProjection {
|
|
|
36
38
|
* @returns Screen coordinates { x, y } or null if behind camera
|
|
37
39
|
*/
|
|
38
40
|
projectToScreen(worldPos, canvasWidth, canvasHeight) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
41
|
+
if (!this.relativeToEyeFrame.isAvailable())
|
|
42
|
+
return null;
|
|
43
|
+
// Preserve the authored f64 residual before the f32 rotation/projection.
|
|
44
|
+
const [x, y, z] = this.relativeToEyeFrame.worldToRelative([worldPos.x, worldPos.y, worldPos.z]);
|
|
45
|
+
if (![x, y, z, canvasWidth, canvasHeight].every(Number.isFinite))
|
|
46
|
+
return null;
|
|
47
|
+
const m = this.relativeToEyeFrame.getViewProjection().m;
|
|
48
|
+
// Manual matrix-vector multiplication for vec4(eyeRelative, 1.0).
|
|
49
|
+
const clipX = m[0] * x + m[4] * y + m[8] * z + m[12];
|
|
50
|
+
const clipY = m[1] * x + m[5] * y + m[9] * z + m[13];
|
|
51
|
+
const clipZ = m[2] * x + m[6] * y + m[10] * z + m[14];
|
|
52
|
+
const clipW = m[3] * x + m[7] * y + m[11] * z + m[15];
|
|
46
53
|
// Check if behind camera
|
|
47
54
|
if (clipW <= 0) {
|
|
48
55
|
return null;
|
|
@@ -111,25 +118,24 @@ export class CameraProjection {
|
|
|
111
118
|
}
|
|
112
119
|
// Perspective: ray origin is always the camera position
|
|
113
120
|
// Direction is computed through the screen point
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
if (!this.relativeToEyeFrame.isAvailable())
|
|
122
|
+
return { origin: { ...basis.eye }, direction: basis.forward };
|
|
123
|
+
// Inverting a matrix with absolute f32 translation destroys nearby ray
|
|
124
|
+
// offsets at survey coordinates. Unproject directly into the shared eye frame.
|
|
125
|
+
const invViewProj = MathUtils.invert(this.relativeToEyeFrame.getViewProjection());
|
|
116
126
|
if (!invViewProj) {
|
|
117
127
|
// Fallback: return ray from camera position towards target
|
|
118
128
|
return { origin: { ...basis.eye }, direction: basis.forward };
|
|
119
129
|
}
|
|
120
130
|
// Unproject a point at some depth to get a point on the ray
|
|
121
131
|
// Using z=0.5 (midpoint in Reverse-Z: 1.0=near, 0.0=far) to get a finite point
|
|
122
|
-
const
|
|
132
|
+
const relativePoint = MathUtils.transformPoint(invViewProj, { x: ndcX, y: ndcY, z: 0.5 });
|
|
123
133
|
// Ray origin is the scrubbed camera position — the same one the view
|
|
124
134
|
// matrix's translation row uses, so the ray belongs to the frame on
|
|
125
135
|
// screen rather than to a pose that was never rendered.
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
y: worldPoint.y - origin.y,
|
|
130
|
-
z: worldPoint.z - origin.z,
|
|
131
|
-
};
|
|
132
|
-
const direction = MathUtils.normalize(raw);
|
|
136
|
+
const [x, y, z] = this.relativeToEyeFrame.getCameraWorld();
|
|
137
|
+
const origin = { x, y, z };
|
|
138
|
+
const direction = MathUtils.normalize(relativePoint);
|
|
133
139
|
// `normalize` is total — it returns the zero vector for everything it
|
|
134
140
|
// cannot normalize — and a zero-length direction is a ray that hits
|
|
135
141
|
// nothing, the same silent miss the NaN origin produced. Two inputs land
|
|
@@ -138,9 +144,9 @@ export class CameraProjection {
|
|
|
138
144
|
//
|
|
139
145
|
// - the inverted matrix is ill-conditioned enough that the unprojected
|
|
140
146
|
// point lands on the eye, leaving nothing to normalize;
|
|
141
|
-
// -
|
|
147
|
+
// - the unprojected relative point is non-finite. `MathUtils.invert` stores its result in a
|
|
142
148
|
// `Float32Array`, so an inverse component past 3.4e38 saturates to
|
|
143
|
-
// `Infinity` and `transformPoint` carries that into
|
|
149
|
+
// `Infinity` and `transformPoint` carries that into the relative point. A
|
|
144
150
|
// lower bound admits `Infinity` (it is not *below* the floor), and
|
|
145
151
|
// `Infinity / Infinity` is NaN while the finite components divide to
|
|
146
152
|
// `0` — so the direction came back `{NaN, 0, -0}`, which is neither
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera-projection.js","sourceRoot":"","sources":["../src/camera-projection.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAS/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"camera-projection.js","sourceRoot":"","sources":["../src/camera-projection.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAS/D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGxE;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,MAAc,EAAE,MAAc,EAAE,KAAa,EAAE,MAAc;IAC9E,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC;IACpG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAER;IACA;IACA;IAHnB,YACmB,KAA0B,EAC1B,cAA0B,EAC1B,kBAAsC;QAFtC,UAAK,GAAL,KAAK,CAAqB;QAC1B,mBAAc,GAAd,cAAc,CAAY;QAC1B,uBAAkB,GAAlB,kBAAkB,CAAoB;IACtD,CAAC;IAEJ;;;;;;OAMG;IACH,eAAe,CAAC,QAAc,EAAE,WAAmB,EAAE,YAAoB;QACvE,IAAI,CAAC,IAAI,C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AM,QAAQ,GAAG,OAAO,GAAG,GAAG,CAAC;QAE/B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAElC,qCAAqC;QACrC,4DAA4D;QAC5D,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG;YAC3B,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,GAAG,GAAG,EAAI,QAAQ;YACxC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,GAAG,GAAG,EAAI,QAAQ;YACxC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,QAAQ,GAAG,GAAG,EAAI,QAAQ;SACzC,CAAC;QAEF,0EAA0E;QAC1E,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,SAAiB;QACnC,+DAA+D;IACjE,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zoom toward the surface under the cursor (#5393).
|
|
3
|
+
*
|
|
4
|
+
* Plain wheel zoom anchors on the plane through the orbit target and dollies
|
|
5
|
+
* the target forward by half of every step (`CameraControls.zoomPerspective`,
|
|
6
|
+
* the anti-"Zeno" dolly), so its step has no relation to how far the surface
|
|
7
|
+
* under the cursor is: repeated notches pass straight through a pipe or a
|
|
8
|
+
* small building into empty space.
|
|
9
|
+
*
|
|
10
|
+
* With a picked surface point P, each notch instead moves the camera along the
|
|
11
|
+
* cursor ray toward P by a fraction of the REMAINING distance, down to a
|
|
12
|
+
* standoff. That approaches the surface asymptotically and never reaches it.
|
|
13
|
+
* The camera is translated, not rotated, so P stays under the cursor; the
|
|
14
|
+
* orbit target is re-seated on the view axis at P's depth, so orbit and pan
|
|
15
|
+
* afterwards scale with the surface the user zoomed to rather than with the
|
|
16
|
+
* old, now far-behind, target.
|
|
17
|
+
*/
|
|
18
|
+
import type { Vec3 } from './types.js';
|
|
19
|
+
/** Closest the camera gets to the picked surface, in scene units (metres). */
|
|
20
|
+
export declare const SURFACE_ZOOM_MIN_STANDOFF = 0.02;
|
|
21
|
+
export interface SurfaceZoomPose {
|
|
22
|
+
position: Vec3;
|
|
23
|
+
target: Vec3;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One zoom-in notch toward `point`. `fraction` in (0, 1) is the share of the
|
|
27
|
+
* remaining distance to cover. Returns the new pose, or null when the point is
|
|
28
|
+
* unusable (non-finite, at the eye, or not in front of the camera), in which
|
|
29
|
+
* case the caller falls back to plain zoom.
|
|
30
|
+
*/
|
|
31
|
+
export declare function surfaceZoomStep(pose: SurfaceZoomPose, point: Vec3, fraction: number): SurfaceZoomPose | null;
|
|
32
|
+
//# sourceMappingURL=camera-surface-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-surface-zoom.d.ts","sourceRoot":"","sources":["../src/camera-surface-zoom.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAuB5G"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/** Closest the camera gets to the picked surface, in scene units (metres). */
|
|
5
|
+
export const SURFACE_ZOOM_MIN_STANDOFF = 0.02;
|
|
6
|
+
/**
|
|
7
|
+
* One zoom-in notch toward `point`. `fraction` in (0, 1) is the share of the
|
|
8
|
+
* remaining distance to cover. Returns the new pose, or null when the point is
|
|
9
|
+
* unusable (non-finite, at the eye, or not in front of the camera), in which
|
|
10
|
+
* case the caller falls back to plain zoom.
|
|
11
|
+
*/
|
|
12
|
+
export function surfaceZoomStep(pose, point, fraction) {
|
|
13
|
+
const { position: p, target: t } = pose;
|
|
14
|
+
if (![point.x, point.y, point.z].every(Number.isFinite) || !(fraction > 0 && fraction < 1))
|
|
15
|
+
return null;
|
|
16
|
+
const fx = t.x - p.x, fy = t.y - p.y, fz = t.z - p.z;
|
|
17
|
+
const fLen = Math.hypot(fx, fy, fz);
|
|
18
|
+
if (!(fLen > 0) || !Number.isFinite(fLen))
|
|
19
|
+
return null;
|
|
20
|
+
const forward = { x: fx / fLen, y: fy / fLen, z: fz / fLen };
|
|
21
|
+
const toX = point.x - p.x, toY = point.y - p.y, toZ = point.z - p.z;
|
|
22
|
+
const dist = Math.hypot(toX, toY, toZ);
|
|
23
|
+
const depth0 = toX * forward.x + toY * forward.y + toZ * forward.z;
|
|
24
|
+
// A point behind the eye (or on it) is no surface to approach.
|
|
25
|
+
if (!(dist > 0) || !(depth0 > 0))
|
|
26
|
+
return null;
|
|
27
|
+
// Moving along the cursor ray scales the point's depth (its distance along
|
|
28
|
+
// the view axis, which is what the near plane clips) by the same factor as
|
|
29
|
+
// its distance, so the standoff is enforced on depth: an off-axis point is
|
|
30
|
+
// shallower than it is far.
|
|
31
|
+
const next = Math.max(dist * (1 - fraction), (SURFACE_ZOOM_MIN_STANDOFF * dist) / depth0);
|
|
32
|
+
const k = next < dist ? 1 - next / dist : 0; // at the standoff: hold still, never pass
|
|
33
|
+
const position = { x: p.x + toX * k, y: p.y + toY * k, z: p.z + toZ * k };
|
|
34
|
+
const d = depth0 * (1 - k); // the point's depth after the move, >= the standoff
|
|
35
|
+
return { position, target: { x: position.x + forward.x * d, y: position.y + forward.y * d, z: position.z + forward.z * d } };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=camera-surface-zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-surface-zoom.js","sourceRoot":"","sources":["../src/camera-surface-zoom.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsB/D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAO9C;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAqB,EAAE,KAAW,EAAE,QAAgB;IAClF,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IACxC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACxG,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC;IAE7D,MAA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EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AAC/H,CAAC"}
|
package/dist/camera.d.ts
CHANGED
|
@@ -8,17 +8,20 @@ import type { Vec3, Mat4 } from './types.js';
|
|
|
8
8
|
import { type InteractionMode } from './camera-controls.js';
|
|
9
9
|
import type { ProjectionMode } from './camera-state.js';
|
|
10
10
|
import { type Bounds3, type FitPolicy } from './camera-fit-policy.js';
|
|
11
|
+
import { RelativeToEyeFrame } from './relative-to-eye.js';
|
|
11
12
|
export declare class Camera {
|
|
12
13
|
private state;
|
|
13
14
|
private controls;
|
|
14
15
|
private animator;
|
|
15
16
|
private projection;
|
|
16
17
|
private firstPerson;
|
|
18
|
+
private orientation;
|
|
19
|
+
/** The sole renderer camera frame used by all RTE-capable consumers. */
|
|
20
|
+
private readonly relativeToEyeFrame;
|
|
21
|
+
/** Mirror of the controls' gate, for the surface zoom below (#5393). */
|
|
22
|
+
private interactionMode;
|
|
17
23
|
constructor();
|
|
18
|
-
/**
|
|
19
|
-
* Cold-path convenience for this class's own setters. The hot path uses the
|
|
20
|
-
* closure built in the constructor; see the note there.
|
|
21
|
-
*/
|
|
24
|
+
/** Publish both camera frames after every setter, gesture and animation. */
|
|
22
25
|
private updateMatrices;
|
|
23
26
|
/**
|
|
24
27
|
* Set camera aspect ratio
|
|
@@ -66,8 +69,15 @@ export declare class Camera {
|
|
|
66
69
|
* @param mouseY - Mouse Y position in canvas coordinates
|
|
67
70
|
* @param canvasWidth - Canvas width
|
|
68
71
|
* @param canvasHeight - Canvas height
|
|
72
|
+
* @param fastZoom - Pure dolly (Shift / Cesium): the full step translates the rig
|
|
73
|
+
* @param surfacePoint - World point on the visible surface under the cursor
|
|
74
|
+
* (#5393). Zooming IN approaches it and stops short of it; it is ignored
|
|
75
|
+
* for zoom-out, fast zoom and orthographic. The surface step applies no
|
|
76
|
+
* inertia, so `addVelocity` has no effect on it.
|
|
69
77
|
*/
|
|
70
|
-
zoom(delta: number, addVelocity?: boolean, mouseX?: number, mouseY?: number, canvasWidth?: number, canvasHeight?: number, fastZoom?: boolean): void;
|
|
78
|
+
zoom(delta: number, addVelocity?: boolean, mouseX?: number, mouseY?: number, canvasWidth?: number, canvasHeight?: number, fastZoom?: boolean, surfacePoint?: Vec3): void;
|
|
79
|
+
/** One zoom-in notch toward a picked surface point; false = not applied. */
|
|
80
|
+
private zoomTowardSurface;
|
|
71
81
|
/**
|
|
72
82
|
* Fit view to bounding box. Sets camera to southeast isometric view (typical
|
|
73
83
|
* BIM starting view). Y-up coordinate system: Y is vertical
|
|
@@ -145,6 +155,13 @@ export declare class Camera {
|
|
|
145
155
|
*/
|
|
146
156
|
reset(): void;
|
|
147
157
|
getViewProjMatrix(): Mat4;
|
|
158
|
+
/** The reverse-Z projection matrix (perspective or orthographic); a copy. */
|
|
159
|
+
getProjMatrix(): Mat4;
|
|
160
|
+
/**
|
|
161
|
+
* Return the shared RTE frame for the current camera state. GPU consumers
|
|
162
|
+
* must use this instead of deriving a second camera rebase.
|
|
163
|
+
*/
|
|
164
|
+
getRelativeToEyeFrame(): RelativeToEyeFrame;
|
|
148
165
|
getPosition(): Vec3;
|
|
149
166
|
getTarget(): Vec3;
|
|
150
167
|
/**
|
|
@@ -158,73 +175,27 @@ export declare class Camera {
|
|
|
158
175
|
/**
|
|
159
176
|
* The aspect ratio (width / height) the projection is currently built from.
|
|
160
177
|
*
|
|
161
|
-
* This is the DRAWING BUFFER's ratio
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
178
|
+
* This is the DRAWING BUFFER's ratio. Since #5383 the buffer is the CSS box
|
|
179
|
+
* scaled by one pixel ratio on both axes, so the two agree up to integer
|
|
180
|
+
* rounding of the buffer (the width used to be floored to a multiple of 64,
|
|
181
|
+
* which made them differ by up to 63 pixels).
|
|
165
182
|
*
|
|
166
|
-
*
|
|
167
|
-
* from `canvas.toDataURL()`, which encodes that same drawing
|
|
168
|
-
* `<AspectRatio>` written beside it describes the image
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* reproduces the framing rather than one 63 pixels wider.
|
|
183
|
+
* The buffer ratio is the right one for BCF (#3612). A viewpoint's snapshot
|
|
184
|
+
* PNG comes from `canvas.toDataURL()`, which encodes that same drawing
|
|
185
|
+
* buffer, so the `<AspectRatio>` written beside it describes the image
|
|
186
|
+
* actually in the archive. It is also the ratio the projection matrix used,
|
|
187
|
+
* so a viewer restoring the camera reproduces the framing.
|
|
172
188
|
*
|
|
173
189
|
* Always finite and positive -- {@link setAspect} rejects anything else --
|
|
174
190
|
* which is what BCF 3.0's `PositiveDouble` schema type requires.
|
|
175
191
|
*/
|
|
176
192
|
getAspect(): number;
|
|
177
|
-
/**
|
|
178
|
-
* Get distance from camera position to target.
|
|
179
|
-
*
|
|
180
|
-
* Deliberately **unsanitized**: it reports the pose as it actually is, so a
|
|
181
|
-
* malformed one (a BCF viewpoint restored from a file reaches the public
|
|
182
|
-
* setters unvalidated) yields NaN rather than a substituted number. This is
|
|
183
|
-
* a measurement, not a control input: it is what `useBCF` reads back when
|
|
184
|
-
* restoring a viewpoint and what the BCF overlay scales markers by. There is
|
|
185
|
-
* no substitute that is right for every reader — a plausible-looking `1`
|
|
186
|
-
* would place every restored target one unit from the eye — and returning a
|
|
187
|
-
* number here would contradict `getPosition()`/`getTarget()`, which are raw,
|
|
188
|
-
* leaving callers no way to tell that the pose is broken. Gesture code inside
|
|
189
|
-
* this package guards with {@link isUsableDistance} instead; each gesture
|
|
190
|
-
* needs a different fallback. Callers OUTSIDE the package cannot use that
|
|
191
|
-
* predicate (it is package-internal) and are not all guarded — see #2466 for
|
|
192
|
-
* the viewpoint-restore path (#2441).
|
|
193
|
-
*/
|
|
193
|
+
/** Raw pose distance; non-finite source poses remain observable. */
|
|
194
194
|
getDistance(): number;
|
|
195
|
-
/**
|
|
196
|
-
* Get current camera rotation angles in degrees
|
|
197
|
-
* Returns { azimuth, elevation } where:
|
|
198
|
-
* - azimuth: horizontal rotation (0-360), 0 = front
|
|
199
|
-
* - elevation: vertical rotation (-90 to 90), 0 = horizon
|
|
200
|
-
*/
|
|
201
195
|
getRotation(): {
|
|
202
196
|
azimuth: number;
|
|
203
197
|
elevation: number;
|
|
204
198
|
};
|
|
205
|
-
/**
|
|
206
|
-
* Place the camera at an ABSOLUTE orientation around its current target,
|
|
207
|
-
* in the same angle convention {@link getRotation} reports — the exact
|
|
208
|
-
* inverse of it, so `setRotation(a, e)` then `getRotation()` returns
|
|
209
|
-
* `{ azimuth: a, elevation: e }` (modulo the normalisation and pole clamp
|
|
210
|
-
* below).
|
|
211
|
-
*
|
|
212
|
-
* This is the only absolute-orientation entry point on the camera. Everything
|
|
213
|
-
* else is relative (`orbit`, and the viewer's 90° rotate steppers built on it)
|
|
214
|
-
* or names a direction rather than an angle (`setPresetView`), which is why a
|
|
215
|
-
* host command that says "go to azimuth 120°, elevation 30°" had nothing to
|
|
216
|
-
* call and silently did nothing (#2934).
|
|
217
|
-
*
|
|
218
|
-
* The orbit radius and the target are preserved — this rotates the camera on
|
|
219
|
-
* its current sphere, it does not reframe. `up` is reset to world Y, matching
|
|
220
|
-
* `orbit`, so the reported azimuth comes back through `getRotation`'s
|
|
221
|
-
* position-based branch.
|
|
222
|
-
*
|
|
223
|
-
* @param azimuth Horizontal angle in degrees; normalised into [0, 360).
|
|
224
|
-
* @param elevation Vertical angle in degrees, 0 = horizon. Clamped to just
|
|
225
|
-
* inside ±90° (the same `MIN_PHI` margin `orbit` uses) — the exact poles
|
|
226
|
-
* collapse `cross(forward, up)` and flip the model.
|
|
227
|
-
*/
|
|
228
199
|
setRotation(azimuth: number, elevation: number): void;
|
|
229
200
|
/**
|
|
230
201
|
* Unproject screen coordinates to a ray in world space
|
package/dist/camera.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAuB,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,KAAK,EAAuB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAM7E,OAAO,EAAiB,KAAK,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,wBAAwB,CAAC;AAOhH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI1D,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,WAAW,CAAoB;IACvC,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA4B;IAC/D,wEAAwE;IACxE,OAAO,CAAC,eAAe,CAA0B;;IAiCjD,4EAA4E;IAC5E,OAAO,CAAC,cAAc;IAKtB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAa/B;;OAEG;IACH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,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