mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
one hand teleprt
This commit is contained in:
parent
7fae7e9c77
commit
41aa485f11
2 changed files with 27 additions and 9 deletions
|
@ -1378,7 +1378,7 @@ function MyController(hand) {
|
|||
};
|
||||
|
||||
this.distanceHoldingEnter = function() {
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','disable');
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','both');
|
||||
this.clearEquipHaptics();
|
||||
|
||||
// controller pose is in avatar frame
|
||||
|
@ -1636,8 +1636,14 @@ function MyController(hand) {
|
|||
};
|
||||
|
||||
this.nearGrabbingEnter = function() {
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','disable');
|
||||
if (this.hand === 0) {
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler', 'left');
|
||||
|
||||
}
|
||||
if (this.hand === 1) {
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler', 'right');
|
||||
|
||||
}
|
||||
this.lineOff();
|
||||
this.overlayLineOff();
|
||||
|
||||
|
@ -1964,7 +1970,7 @@ function MyController(hand) {
|
|||
};
|
||||
|
||||
this.release = function() {
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','enable');
|
||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','none');
|
||||
this.turnOffVisualizations();
|
||||
|
||||
var noVelocity = false;
|
||||
|
|
|
@ -239,11 +239,14 @@ function Teleporter() {
|
|||
|
||||
|
||||
this.update = function() {
|
||||
if (isDisabled) {
|
||||
if (isDisabled === 'both') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (teleporter.teleportHand === 'left') {
|
||||
if (isDisabled === 'left') {
|
||||
return;
|
||||
}
|
||||
teleporter.leftRay();
|
||||
//|| leftTrigger.buttonValue === 0
|
||||
if ((leftPad.buttonValue === 0) && inTeleportMode === true) {
|
||||
|
@ -252,6 +255,9 @@ function Teleporter() {
|
|||
}
|
||||
|
||||
} else {
|
||||
if (isDisabled === 'right') {
|
||||
return;
|
||||
}
|
||||
teleporter.rightRay();
|
||||
//|| rightTrigger.buttonValue === 0
|
||||
if ((rightPad.buttonValue === 0) && inTeleportMode === true) {
|
||||
|
@ -588,7 +594,7 @@ function registerMappings() {
|
|||
teleportMapping.from(Controller.Standard.LeftPrimaryThumb)
|
||||
// .when(leftTrigger.down)
|
||||
.to(function(value) {
|
||||
if (isDisabled === true) {
|
||||
if (isDisabled === 'left' || isDisabled === 'both') {
|
||||
return;
|
||||
}
|
||||
if (activationTimeout !== null) {
|
||||
|
@ -604,7 +610,7 @@ function registerMappings() {
|
|||
teleportMapping.from(Controller.Standard.RightPrimaryThumb)
|
||||
// .when(rightTrigger.down)
|
||||
.to(function(value) {
|
||||
if (isDisabled === true) {
|
||||
if (isDisabled === 'right' || isDisabled === 'both') {
|
||||
return;
|
||||
}
|
||||
if (activationTimeout !== null) {
|
||||
|
@ -669,10 +675,16 @@ var handleHandMessages = function(channel, message, sender) {
|
|||
var data;
|
||||
if (sender === MyAvatar.sessionUUID) {
|
||||
if (channel === 'Hifi-Teleport-Disabler') {
|
||||
if (message === 'disable') {
|
||||
isDisabled = true;
|
||||
if (message === 'both') {
|
||||
isDisabled = 'both';
|
||||
}
|
||||
if (message === 'enable') {
|
||||
if (message === 'left') {
|
||||
isDisabled = 'left';
|
||||
}
|
||||
if (message === 'right') {
|
||||
isDisabled = 'right'
|
||||
}
|
||||
if (message === 'none') {
|
||||
isDisabled = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue