mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 14:33:31 +02:00
Fix constant movement with hydra by adding null zone for thrust
This commit is contained in:
parent
22bee75f7f
commit
2f11501e5b
1 changed files with 6 additions and 1 deletions
|
@ -245,10 +245,15 @@ function handleGrabBehavior(deltaTime) {
|
|||
}
|
||||
|
||||
// Update for joysticks and move button
|
||||
var THRUST_DEAD_ZONE = 0.1;
|
||||
function flyWithHydra(deltaTime) {
|
||||
var thrustJoystickPosition = Controller.getJoystickPosition(THRUST_CONTROLLER);
|
||||
|
||||
if (thrustJoystickPosition.x != 0 || thrustJoystickPosition.y != 0) {
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue