mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:18:05 +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) {
|
this.startNearParentingGrabEntity = function (controllerData, targetProps) {
|
||||||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||||
unhighlightTargetEntity(this.targetEntityID);
|
unhighlightTargetEntity(this.targetEntityID);
|
||||||
|
this.highlightedEntity = null;
|
||||||
var message = {
|
var message = {
|
||||||
hand: this.hand,
|
hand: this.hand,
|
||||||
entityID: this.targetEntityID
|
entityID: this.targetEntityID
|
||||||
|
@ -177,6 +178,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
||||||
}));
|
}));
|
||||||
unhighlightTargetEntity(this.targetEntityID);
|
unhighlightTargetEntity(this.targetEntityID);
|
||||||
|
this.highlightedEntity = null;
|
||||||
this.grabbing = false;
|
this.grabbing = false;
|
||||||
this.targetEntityID = null;
|
this.targetEntityID = null;
|
||||||
this.robbed = false;
|
this.robbed = false;
|
||||||
|
@ -304,6 +306,10 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
return makeRunningValues(true, [this.targetEntityID], []);
|
return makeRunningValues(true, [this.targetEntityID], []);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (this.highlightedEntity) {
|
||||||
|
unhighlightTargetEntity(this.highlightedEntity);
|
||||||
|
this.highlightedEntity = null;
|
||||||
|
}
|
||||||
this.hapticTargetID = null;
|
this.hapticTargetID = null;
|
||||||
this.robbed = false;
|
this.robbed = false;
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
|
@ -322,6 +328,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
if (!props) {
|
if (!props) {
|
||||||
// entity was deleted
|
// entity was deleted
|
||||||
unhighlightTargetEntity(this.targetEntityID);
|
unhighlightTargetEntity(this.targetEntityID);
|
||||||
|
this.highlightedEntity = NULL;
|
||||||
this.grabbing = false;
|
this.grabbing = false;
|
||||||
this.targetEntityID = null;
|
this.targetEntityID = null;
|
||||||
this.hapticTargetID = null;
|
this.hapticTargetID = null;
|
||||||
|
@ -344,6 +351,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
if (!readiness.active) {
|
if (!readiness.active) {
|
||||||
this.robbed = false;
|
this.robbed = false;
|
||||||
unhighlightTargetEntity(this.highlightedEntity);
|
unhighlightTargetEntity(this.highlightedEntity);
|
||||||
|
this.highlightedEntity = null;
|
||||||
return readiness;
|
return readiness;
|
||||||
}
|
}
|
||||||
if (controllerData.triggerClicks[this.hand] || controllerData.secondaryValues[this.hand] > BUMPER_ON_VALUE) {
|
if (controllerData.triggerClicks[this.hand] || controllerData.secondaryValues[this.hand] > BUMPER_ON_VALUE) {
|
||||||
|
|
Loading…
Reference in a new issue