summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/sculpture/move.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/sculpture/move.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/sculpture/move.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/move.js b/public/assets/javascripts/rectangles/engine/sculpture/move.js
index 4f6d176..e571c3b 100644
--- a/public/assets/javascripts/rectangles/engine/sculpture/move.js
+++ b/public/assets/javascripts/rectangles/engine/sculpture/move.js
@@ -2,7 +2,8 @@
Sculpture.move = function(base){
var x, y, z, position, dimension, bounds
- var dragging = false, shiftPressed = false, moved = false
+ var rotationY
+ var dragging = false, altPressed = false, shiftPressed = false, moved = false
var oldState
var height, width
@@ -40,12 +41,14 @@ Sculpture.move = function(base){
e.clickAccepted = false
return
}
+ altPressed = (e.altKey && ! base.billboard)
shiftPressed = e.shiftKey
dragging = true
moved = false
x = base.mx.x
y = base.mx.y
z = base.mx.z
+ rotationY = base.mx.rotationY
height = base.mx.height * base.mx.scale
bounds = base.bounds
@@ -66,9 +69,13 @@ Sculpture.move = function(base){
// here we need to move the element based on the XY coords, as
// base.mx.y = position.b + delta.b + dimension.b / 2
- if (e.shiftKey) {
+ if (shiftPressed) {
base.mx.y = clamp( y + delta.b, height/2 + sculpture_distance_from_floor, Infinity )
}
+ else if (altPressed) {
+ base.mx.rotationY = mod( rotationY + delta.a / (window.innerWidth / 2) , TWO_PI )
+ Sculpture.resize.move_dots()
+ }
else {
base.mx.x = x + delta.a * cos(cam.rotationY) - delta.b * sin(cam.rotationY)
base.mx.z = z + delta.a * sin(cam.rotationY) + delta.b * cos(cam.rotationY)