diff --git a/src/state/effects/viewerState.useEffect.spec.ts b/src/state/effects/viewerState.useEffect.spec.ts index 88a52f438a64986a1bd3c6b9c673fde7fb3defc5..ac447f018c6e7ea9627c30c0cd3fd9b2d9b01c4c 100644 --- a/src/state/effects/viewerState.useEffect.spec.ts +++ b/src/state/effects/viewerState.useEffect.spec.ts @@ -563,14 +563,7 @@ describe('> viewerState.useEffect.ts', () => { it('> if no arg is provided', () => { const obj = cvtNehubaConfigToNavigationObj() - expect(obj).toEqual({ - orientation: [0, 0, 0, 1], - perspectiveOrientation: [0 , 0, 0, 1], - perspectiveZoom: 1e6, - zoom: 1e6, - position: [0, 0, 0], - positionReal: true - }) + expect(obj).toEqual(defaultNavigationObject) }) it('> if null or undefined is provided', () => { diff --git a/src/state/effects/viewerState.useEffect.ts b/src/state/effects/viewerState.useEffect.ts index ee9b14a052cb904d319cac39aacf6c65847d14de..c3912a996beacbf8c46da9ff36c6d154134be3f1 100644 --- a/src/state/effects/viewerState.useEffect.ts +++ b/src/state/effects/viewerState.useEffect.ts @@ -22,7 +22,7 @@ const defaultZoom = 1e6 export const defaultNavigationObject = { orientation: [0, 0, 0, 1], - perspectiveOrientation: [0 , 0, 0, 1], + perspectiveOrientation: [0.5, -0.5, -0.5, 0.5], perspectiveZoom: defaultPerspectiveZoom, zoom: defaultZoom, position: [0, 0, 0], @@ -45,7 +45,11 @@ export const defaultNehubaConfigObject = { } export function cvtNehubaConfigToNavigationObj(nehubaConfig?){ - const { navigation, perspectiveOrientation = [0.5, -0.5, -0.5, 0.5], perspectiveZoom = 1e6 } = nehubaConfig || {} + const { + navigation, + perspectiveOrientation = defaultNavigationObject.perspectiveOrientation, + perspectiveZoom = defaultNavigationObject.perspectiveZoom + } = nehubaConfig || {} const { pose, zoomFactor = 1e6 } = navigation || {} const { position, orientation = [0, 0, 0, 1] } = pose || {} const { voxelSize = [1, 1, 1], voxelCoordinates = [0, 0, 0] } = position || {}