Remove orbit center modifier code.

This commit is contained in:
kovacsv 2021-12-22 23:05:27 +01:00
parent 7891817b3e
commit bee095ba74
2 changed files with 0 additions and 30 deletions

View File

@ -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;
}
}
};

View File

@ -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);
}
});