diff options
| author | Julie Lala <jules@okfoc.us> | 2014-10-16 04:40:53 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-10-16 04:40:53 -0400 |
| commit | 1a15b32d8cc8fcf27861f94151ca63eb6d8736c2 (patch) | |
| tree | 5d4804e0be7a09c2bf4352e8affeea899de47ab7 /public/assets/javascripts/mx | |
| parent | 37851cbd12dcb17be77265164876184019d34602 (diff) | |
fix clone button, add urls you paste to your wallpaper
Diffstat (limited to 'public/assets/javascripts/mx')
| -rw-r--r-- | public/assets/javascripts/mx/extensions/mx.movements.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/public/assets/javascripts/mx/extensions/mx.movements.js b/public/assets/javascripts/mx/extensions/mx.movements.js index c2a2473..386819a 100644 --- a/public/assets/javascripts/mx/extensions/mx.movements.js +++ b/public/assets/javascripts/mx/extensions/mx.movements.js @@ -34,6 +34,14 @@ MX.Movements = function (cam) { var pos = { x: 0, y: 0, z: 0, rotationX: 0, rotationY: 0 } $(document).one("keydown", function(){ $("#keyhint").fadeOut(250) }) + function clampRotation( vr ) { + if (Rooms.mover.noclip) { + return clamp(vr, PI/-2, PI/2 ) + } + else { + return clamp(vr, PI/-4, PI/6 ) + } + } var exports = { @@ -224,7 +232,7 @@ MX.Movements = function (cam) { var dx = (e.pageX - mouseX) / window.innerWidth * Math.PI/3 var dy = (e.pageY - mouseY) / window.innerHeight * Math.PI/3 cam.rotationY = rotY + dx - cam.rotationX = clamp( rotX - dy, rotationX_min, rotationX_max ) + cam.rotationX = clampRotation( rotX - dy ) }, mouseup: function (e) { @@ -285,10 +293,10 @@ MX.Movements = function (cam) { } if (turnUp) { - cam.rotationX = clamp( cam.rotationX - vrrrr*s, rotationX_min, rotationX_max) + cam.rotationX = clampRotation( cam.rotationX - vrrrr*s ) } if (turnDown) { - cam.rotationX = clamp( cam.rotationX + vrrrr*s, rotationX_min, rotationX_max) + cam.rotationX = clampRotation( cam.rotationX + vrrrr*s ) } if (turnLeft) { cam.rotationY += vrrrr*s |
