Skip to content

Commit

Permalink
make viewer.getViewState().camera return the same thing as cameraMana…
Browse files Browse the repository at this point in the history
…ger.getCameraState
  • Loading branch information
nabati committed Jun 20, 2024
1 parent 7247ded commit 6e92a98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions viewer/packages/api/src/utilities/ViewStateHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type ViewerState = {
camera?: {
position: { x: number; y: number; z: number };
target: { x: number; y: number; z: number };
rotation?: { x: number; y: number; z: number };
};
models?: ModelState[];
clippingPlanes?: ClippingPlanesState[];
Expand Down Expand Up @@ -52,14 +53,15 @@ export class ViewStateHelper {
}

public getCurrentState(): ViewerState {
const { position: cameraPosition, target: cameraTarget } = this._cameraManager.getCameraState();
const { position: cameraPosition, target: cameraTarget, rotation: cameraRotation } = this._cameraManager.getCameraState();
const modelStates = this.getModelsState();
const clippingPlanesState = this.getClippingPlanesState();

return {
camera: {
position: cameraPosition,
target: cameraTarget
target: cameraTarget,
rotation: cameraRotation,
},
models: modelStates,
clippingPlanes: clippingPlanesState
Expand Down

0 comments on commit 6e92a98

Please sign in to comment.