Skip to content

Commit

Permalink
merge OrbitNavigation and Camera projection property
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jun 17, 2024
1 parent 5804233 commit 4043f21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions source/client/components/CVOrbitNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export default class CVOrbitNavigation extends CObject3D
promptEnabled: types.Boolean("Settings.PromptEnabled", true),
isInUse: types.Boolean("Camera.IsInUse", false),
preset: types.Enum("Camera.ViewPreset", EViewPreset, EViewPreset.None),
projection: types.Enum("Camera.Projection", EProjection, EProjection.Perspective),
lightsFollowCamera: types.Boolean("Navigation.LightsFollowCam", true),
autoRotation: types.Boolean("Navigation.AutoRotation", false),
autoRotationSpeed: types.Number("Navigation.AutoRotationSpeed", 10),
Expand Down Expand Up @@ -175,13 +174,8 @@ export default class CVOrbitNavigation extends CObject3D
const cameraComponent = this._scene.activeCameraComponent;
const camera = cameraComponent ? cameraComponent.camera : null;

const { projection, preset, orbit, offset, pivot } = ins;
const { preset, orbit, offset, pivot } = ins;

// camera projection
if (cameraComponent && projection.changed) {
camera.setProjection(projection.getValidatedValue());
cameraComponent.ins.projection.setValue(projection.value, true);
}

// camera preset
if (preset.changed && preset.value !== EViewPreset.None) {
Expand Down
2 changes: 1 addition & 1 deletion source/client/components/CVViewTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ViewToolView extends ToolView<CVViewTool>
const navigation = document.setup.navigation;
const language = document.setup.language;

const projection = navigation.ins.projection;
const projection = navigation.scene.activeCameraComponent.ins.projection;
const preset = navigation.ins.preset;
const zoom = navigation.ins.zoomExtents;

Expand Down

0 comments on commit 4043f21

Please sign in to comment.