mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:37:35 +02:00
fix far-trigger
This commit is contained in:
parent
38430d8d2c
commit
69caf1df4d
1 changed files with 9 additions and 6 deletions
|
@ -921,7 +921,8 @@ function MyController(hand) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE && !near) {
|
if (this.state == STATE_SEARCHING &&
|
||||||
|
!isPhysical && distance > NEAR_PICK_MAX_DISTANCE && !near && !grabbableDataForCandidate.wantsTrigger) {
|
||||||
// we can't distance-grab non-physical
|
// we can't distance-grab non-physical
|
||||||
if (WANT_DEBUG_SEARCH_NAME && propsForCandidate.name == WANT_DEBUG_SEARCH_NAME) {
|
if (WANT_DEBUG_SEARCH_NAME && propsForCandidate.name == WANT_DEBUG_SEARCH_NAME) {
|
||||||
print("grab is skipping '" + WANT_DEBUG_SEARCH_NAME + "': not physical and too far for near-grab");
|
print("grab is skipping '" + WANT_DEBUG_SEARCH_NAME + "': not physical and too far for near-grab");
|
||||||
|
@ -1543,11 +1544,13 @@ function MyController(hand) {
|
||||||
var now = Date.now();
|
var now = Date.now();
|
||||||
if (now - this.lastPickTime > MSECS_PER_SEC / PICKS_PER_SECOND_PER_HAND) {
|
if (now - this.lastPickTime > MSECS_PER_SEC / PICKS_PER_SECOND_PER_HAND) {
|
||||||
var intersection = Entities.findRayIntersection(pickRay, true);
|
var intersection = Entities.findRayIntersection(pickRay, true);
|
||||||
this.lastPickTime = now;
|
if (intersection.accurate) {
|
||||||
if (intersection.entityID != this.grabbedEntity) {
|
this.lastPickTime = now;
|
||||||
this.setState(STATE_RELEASE);
|
if (intersection.entityID != this.grabbedEntity) {
|
||||||
this.callEntityMethodOnGrabbed("stopFarTrigger");
|
this.setState(STATE_RELEASE);
|
||||||
return;
|
this.callEntityMethodOnGrabbed("stopFarTrigger");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue