mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 22:30:42 +02:00
visualize volumes
This commit is contained in:
parent
40a096ca8d
commit
f1ec28e169
3 changed files with 16 additions and 7 deletions
|
@ -53,7 +53,9 @@ LightOverlayManager = function() {
|
|||
if (visible != isVisible) {
|
||||
visible = isVisible;
|
||||
for (var id in entityOverlays) {
|
||||
Overlays.editOverlay(entityOverlays[id], { visible: visible });
|
||||
Overlays.editOverlay(entityOverlays[id], {
|
||||
visible: visible
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -61,8 +63,7 @@ LightOverlayManager = function() {
|
|||
// Allocate or get an unused overlay
|
||||
function getOverlay() {
|
||||
if (unusedOverlays.length == 0) {
|
||||
var overlay = Overlays.addOverlay("image3d", {
|
||||
});
|
||||
var overlay = Overlays.addOverlay("image3d", {});
|
||||
allOverlays.push(overlay);
|
||||
} else {
|
||||
var overlay = unusedOverlays.pop();
|
||||
|
@ -72,7 +73,9 @@ LightOverlayManager = function() {
|
|||
|
||||
function releaseOverlay(overlay) {
|
||||
unusedOverlays.push(overlay);
|
||||
Overlays.editOverlay(overlay, { visible: false });
|
||||
Overlays.editOverlay(overlay, {
|
||||
visible: false
|
||||
});
|
||||
}
|
||||
|
||||
function addEntity(entityID) {
|
||||
|
@ -88,7 +91,11 @@ LightOverlayManager = function() {
|
|||
visible: visible,
|
||||
alpha: 0.9,
|
||||
scale: 0.5,
|
||||
color: { red: 255, green: 255, blue: 255 }
|
||||
color: {
|
||||
red: 255,
|
||||
green: 255,
|
||||
blue: 255
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -123,4 +130,4 @@ LightOverlayManager = function() {
|
|||
Overlays.deleteOverlay(allOverlays[i]);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
|
@ -36,6 +36,7 @@ if (SHOW_OVERLAYS === true) {
|
|||
|
||||
lightOverlayManager.setVisible(true);
|
||||
}
|
||||
// var entityResult = Entities.findRayIntersection(pickRay, true); // want precision picking
|
||||
// var pickRay = Camera.computePickRay(event.x, event.y);
|
||||
// var lightResult = lightOverlayManager.findRayIntersection(pickRay)
|
||||
|
||||
|
@ -427,6 +428,7 @@ function cleanup() {
|
|||
Messages.messageReceived.disconnect(handleValueMessages);
|
||||
Entities.deletingEntity.disconnect(deleteEntity);
|
||||
|
||||
lightOverlayManager.setVisible(false);
|
||||
}
|
||||
|
||||
Script.scriptEnding.connect(cleanup);
|
||||
|
|
|
@ -26,7 +26,7 @@ function createLight() {
|
|||
dimensions: {
|
||||
x: 2,
|
||||
y: 2,
|
||||
z: 20
|
||||
z: 8
|
||||
},
|
||||
parentID: block,
|
||||
color: {
|
||||
|
|
Loading…
Reference in a new issue