mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
if an entity already was near-picked, don't do a distance-to-center check on it.
This commit is contained in:
parent
90d81bc17b
commit
ca5525cc3f
1 changed files with 2 additions and 1 deletions
|
@ -855,6 +855,7 @@ function MyController(hand) {
|
|||
getEntityCustomData(GRABBABLE_DATA_KEY, candidateEntities[i], DEFAULT_GRABBABLE_DATA);
|
||||
var grabDataForCandidate = getEntityCustomData(GRAB_USER_DATA_KEY, candidateEntities[i], {});
|
||||
var propsForCandidate = Entities.getEntityProperties(candidateEntities[i], GRABBABLE_PROPERTIES);
|
||||
var near = (nearPickedCandidateEntities.indexOf(candidateEntities[i]) >= 0);
|
||||
|
||||
var isPhysical = this.propsArePhysical(propsForCandidate);
|
||||
var grabbable;
|
||||
|
@ -916,7 +917,7 @@ function MyController(hand) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE) {
|
||||
if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE && !near) {
|
||||
// we can't distance-grab non-physical
|
||||
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");
|
||||
|
|
Loading…
Reference in a new issue