mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-07 14:41:20 +02:00
adding fix for far action grab
This commit is contained in:
parent
ea8229fca4
commit
6f9593dabd
1 changed files with 14 additions and 13 deletions
|
@ -336,15 +336,6 @@ Script.include("/~/system/libraries/Xform.js");
|
|||
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
|
||||
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
|
||||
return true;
|
||||
} else if (intersection.type === Picks.INTERSECTED_ENTITY && !Window.isPhysicsEnabled()) {
|
||||
// add to ignored items.
|
||||
var data = {
|
||||
action: 'add',
|
||||
id: intersection.objectID
|
||||
};
|
||||
Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data));
|
||||
this.ignoredEntities.push(intersection.objectID);
|
||||
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
@ -405,7 +396,6 @@ Script.include("/~/system/libraries/Xform.js");
|
|||
this.isReady = function (controllerData) {
|
||||
if (HMD.active) {
|
||||
if (this.notPointingAtEntity(controllerData)) {
|
||||
this.restoreIgnoredEntities();
|
||||
return makeRunningValues(false, [], []);
|
||||
}
|
||||
|
||||
|
@ -417,17 +407,28 @@ Script.include("/~/system/libraries/Xform.js");
|
|||
return makeRunningValues(true, [], []);
|
||||
} else {
|
||||
this.destroyContextOverlay();
|
||||
this.restoreIgnoredEntities();
|
||||
return makeRunningValues(false, [], []);
|
||||
}
|
||||
}
|
||||
this.restoreIgnoredEntities();
|
||||
return makeRunningValues(false, [], []);
|
||||
};
|
||||
|
||||
this.run = function (controllerData) {
|
||||
|
||||
var intersection = controllerData.rayPicks[this.hand];
|
||||
if (intersection.type === Picks.INTERSECTED_ENTITY && !Window.isPhysicsEnabled()) {
|
||||
// add to ignored items.
|
||||
if (this.ignoredEntities.indexOf(intersection.objectID) === -1) {
|
||||
var data = {
|
||||
action: 'add',
|
||||
id: intersection.objectID
|
||||
};
|
||||
Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data));
|
||||
this.ignoredEntities.push(intersection.objectID);
|
||||
}
|
||||
}
|
||||
if (controllerData.triggerValues[this.hand] < TRIGGER_OFF_VALUE ||
|
||||
this.notPointingAtEntity(controllerData) || this.targetIsNull()) {
|
||||
(this.notPointingAtEntity(controllerData) && Window.isPhysicsEnabled()) || this.targetIsNull()) {
|
||||
this.endFarGrabAction();
|
||||
Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity",
|
||||
this.highlightedEntity);
|
||||
|
|
Loading…
Reference in a new issue