From 6111ef7a1628abaf662e581174e0eefae05e1a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 5 Feb 2016 14:09:50 -0500 Subject: [PATCH 1/2] modif scene is rotation definition: - determine that scene is rotating if both current and prev buttons are pressed --- scene.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene.js b/scene.js index 62e7162..b59ca52 100644 --- a/scene.js +++ b/scene.js @@ -337,6 +337,7 @@ function createScene(options) { var numPick = pickBuffers.length var numObjs = objects.length var prevObj = selection.object + selection.distance = Infinity selection.mouse[0] = x selection.mouse[1] = y @@ -346,7 +347,7 @@ function createScene(options) { var change = false - if(buttons) { + if(buttons && prevButtons) { mouseRotating = true } else { if(mouseRotating) { From 9b11fe93784d756e30f1dc499a369dbc733f33b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Fri, 5 Feb 2016 14:10:07 -0500 Subject: [PATCH 2/2] pass buttons to selection object --- scene.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene.js b/scene.js index b59ca52..58d2a1d 100644 --- a/scene.js +++ b/scene.js @@ -368,6 +368,7 @@ function createScene(options) { } var objPick = obj.pick(result) if(objPick) { + selection.buttons = buttons selection.screen = result.coord selection.distance = result.distance selection.object = obj @@ -381,6 +382,7 @@ function createScene(options) { } } } + if(prevObj && prevObj !== selection.object) { if(prevObj.highlight) { prevObj.highlight(null)