mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 16:43:33 +02:00
only respect release of secondary for hold once pressed
This commit is contained in:
parent
4fcccb5455
commit
ebd347fc15
1 changed files with 12 additions and 2 deletions
|
@ -1470,6 +1470,7 @@ function MyController(hand) {
|
|||
this.grabbedOverlay = null;
|
||||
this.isInitialGrab = false;
|
||||
this.shouldResetParentOnRelease = false;
|
||||
this.preparingHoldRelease = false;
|
||||
|
||||
this.checkForStrayChildren();
|
||||
|
||||
|
@ -2151,10 +2152,19 @@ function MyController(hand) {
|
|||
|
||||
if (this.state == STATE_HOLD) {
|
||||
|
||||
if (this.secondaryReleased()) {
|
||||
if (this.secondarySqueezed()) {
|
||||
// this.secondaryReleased() will always be true when not depressed
|
||||
// so we cannot simply rely on that for release - ensure that the
|
||||
// trigger was first "prepared" by being pushed in before the release
|
||||
this.preparingHoldRelease = true;
|
||||
}
|
||||
|
||||
if (this.preparingHoldRelease && this.secondaryReleased()) {
|
||||
// we have an equipped object and the secondary trigger was released
|
||||
// short-circuit the other checks and release it
|
||||
this.release()
|
||||
this.preparingHoldRelease = false;
|
||||
|
||||
this.release();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue