Add check to see if hudRayPick intersects.

This commit is contained in:
armored-dragon 2025-03-24 16:24:36 -05:00
parent cba6f29f77
commit ce787d5803
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B

View file

@ -357,11 +357,14 @@ Script.include("/~/system/libraries/controllers.js");
};
this.notPointingAtEntity = function (controllerData) {
if (!hudRayPick.intersects) return;
var intersection = controllerData.rayPicks[this.hand];
var entityProperty = Entities.getEntityProperties(intersection.objectID, "type");
var entityType = entityProperty.type;
var hudRayPick = controllerData.hudRayPicks[this.hand];
var point2d = this.calculateNewReticlePosition(hudRayPick.intersection);
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
return true;