mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Fix hand controller not able to select light/particle icons
This commit is contained in:
parent
8246dbafab
commit
df644edde4
2 changed files with 6 additions and 4 deletions
|
@ -42,7 +42,7 @@ var selectionManager = SelectionManager;
|
|||
const PARTICLE_SYSTEM_URL = Script.resolvePath("assets/images/icon-particles.svg");
|
||||
const POINT_LIGHT_URL = Script.resolvePath("assets/images/icon-point-light.svg");
|
||||
const SPOT_LIGHT_URL = Script.resolvePath("assets/images/icon-spot-light.svg");
|
||||
var entityIconOverlayManager = new EntityIconOverlayManager(['Light', 'ParticleEffect'], function(entityID) {
|
||||
entityIconOverlayManager = new EntityIconOverlayManager(['Light', 'ParticleEffect'], function(entityID) {
|
||||
var properties = Entities.getEntityProperties(entityID, ['type', 'isSpotlight']);
|
||||
if (properties.type === 'Light') {
|
||||
return {
|
||||
|
|
|
@ -1032,10 +1032,12 @@ SelectionDisplay = (function() {
|
|||
var pickRay = controllerComputePickRay();
|
||||
if (pickRay) {
|
||||
var entityIntersection = Entities.findRayIntersection(pickRay, true);
|
||||
|
||||
|
||||
var iconIntersection = entityIconOverlayManager.findRayIntersection(pickRay);
|
||||
var overlayIntersection = Overlays.findRayIntersection(pickRay);
|
||||
if (entityIntersection.intersects &&
|
||||
|
||||
if (iconIntersection.intersects) {
|
||||
selectionManager.setSelections([iconIntersection.entityID]);
|
||||
} else if (entityIntersection.intersects &&
|
||||
(!overlayIntersection.intersects || (entityIntersection.distance < overlayIntersection.distance))) {
|
||||
|
||||
if (HMD.tabletID === entityIntersection.entityID) {
|
||||
|
|
Loading…
Reference in a new issue