Skip to content

Commit

Permalink
add internal _projection value to CVOrbitNavigation to force update w…
Browse files Browse the repository at this point in the history
…hen necessary
  • Loading branch information
sdumetz committed Sep 4, 2024
1 parent e8f4bf9 commit 342ab8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/client/components/CVOrbitNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default class CVOrbitNavigation extends CObject3D
private _isAutoZooming = false;
private _autoRotationStartTime = null;
private _initYOrbit = null;
private _projection :EProjection = null;

constructor(node: Node, id: string)
{
Expand Down Expand Up @@ -264,7 +265,8 @@ export default class CVOrbitNavigation extends CObject3D
controller.camera = cameraComponent.camera;

const transform = cameraComponent.transform;
const forceUpdate = this.changed || ins.autoRotation.value || ins.promptActive.value;

const forceUpdate = this.changed || this._projection != cameraComponent.ins.projection.value || ins.autoRotation.value || ins.promptActive.value;

if ((ins.autoRotation.value || ins.promptActive.value) && this._autoRotationStartTime) {
const now = performance.now();
Expand Down Expand Up @@ -301,6 +303,7 @@ export default class CVOrbitNavigation extends CObject3D
}

if (controller.updateCamera(transform.object3D, forceUpdate)) {
this._projection = cameraComponent.ins.projection.value;
controller.orbit.toArray(ins.orbit.value);
ins.orbit.set(true);
controller.offset.toArray(ins.offset.value);
Expand Down

0 comments on commit 342ab8f

Please sign in to comment.