mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 03:24:07 +02:00
make thumb and trigger work in any order and on either button released
This commit is contained in:
parent
71392bc1b2
commit
7fa1dc7053
1 changed files with 11 additions and 13 deletions
|
@ -55,7 +55,7 @@ var SMOOTH_ARRIVAL_SPACING = 0;
|
|||
// var NUMBER_OF_STEPS = 20;
|
||||
|
||||
|
||||
var USE_THUMB_AND_TRIGGER_MODE = false;
|
||||
var USE_THUMB_AND_TRIGGER_MODE = true;
|
||||
|
||||
var TARGET_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/james/teleporter/target.fbx';
|
||||
var TARGET_MODEL_DIMENSIONS = {
|
||||
|
@ -299,24 +299,16 @@ function Teleporter() {
|
|||
|
||||
if (teleporter.teleportHand === 'left') {
|
||||
teleporter.leftRay();
|
||||
if (leftPad.buttonValue === 0) {
|
||||
_this.exitTeleportMode();
|
||||
_this.deleteTargetOverlay();
|
||||
return;
|
||||
}
|
||||
if (leftTrigger.buttonValue === 0 && inTeleportMode === true) {
|
||||
|
||||
if ((leftPad.buttonValue === 0 || leftTrigger.buttonValue === 0) && inTeleportMode === true) {
|
||||
_this.teleport();
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
teleporter.rightRay();
|
||||
if (rightPad.buttonValue === 0) {
|
||||
_this.exitTeleportMode();
|
||||
_this.deleteTargetOverlay();
|
||||
return;
|
||||
}
|
||||
if (rightTrigger.buttonValue === 0 && inTeleportMode === true) {
|
||||
|
||||
if ((rightPad.buttonValue === 0 || rightTrigger.buttonValue === 0) && inTeleportMode === true) {
|
||||
_this.teleport();
|
||||
return;
|
||||
}
|
||||
|
@ -694,6 +686,12 @@ function registerMappingsWithThumbAndTrigger() {
|
|||
teleportMapping.from(rightPad.down).when(rightTrigger.down).to(function(value) {
|
||||
teleporter.enterTeleportMode('right')
|
||||
});
|
||||
teleportMapping.from(leftTrigger.down).when(leftPad.down).to(function(value) {
|
||||
teleporter.enterTeleportMode('left')
|
||||
});
|
||||
teleportMapping.from(rightTrigger.down).when(rightPad.down).to(function(value) {
|
||||
teleporter.enterTeleportMode('right')
|
||||
});
|
||||
}
|
||||
|
||||
if (USE_THUMB_AND_TRIGGER_MODE === true) {
|
||||
|
|
Loading…
Reference in a new issue