diff options
Diffstat (limited to 'assets/javascripts/mx/extensions/mx.movements.js')
| -rw-r--r-- | assets/javascripts/mx/extensions/mx.movements.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/assets/javascripts/mx/extensions/mx.movements.js b/assets/javascripts/mx/extensions/mx.movements.js index 6837637..cb6af14 100644 --- a/assets/javascripts/mx/extensions/mx.movements.js +++ b/assets/javascripts/mx/extensions/mx.movements.js @@ -24,6 +24,8 @@ MX.Movements = function (cam, viewHeight) { creepFactor = 0.3 var DEFAULT_SCALE = scale = 1.0 + + var pos = { x: 0, y: 0, z: 0, rotationX: 0, rotationY: 0 } return { @@ -193,6 +195,10 @@ MX.Movements = function (cam, viewHeight) { var ry = cam.rotationY var s = creeping ? scale * creepFactor : scale var vrrrr = creeping ? vr * creepFactor * 5 : vr + + pos.x = cam.x + pos.y = cam.y + pos.z = cam.z if (moveForward || moveBackward || moveRight || moveLeft || moveUp || moveDown || turnLeft || turnRight || turnUp || turnDown) { @@ -234,12 +240,12 @@ MX.Movements = function (cam, viewHeight) { cam.rotationY -= vrrrr } - cam.x += vx - cam.y += vy - cam.z += vz + pos.x += vx + pos.y += vy + pos.z += vz if (vx || vz) { - app.tube("move", cam) + app.tube("move", pos) } } |
