mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 09:09:53 +02:00
updates
This commit is contained in:
parent
6a72fe7df4
commit
a7b8f2c9df
4 changed files with 90 additions and 24 deletions
|
@ -26,8 +26,7 @@
|
||||||
|
|
||||||
{ "from": [ "Hydra.L1", "Hydra.L3" ], "to": "Standard.LeftPrimaryThumb" },
|
{ "from": [ "Hydra.L1", "Hydra.L3" ], "to": "Standard.LeftPrimaryThumb" },
|
||||||
{ "from": [ "Hydra.R1", "Hydra.R3" ], "to": "Standard.RightPrimaryThumb" },
|
{ "from": [ "Hydra.R1", "Hydra.R3" ], "to": "Standard.RightPrimaryThumb" },
|
||||||
{ "from": [ "Hydra.R2", "Hydra.R4" ], "to": "Standard.RightSecondaryThumb" },
|
|
||||||
{ "from": [ "Hydra.L2", "Hydra.L4" ], "to": "Standard.LeftSecondaryThumb" },
|
|
||||||
|
|
||||||
{ "from": "Hydra.LeftHand", "to": "Standard.LeftHand" },
|
{ "from": "Hydra.LeftHand", "to": "Standard.LeftHand" },
|
||||||
{ "from": "Hydra.RightHand", "to": "Standard.RightHand" }
|
{ "from": "Hydra.RightHand", "to": "Standard.RightHand" }
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
"channels": [
|
"channels": [
|
||||||
{ "from": "OculusTouch.A", "to": "Standard.RightPrimaryThumb" },
|
{ "from": "OculusTouch.A", "to": "Standard.RightPrimaryThumb" },
|
||||||
{ "from": "OculusTouch.B", "to": "Standard.RightSecondaryThumb" },
|
{ "from": "OculusTouch.B", "to": "Standard.RightSecondaryThumb" },
|
||||||
{ "from": "OculusTouch.X", "to": "Standard.LeftPrimaryThumb" },
|
// { "from": "OculusTouch.X", "to": "Standard.LeftPrimaryThumb" },
|
||||||
{ "from": "OculusTouch.Y", "to": "Standard.LeftSecondaryThumb" },
|
// { "from": "OculusTouch.Y", "to": "Standard.LeftSecondaryThumb" },
|
||||||
|
|
||||||
{ "from": "OculusTouch.LY", "filters": "invert", "to": "Standard.LY" },
|
{ "from": "OculusTouch.LY", "filters": "invert", "to": "Standard.LY" },
|
||||||
{ "from": "OculusTouch.LX", "to": "Standard.LX" },
|
{ "from": "OculusTouch.LX", "to": "Standard.LX" },
|
||||||
|
|
|
@ -1365,7 +1365,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.distanceHoldingEnter = function() {
|
this.distanceHoldingEnter = function() {
|
||||||
|
Messages.sendLocalMessage('Hifi-Teleport-Disabler','disable');
|
||||||
this.clearEquipHaptics();
|
this.clearEquipHaptics();
|
||||||
|
|
||||||
// controller pose is in avatar frame
|
// controller pose is in avatar frame
|
||||||
|
@ -1620,6 +1620,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.nearGrabbingEnter = function() {
|
this.nearGrabbingEnter = function() {
|
||||||
|
Messages.sendLocalMessage('Hifi-Teleport-Disabler','disable');
|
||||||
|
|
||||||
this.lineOff();
|
this.lineOff();
|
||||||
this.overlayLineOff();
|
this.overlayLineOff();
|
||||||
|
@ -1947,6 +1948,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.release = function() {
|
this.release = function() {
|
||||||
|
Messages.sendLocalMessage('Hifi-Teleport-Disabler','enable');
|
||||||
this.turnOffVisualizations();
|
this.turnOffVisualizations();
|
||||||
|
|
||||||
var noVelocity = false;
|
var noVelocity = false;
|
||||||
|
|
|
@ -239,19 +239,22 @@ function Teleporter() {
|
||||||
|
|
||||||
|
|
||||||
this.update = function() {
|
this.update = function() {
|
||||||
|
if (isDisabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (teleporter.teleportHand === 'left') {
|
if (teleporter.teleportHand === 'left') {
|
||||||
teleporter.leftRay();
|
teleporter.leftRay();
|
||||||
|
//|| leftTrigger.buttonValue === 0
|
||||||
if ((leftPad.buttonValue === 0 || leftTrigger.buttonValue === 0) && inTeleportMode === true) {
|
if ((leftPad.buttonValue === 0 ) && inTeleportMode === true) {
|
||||||
_this.teleport();
|
_this.teleport();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
teleporter.rightRay();
|
teleporter.rightRay();
|
||||||
|
//|| rightTrigger.buttonValue === 0
|
||||||
if ((rightPad.buttonValue === 0 || rightTrigger.buttonValue === 0) && inTeleportMode === true) {
|
if ((rightPad.buttonValue === 0 ) && inTeleportMode === true) {
|
||||||
_this.teleport();
|
_this.teleport();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -570,8 +573,8 @@ var rightTrigger = new Trigger('right');
|
||||||
|
|
||||||
var mappingName, teleportMapping;
|
var mappingName, teleportMapping;
|
||||||
|
|
||||||
var TELEPORT_DELAY = 100;
|
var activationTimeout = null;
|
||||||
|
var TELEPORT_DELAY = 800;
|
||||||
|
|
||||||
function registerMappings() {
|
function registerMappings() {
|
||||||
mappingName = 'Hifi-Teleporter-Dev-' + Math.random();
|
mappingName = 'Hifi-Teleporter-Dev-' + Math.random();
|
||||||
|
@ -582,22 +585,63 @@ function registerMappings() {
|
||||||
teleportMapping.from(Controller.Standard.RightPrimaryThumb).peek().to(rightPad.buttonPress);
|
teleportMapping.from(Controller.Standard.RightPrimaryThumb).peek().to(rightPad.buttonPress);
|
||||||
teleportMapping.from(Controller.Standard.LeftPrimaryThumb).peek().to(leftPad.buttonPress);
|
teleportMapping.from(Controller.Standard.LeftPrimaryThumb).peek().to(leftPad.buttonPress);
|
||||||
|
|
||||||
teleportMapping.from(Controller.Standard.LeftPrimaryThumb).when(leftTrigger.down).to(function(value) {
|
teleportMapping.from(Controller.Standard.LeftPrimaryThumb)
|
||||||
teleporter.enterTeleportMode('left')
|
// .when(leftTrigger.down)
|
||||||
|
.to(function(value) {
|
||||||
|
if (isDisabled === true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (activationTimeout !== null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
activationTimeout = Script.setTimeout(function() {
|
||||||
|
teleporter.enterTeleportMode('left')
|
||||||
|
Script.clearTimeout(activationTimeout);
|
||||||
|
activationTimeout = null;
|
||||||
|
}, TELEPORT_DELAY)
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
teleportMapping.from(Controller.Standard.RightPrimaryThumb).when(rightTrigger.down).to(function(value) {
|
teleportMapping.from(Controller.Standard.RightPrimaryThumb)
|
||||||
teleporter.enterTeleportMode('right')
|
// .when(rightTrigger.down)
|
||||||
return;
|
.to(function(value) {
|
||||||
});
|
if (isDisabled === true) {
|
||||||
teleportMapping.from(Controller.Standard.RT).when(Controller.Standard.RightPrimaryThumb).to(function(value) {
|
return;
|
||||||
teleporter.enterTeleportMode('right')
|
}
|
||||||
return;
|
if (activationTimeout !== null) {
|
||||||
});
|
return
|
||||||
teleportMapping.from(Controller.Standard.LT).when(Controller.Standard.LeftPrimaryThumb).to(function(value) {
|
}
|
||||||
teleporter.enterTeleportMode('left')
|
activationTimeout = Script.setTimeout(function() {
|
||||||
|
teleporter.enterTeleportMode('right')
|
||||||
|
Script.clearTimeout(activationTimeout);
|
||||||
|
activationTimeout = null;
|
||||||
|
}, TELEPORT_DELAY)
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
// teleportMapping.from(Controller.Standard.RT).when(Controller.Standard.RightPrimaryThumb).to(function(value) {
|
||||||
|
// if (isDisabled === true) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// if (activationTimeout !== null) {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// activationTimeout = Script.setTimeout(function() {
|
||||||
|
// teleporter.enterTeleportMode('right')
|
||||||
|
// Script.clearTimeout(activationTimeout);
|
||||||
|
// activationTimeout = null;
|
||||||
|
// }, TELEPORT_DELAY)
|
||||||
|
// return;
|
||||||
|
// });
|
||||||
|
// teleportMapping.from(Controller.Standard.LT).when(Controller.Standard.LeftPrimaryThumb).to(function(value) {
|
||||||
|
// if (isDisabled === true) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// activationTimeout = Script.setTimeout(function() {
|
||||||
|
// teleporter.enterTeleportMode('left')
|
||||||
|
// Script.clearTimeout(activationTimeout);
|
||||||
|
// activationTimeout = null;
|
||||||
|
// }, TELEPORT_DELAY)
|
||||||
|
// return;
|
||||||
|
// });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,4 +662,25 @@ function cleanup() {
|
||||||
if (teleporter.updateConnected !== null) {
|
if (teleporter.updateConnected !== null) {
|
||||||
Script.update.disconnect(teleporter.update);
|
Script.update.disconnect(teleporter.update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isDisabled = false;
|
||||||
|
var handleHandMessages = function(channel, message, sender) {
|
||||||
|
var data;
|
||||||
|
print('its a message')
|
||||||
|
if (sender === MyAvatar.sessionUUID) {
|
||||||
|
if (channel === 'Hifi-Teleport-Disabler') {
|
||||||
|
print('got teleport disabler message' + message)
|
||||||
|
if (message === 'disable') {
|
||||||
|
isDisabled = true;
|
||||||
|
}
|
||||||
|
if (message === 'enable') {
|
||||||
|
isDisabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Messages.subscribe('Hifi-Teleport-Disabler');
|
||||||
|
Messages.messageReceived.connect(handleHandMessages);
|
Loading…
Reference in a new issue