mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:23:33 +02:00
Add check to see if hudRayPick intersects.
This commit is contained in:
parent
cba6f29f77
commit
ce787d5803
1 changed files with 3 additions and 0 deletions
|
@ -357,11 +357,14 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.notPointingAtEntity = function (controllerData) {
|
this.notPointingAtEntity = function (controllerData) {
|
||||||
|
if (!hudRayPick.intersects) return;
|
||||||
|
|
||||||
var intersection = controllerData.rayPicks[this.hand];
|
var intersection = controllerData.rayPicks[this.hand];
|
||||||
var entityProperty = Entities.getEntityProperties(intersection.objectID, "type");
|
var entityProperty = Entities.getEntityProperties(intersection.objectID, "type");
|
||||||
var entityType = entityProperty.type;
|
var entityType = entityProperty.type;
|
||||||
var hudRayPick = controllerData.hudRayPicks[this.hand];
|
var hudRayPick = controllerData.hudRayPicks[this.hand];
|
||||||
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
|
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
|
||||||
|
|
||||||
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
|
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
|
||||||
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
|
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue