release near and far grab at trigger click detent

This commit is contained in:
Eric Levin 2016-07-28 08:51:11 -07:00
parent f37570dc9a
commit 5167809342

View file

@ -1443,7 +1443,8 @@ function MyController(hand) {
};
this.distanceHolding = function(deltaTime, timestamp) {
if (this.triggerSmoothedReleased()) {
if (!this.triggerClicked) {
this.callEntityMethodOnGrabbed("releaseGrab");
this.setState(STATE_OFF, "trigger released");
return;
@ -1761,7 +1762,7 @@ function MyController(hand) {
this.nearGrabbing = function(deltaTime, timestamp) {
if (this.state == STATE_NEAR_GRABBING && this.triggerSmoothedReleased()) {
if (this.state == STATE_NEAR_GRABBING && !this.triggerClicked) {
this.callEntityMethodOnGrabbed("releaseGrab");
this.setState(STATE_OFF, "trigger released");
return;