mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Fix entity stay highlighted after hand leaves when far grabbing another
This commit is contained in:
parent
7dd80d0180
commit
c9c23b8db3
1 changed files with 8 additions and 0 deletions
|
@ -100,6 +100,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
this.startNearParentingGrabEntity = function (controllerData, targetProps) {
|
||||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||
unhighlightTargetEntity(this.targetEntityID);
|
||||
this.highlightedEntity = null;
|
||||
var message = {
|
||||
hand: this.hand,
|
||||
entityID: this.targetEntityID
|
||||
|
@ -177,6 +178,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
||||
}));
|
||||
unhighlightTargetEntity(this.targetEntityID);
|
||||
this.highlightedEntity = null;
|
||||
this.grabbing = false;
|
||||
this.targetEntityID = null;
|
||||
this.robbed = false;
|
||||
|
@ -304,6 +306,10 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
return makeRunningValues(true, [this.targetEntityID], []);
|
||||
}
|
||||
} else {
|
||||
if (this.highlightedEntity) {
|
||||
unhighlightTargetEntity(this.highlightedEntity);
|
||||
this.highlightedEntity = null;
|
||||
}
|
||||
this.hapticTargetID = null;
|
||||
this.robbed = false;
|
||||
return makeRunningValues(false, [], []);
|
||||
|
@ -322,6 +328,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
if (!props) {
|
||||
// entity was deleted
|
||||
unhighlightTargetEntity(this.targetEntityID);
|
||||
this.highlightedEntity = NULL;
|
||||
this.grabbing = false;
|
||||
this.targetEntityID = null;
|
||||
this.hapticTargetID = null;
|
||||
|
@ -344,6 +351,7 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
if (!readiness.active) {
|
||||
this.robbed = false;
|
||||
unhighlightTargetEntity(this.highlightedEntity);
|
||||
this.highlightedEntity = null;
|
||||
return readiness;
|
||||
}
|
||||
if (controllerData.triggerClicks[this.hand] || controllerData.secondaryValues[this.hand] > BUMPER_ON_VALUE) {
|
||||
|
|
Loading…
Reference in a new issue