mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
add same for rotation
This commit is contained in:
parent
2f11501e5b
commit
1ce201c04f
1 changed files with 2 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue