always unequip on secondary release

This commit is contained in:
Stephen Birarda 2016-12-20 14:25:26 -08:00
parent 0a024616cc
commit 8cd13eaedf

View file

@ -1062,17 +1062,6 @@ function MyController(hand) {
this.secondaryPress = function(value) {
_this.rawSecondaryValue = value;
if (_this.state == STATE_HOLD && !this.secondaryHeldEquip) {
// when using the index trigger click equip
// any click on the middle finger trigger should release
// check if the middle finger trigger is pressed past the threshold
var allowReleaseValue = 0.1;
if (value > allowReleaseValue) {
_this.release();
}
}
};
this.updateSmoothedTrigger = function() {
@ -1101,9 +1090,9 @@ function MyController(hand) {
this.secondaryReleased = function() {
return _this.rawSecondaryValue < BUMPER_ON_VALUE;
if (_this.state == STATE_HOLD && this.secondaryHeldEquip) {
// when using the middle finger hold equip, the equip is
// dropped when the middle finger trigger is released
if (_this.state == STATE_HOLD) {
// if we were holding something, the release of the
// secondary trigger releases it
_this.release();
}
};
@ -1514,9 +1503,6 @@ function MyController(hand) {
this.grabbedEntity = potentialEquipHotspot.entityID;
this.setState(STATE_HOLD, "equipping '" + entityPropertiesCache.getProps(this.grabbedEntity).name + "'");
// handle the Oculus Touch equip where the middle finger trigger is held
this.secondaryHeldEquip = this.secondarySqueezed && !this.triggerSmoothedGrab;
return;
}
}