mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 17:46:52 +02:00
Merge pull request #10912 from amvmoody/21374
WL 21374: Allow lights/particles to be dragged by icon
This commit is contained in:
commit
ef67029837
3 changed files with 31 additions and 0 deletions
|
@ -664,6 +664,7 @@ var toolBar = (function () {
|
||||||
selectionDisplay.triggerMapping.enable();
|
selectionDisplay.triggerMapping.enable();
|
||||||
print("starting tablet in landscape mode");
|
print("starting tablet in landscape mode");
|
||||||
tablet.landscape = true;
|
tablet.landscape = true;
|
||||||
|
entityIconOverlayManager.setIconsSelectable(null,false);
|
||||||
// Not sure what the following was meant to accomplish, but it currently causes
|
// Not sure what the following was meant to accomplish, but it currently causes
|
||||||
// everybody else to think that Interface has lost focus overall. fogbugzid:558
|
// everybody else to think that Interface has lost focus overall. fogbugzid:558
|
||||||
// Window.setFocus();
|
// Window.setFocus();
|
||||||
|
@ -991,6 +992,7 @@ function mouseClickEvent(event) {
|
||||||
} else {
|
} else {
|
||||||
selectionManager.addEntity(foundEntity, true);
|
selectionManager.addEntity(foundEntity, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
print("Model selected: " + foundEntity);
|
print("Model selected: " + foundEntity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* globals EntityIconOverlayManager:true */
|
/* globals EntityIconOverlayManager:true */
|
||||||
|
|
||||||
EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
|
||||||
// List of all created overlays
|
// List of all created overlays
|
||||||
|
@ -69,6 +70,29 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
this.setIconsSelectable = function(arrayOfSelectedEntityIDs, isIconsSelectable) {
|
||||||
|
if (arrayOfSelectedEntityIDs === null) {
|
||||||
|
for (var id in entityOverlays) {
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: isIconsSelectable
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var id in entityOverlays) {
|
||||||
|
if (arrayOfSelectedEntityIDs.indexOf(id) !== -1) { // in the entityOverlays array and selectable
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: isIconsSelectable
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Overlays.editOverlay(entityOverlays[id], {
|
||||||
|
ignoreRayIntersection: !isIconsSelectable
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Allocate or get an unused overlay
|
// Allocate or get an unused overlay
|
||||||
function getOverlay() {
|
function getOverlay() {
|
||||||
var overlay;
|
var overlay;
|
||||||
|
@ -114,6 +138,9 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) {
|
||||||
overlayProperties[key] = customProperties[key];
|
overlayProperties[key] = customProperties[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(properties.type === 'ParticleEffect' || properties.type === 'Light'){
|
||||||
|
overlayProperties.ignoreRayIntersection = true;
|
||||||
|
}
|
||||||
Overlays.editOverlay(overlay, overlayProperties);
|
Overlays.editOverlay(overlay, overlayProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4060,6 +4060,8 @@ SelectionDisplay = (function() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entityIconOverlayManager.setIconsSelectable(selectionManager.selections,true);
|
||||||
|
|
||||||
// ignore ray intersection for our selection box and yaw/pitch/roll
|
// ignore ray intersection for our selection box and yaw/pitch/roll
|
||||||
result = Overlays.findRayIntersection(pickRay, true, null, [ yawHandle, pitchHandle, rollHandle, selectionBox ] );
|
result = Overlays.findRayIntersection(pickRay, true, null, [ yawHandle, pitchHandle, rollHandle, selectionBox ] );
|
||||||
if (result.intersects) {
|
if (result.intersects) {
|
||||||
|
|
Loading…
Reference in a new issue