mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:23:09 +02:00
if a hand is disabled while holding something, release it
This commit is contained in:
parent
dd7e25441c
commit
b1eb4c361d
1 changed files with 14 additions and 10 deletions
|
@ -1595,7 +1595,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.distanceHoldingEnter = function() {
|
this.distanceHoldingEnter = function() {
|
||||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','both');
|
Messages.sendLocalMessage('Hifi-Teleport-Disabler', 'both');
|
||||||
this.clearEquipHaptics();
|
this.clearEquipHaptics();
|
||||||
this.grabPointSphereOff();
|
this.grabPointSphereOff();
|
||||||
|
|
||||||
|
@ -2308,7 +2308,7 @@ function MyController(hand) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.release = function() {
|
this.release = function() {
|
||||||
Messages.sendLocalMessage('Hifi-Teleport-Disabler','none');
|
Messages.sendLocalMessage('Hifi-Teleport-Disabler', 'none');
|
||||||
this.turnOffVisualizations();
|
this.turnOffVisualizations();
|
||||||
|
|
||||||
var noVelocity = false;
|
var noVelocity = false;
|
||||||
|
@ -2334,17 +2334,17 @@ function MyController(hand) {
|
||||||
noVelocity = true;
|
noVelocity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.deactivateEntity(this.grabbedEntity, noVelocity);
|
||||||
|
|
||||||
|
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
||||||
|
action: 'release',
|
||||||
|
grabbedEntity: this.grabbedEntity,
|
||||||
|
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.deactivateEntity(this.grabbedEntity, noVelocity);
|
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
|
|
||||||
Messages.sendMessage('Hifi-Object-Manipulation', JSON.stringify({
|
|
||||||
action: 'release',
|
|
||||||
grabbedEntity: this.grabbedEntity,
|
|
||||||
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.grabbedEntity = null;
|
this.grabbedEntity = null;
|
||||||
this.grabbedHotspot = null;
|
this.grabbedHotspot = null;
|
||||||
|
|
||||||
|
@ -2644,9 +2644,13 @@ function update(deltaTime) {
|
||||||
|
|
||||||
if (handToDisable !== LEFT_HAND && handToDisable !== 'both') {
|
if (handToDisable !== LEFT_HAND && handToDisable !== 'both') {
|
||||||
leftController.update(deltaTime, timestamp);
|
leftController.update(deltaTime, timestamp);
|
||||||
|
} else {
|
||||||
|
leftController.release();
|
||||||
}
|
}
|
||||||
if (handToDisable !== RIGHT_HAND && handToDisable !== 'both') {
|
if (handToDisable !== RIGHT_HAND && handToDisable !== 'both') {
|
||||||
rightController.update(deltaTime, timestamp);
|
rightController.update(deltaTime, timestamp);
|
||||||
|
} else {
|
||||||
|
rightController.release();
|
||||||
}
|
}
|
||||||
equipHotspotBuddy.update(deltaTime, timestamp);
|
equipHotspotBuddy.update(deltaTime, timestamp);
|
||||||
entityPropertiesCache.update();
|
entityPropertiesCache.update();
|
||||||
|
|
Loading…
Reference in a new issue