|
13 | 13 | * limitations under the License.
|
14 | 14 | */
|
15 | 15 |
|
16 |
| -import {Box3, BufferGeometry, Event as ThreeEvent, EventDispatcher, Line, Matrix4, PerspectiveCamera, Quaternion, Vector3, WebGLRenderer, XRControllerEventType, XRTargetRaySpace, Object3D} from 'three'; |
| 16 | +import {Box3, BufferGeometry, Camera, Event as ThreeEvent, EventDispatcher, Line, Matrix4, PerspectiveCamera, Quaternion, Vector3, WebGLRenderer, XRControllerEventType, XRTargetRaySpace, Object3D} from 'three'; |
17 | 17 | import {XREstimatedLight} from 'three/examples/jsm/webxr/XREstimatedLight.js';
|
18 | 18 |
|
19 | 19 | import {CameraChangeDetails, ControlsInterface} from '../features/controls.js';
|
@@ -302,14 +302,14 @@ export class ARRenderer extends EventDispatcher<
|
302 | 302 | if (this.xrMode !== 'screen-space') {
|
303 | 303 | this.menuPanel = new XRMenuPanel();
|
304 | 304 | scene.add(this.menuPanel);
|
305 |
| - this.updateMenuPanelPosition(scene.camera, this.placementBox!); // Position the menu panel |
| 305 | + this.updateMenuPanelPosition(scene.getCamera(), this.placementBox!); // Position the menu panel |
306 | 306 | }
|
307 | 307 |
|
308 | 308 | this.lastTick = performance.now();
|
309 | 309 | this.dispatchEvent({type: 'status', status: ARStatus.SESSION_STARTED});
|
310 | 310 | }
|
311 | 311 |
|
312 |
| - private updateMenuPanelPosition(camera: PerspectiveCamera, placementBox: PlacementBox) { |
| 312 | + private updateMenuPanelPosition(camera: Camera, placementBox: PlacementBox) { |
313 | 313 | if (!this.menuPanel || !placementBox) {
|
314 | 314 | return;
|
315 | 315 | }
|
@@ -551,7 +551,7 @@ export class ARRenderer extends EventDispatcher<
|
551 | 551 | }
|
552 | 552 | this.menuPanel = new XRMenuPanel();
|
553 | 553 | this.presentedScene!.add(this.menuPanel);
|
554 |
| - this.updateMenuPanelPosition(this.presentedScene!.camera, this.placementBox!); |
| 554 | + this.updateMenuPanelPosition(this.presentedScene!.getCamera(), this.placementBox!); |
555 | 555 | }
|
556 | 556 |
|
557 | 557 | };
|
@@ -1053,7 +1053,7 @@ export class ARRenderer extends EventDispatcher<
|
1053 | 1053 | if (menuPanel) {
|
1054 | 1054 | menuPanel.updateOpacity(delta);
|
1055 | 1055 | // Update menu panel position whenever the model moves
|
1056 |
| - this.updateMenuPanelPosition(scene.camera, box); |
| 1056 | + this.updateMenuPanelPosition(scene.getCamera(), box); |
1057 | 1057 | }
|
1058 | 1058 | }
|
1059 | 1059 |
|
|
0 commit comments