check for release of equip in this.nearGrabbing

This commit is contained in:
Stephen Birarda 2016-12-20 14:32:47 -08:00
parent c3d736dd16
commit 4fcccb5455

View file

@ -1088,15 +1088,7 @@ function MyController(hand) {
};
this.secondaryReleased = function() {
var released = _this.rawSecondaryValue < BUMPER_ON_VALUE;
if (released) {
// if we were holding something, the release of the
// secondary trigger releases it
_this.release();
}
return released;
return _this.rawSecondaryValue < BUMPER_ON_VALUE;
};
// this.triggerOrsecondarySqueezed = function () {
@ -2159,6 +2151,13 @@ function MyController(hand) {
if (this.state == STATE_HOLD) {
if (this.secondaryReleased()) {
// we have an equipped object and the secondary trigger was released
// short-circuit the other checks and release it
this.release()
return;
}
var dropDetected = this.dropGestureProcess(deltaTime);
if (this.triggerSmoothedReleased()) {