Merge pull request #147 from hey24sheep/task/ctrl_mouse_zoom
Feature - 'ctrl + mouse left' zoom
This commit is contained in:
commit
3cd9f24bbb
@ -397,8 +397,13 @@ OV.Navigation = class
|
|||||||
let moveDiff = this.mouse.GetMoveDiff ();
|
let moveDiff = this.mouse.GetMoveDiff ();
|
||||||
let mouseButton = this.mouse.GetButton ();
|
let mouseButton = this.mouse.GetButton ();
|
||||||
if (mouseButton === 1) {
|
if (mouseButton === 1) {
|
||||||
let orbitRatio = 0.5;
|
if (ev.ctrlKey) {
|
||||||
this.Orbit (moveDiff.x * orbitRatio, moveDiff.y * orbitRatio);
|
let zoomRatio = 0.005;
|
||||||
|
this.Zoom (-moveDiff.y * zoomRatio);
|
||||||
|
} else {
|
||||||
|
let orbitRatio = 0.5;
|
||||||
|
this.Orbit (moveDiff.x * orbitRatio, moveDiff.y * orbitRatio);
|
||||||
|
}
|
||||||
} else if (mouseButton === 2 || mouseButton === 3) {
|
} else if (mouseButton === 2 || mouseButton === 3) {
|
||||||
let eyeCenterDistance = OV.CoordDistance3D (this.camera.eye, this.camera.center);
|
let eyeCenterDistance = OV.CoordDistance3D (this.camera.eye, this.camera.center);
|
||||||
let panRatio = 0.001 * eyeCenterDistance;
|
let panRatio = 0.001 * eyeCenterDistance;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user