diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-04-23 17:43:16 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-04-23 17:43:16 -0400 |
| commit | 1f434dfedae0f57c0b74978a6c5c144e34287501 (patch) | |
| tree | 4eff8ebbc21ac58e0f8aec488b98a7cacc00d569 | |
| parent | 7c82721449b09496ad4e33c04513e4253482f457 (diff) | |
| parent | cff4cde6825a1af9c36fda1467cd118bbdc231eb (diff) | |
Merge branch 'master' of github.com:okfocus/vvalls
| -rw-r--r-- | assets/javascripts/mx/extensions/mx.movements.js | 12 | ||||
| -rw-r--r-- | assets/javascripts/rectangles/map/ui.js | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/assets/javascripts/mx/extensions/mx.movements.js b/assets/javascripts/mx/extensions/mx.movements.js index cb6af14..35a23d0 100644 --- a/assets/javascripts/mx/extensions/mx.movements.js +++ b/assets/javascripts/mx/extensions/mx.movements.js @@ -15,10 +15,12 @@ MX.Movements = function (cam, viewHeight) { jumping = false, creeping = false, locked = false, - gravity = false + gravity = false, + rotationX_min = PI/-2, + rotationX_max = PI/2 var v = 15, - vr = Math.PI * 0.015 + vr = Math.PI * 0.015, jumpV = 23, vx = vy = vz = 0, creepFactor = 0.3 @@ -173,7 +175,7 @@ MX.Movements = function (cam, viewHeight) { 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 = rotX - dy + cam.rotationX = clamp( rotX - dy, rotationX_min, rotationX_max ) }) document.addEventListener('mouseup', function (e) { @@ -228,10 +230,10 @@ MX.Movements = function (cam, viewHeight) { } if (turnUp) { - cam.rotationX -= vrrrr + cam.rotationX = clamp( cam.rotationX - vrrrr, rotationX_min, rotationX_max) } if (turnDown) { - cam.rotationX += vrrrr + cam.rotationX = clamp( cam.rotationX + vrrrr, rotationX_min, rotationX_max) } if (turnLeft) { cam.rotationY += vrrrr diff --git a/assets/javascripts/rectangles/map/ui.js b/assets/javascripts/rectangles/map/ui.js index 4e03125..caa2a81 100644 --- a/assets/javascripts/rectangles/map/ui.js +++ b/assets/javascripts/rectangles/map/ui.js @@ -2,6 +2,8 @@ map.ui = new function(){ var base = this + var height_min = 200, + height_max = 2000 base.creating = base.dragging = false @@ -96,7 +98,7 @@ map.ui = new function(){ }) if (intersects.length) { - intersects[0].height = clamp( ~~(intersects[0].height - delta), 200, 800 ) + intersects[0].height = clamp( ~~(intersects[0].height - delta), height_min, height_max ) clipper.update() } else { |
