Light rotation shortcut

This commit is contained in:
luboslenco
2019-05-27 22:48:11 +02:00
parent d5df57f874
commit 72b8361087
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -14,6 +14,7 @@ class Config {
C.keymap = {};
C.keymap.action_paint = "left";
C.keymap.action_rotate = "right";
C.keymap.action_rotate_light = "shift+middle";
C.keymap.action_pan = "middle";
C.keymap.select_material = "shift+num";
C.keymap.cycle_layers = "ctrl+tab";
+8 -1
View File
@@ -44,7 +44,14 @@ class OrbitCamera extends iron.Trait {
if (mouse.down("middle") || (mouse.down("right") && kb.down("space"))) {
redraws = 2;
if (kb.down("control")) {
if (kb.down("shift")) {
var light = iron.Scene.active.lights[0];
var m = iron.math.Mat4.identity();
m.self = kha.math.FastMatrix4.rotationZ(mouse.movementX / 100);
light.transform.local.multmat(m);
light.transform.decompose();
}
else if (kb.down("control")) {
var f = mouse.movementX / 75;
camera.transform.move(camera.look(), f);
dist -= f;