From 1ce201c04f9b93a17dc43ee6464dbbac809997a8 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Tue, 2 Dec 2014 14:33:19 -0800 Subject: [PATCH] add same for rotation --- examples/hydraMove.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/hydraMove.js b/examples/hydraMove.js index f469fbbe74..46715839c3 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -246,13 +246,10 @@ function handleGrabBehavior(deltaTime) { // Update for joysticks and move button var THRUST_DEAD_ZONE = 0.1; +var ROTATE_DEAD_ZONE = 0.1; function flyWithHydra(deltaTime) { var thrustJoystickPosition = Controller.getJoystickPosition(THRUST_CONTROLLER); - if (debug) { - print("thrust X: " + thrustJoystickPosition.x + " Y: " + thrustJoystickPosition.y); - } - if (Math.abs(thrustJoystickPosition.x) > THRUST_DEAD_ZONE || Math.abs(thrustJoystickPosition.y) > THRUST_DEAD_ZONE) { if (thrustMultiplier < MAX_THRUST_MULTIPLIER) { thrustMultiplier *= 1 + (deltaTime * THRUST_INCREASE_RATE); @@ -275,7 +272,7 @@ function flyWithHydra(deltaTime) { // View Controller var viewJoystickPosition = Controller.getJoystickPosition(VIEW_CONTROLLER); - if (viewJoystickPosition.x != 0 || viewJoystickPosition.y != 0) { + if (Math.abs(viewJoystickPosition.x) > ROTATE_DEAD_ZONE || Math.abs(viewJoystickPosition.y) > ROTATE_DEAD_ZONE) { // change the body yaw based on our x controller var orientation = MyAvatar.orientation;