mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:48:04 +02:00
Merge pull request #8684 from Menithal/controller-grab-unequip
Fixed HandcontrollerGrab distance unequip
This commit is contained in:
commit
7e4964db3e
1 changed files with 2 additions and 2 deletions
|
@ -2091,12 +2091,12 @@ function MyController(hand) {
|
||||||
var TEAR_AWAY_DISTANCE = 0.1;
|
var TEAR_AWAY_DISTANCE = 0.1;
|
||||||
var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props);
|
var dist = distanceBetweenPointAndEntityBoundingBox(handPosition, props);
|
||||||
if (dist > TEAR_AWAY_DISTANCE) {
|
if (dist > TEAR_AWAY_DISTANCE) {
|
||||||
this.autoUnequipCounter += 1;
|
this.autoUnequipCounter += deltaTime;
|
||||||
} else {
|
} else {
|
||||||
this.autoUnequipCounter = 0;
|
this.autoUnequipCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.autoUnequipCounter > 1) {
|
if (this.autoUnequipCounter > 0.25) {
|
||||||
// for whatever reason, the held/equipped entity has been pulled away. ungrab or unequip.
|
// for whatever reason, the held/equipped entity has been pulled away. ungrab or unequip.
|
||||||
print("handControllerGrab -- autoreleasing held or equipped item because it is far from hand." +
|
print("handControllerGrab -- autoreleasing held or equipped item because it is far from hand." +
|
||||||
props.parentID + ", dist = " + dist);
|
props.parentID + ", dist = " + dist);
|
||||||
|
|
Loading…
Reference in a new issue