add keyboard exact rotation inputs

This commit is contained in:
Stewart Allen 2017-06-08 08:49:48 -04:00
commit 1aa73ac60b
2 changed files with 18 additions and 1 deletions

View file

@ -2519,6 +2519,9 @@ self.kiri.license = exports.LICENSE;
case cca('P'): // position widget
positionSelection();
break;
case cca('R'): // position widget
rotateInputSelection();
break;
case cca('x'): // export print
exportPrint();
break;
@ -2582,6 +2585,20 @@ self.kiri.license = exports.LICENSE;
}
}
function rotateInputSelection() {
if (selectedMeshes.length === 0) {
alert("select object to rotate");
return;
}
var coord = prompt("Enter X,Y,Z degrees of rotation").split(','),
prod = Math.PI / 360,
x = parseFloat(coord[0] || 0.0) * prod,
y = parseFloat(coord[1] || 0.0) * prod,
z = parseFloat(coord[2] || 0.0) * prod;
rotateSelection(x, y, z);
}
function positionSelection() {
if (selectedMeshes.length === 0) {
alert("select object to position");

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
VERSION:"1.0.61"
VERSION:"1.0.62"
};
if (!module) var module = {};
module.exports = exports;