From bee095ba74aed907a6782347c10181997cae26c6 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Wed, 22 Dec 2021 23:05:27 +0100 Subject: [PATCH] Remove orbit center modifier code. --- source/viewer/navigation.js | 21 --------------------- source/viewer/viewer.js | 9 --------- 2 files changed, 30 deletions(-) diff --git a/source/viewer/navigation.js b/source/viewer/navigation.js index 89d0df3..da9d882 100644 --- a/source/viewer/navigation.js +++ b/source/viewer/navigation.js @@ -273,7 +273,6 @@ OV.Navigation = class this.mouse = new OV.MouseInteraction (); this.touch = new OV.TouchInteraction (); this.clickDetector = new OV.ClickDetector (); - this.lastNavigationType = OV.NavigationType.None; this.onMouseClick = null; this.onMouseMove = null; @@ -460,7 +459,6 @@ OV.Navigation = class this.Zoom (-moveDiff.y * zoomRatio); } - this.lastNavigationType = navigationType; this.Update (); } @@ -473,11 +471,6 @@ OV.Navigation = class let mouseCoords = this.mouse.GetPosition (); this.Click (ev.which, mouseCoords); } - - if (this.lastNavigationType === OV.NavigationType.Pan) { - this.UpdateOrbitCenter (); - } - this.lastNavigationType = OV.NavigationType.None; } OnMouseLeave (ev) @@ -525,7 +518,6 @@ OV.Navigation = class this.Pan (moveDiff.x * panRatio, moveDiff.y * panRatio); } - this.lastNavigationType = navigationType; this.Update (); } @@ -542,11 +534,6 @@ OV.Navigation = class this.Click (1, touchCoords); } } - - if (this.lastNavigationType === OV.NavigationType.Pan) { - this.UpdateOrbitCenter (); - } - this.lastNavigationType = OV.NavigationType.None; } OnMouseWheel (ev) @@ -653,12 +640,4 @@ OV.Navigation = class this.onContext (globalCoords, localCoords); } } - - UpdateOrbitCenter () - { - let centerCoord = this.callbacks.getCenterIntersection (); - if (centerCoord !== null) { - this.orbitCenter = centerCoord; - } - } }; diff --git a/source/viewer/viewer.js b/source/viewer/viewer.js index 250f53b..fb67822 100644 --- a/source/viewer/viewer.js +++ b/source/viewer/viewer.js @@ -797,15 +797,6 @@ OV.Viewer = class this.navigation = new OV.Navigation (canvasElem, camera, { onUpdate : () => { this.Render (); - }, - getCenterIntersection : () => { - let canvasSize = this.GetCanvasSize (); - let centerCoord = new OV.Coord2D (canvasSize.width / 2.0, canvasSize.height / 2.0); - let intersection = this.GetMeshIntersectionUnderMouse (centerCoord); - if (intersection === null) { - return null; - } - return new OV.Coord3D (intersection.point.x, intersection.point.y, intersection.point.z); } });