Skip to content

Commit

Permalink
dbgtools, lightning rotation now supports multiple layers
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Deubler <[email protected]>
  • Loading branch information
TerminalTim committed Oct 15, 2024
1 parent 0866112 commit b298ac2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions debug/dbgTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,20 @@

const animate = () => {
const display = dbgTools.getDisplay();
let lights;
const layer = display.getLayers().find((layer) => lights = layer.getStyleManager().getLights());
if (!lights) return;
for (let name in lights) {
for (let light of lights[name]) {
if (light.direction) {
rotateZ(light.direction, Math.PI / 180);
const animateLayerLights = (layer) => {
const lights = layer.getStyleManager().getLights();
if (!lights) return;
for (let name in lights) {
for (let light of lights[name]) {
if (light.direction) {
rotateZ(light.direction, Math.PI / 180);
}
}
}
}
layer.getStyleManager().setLights(lights);
// layer.getStyleManager().setLights({default: lights});
layer.getStyleManager().setLights(lights);
};
display.getLayers().forEach(animateLayerLights);

display.refresh();
if (lightAnimated) requestAnimationFrame(animate);
};
Expand Down

0 comments on commit b298ac2

Please sign in to comment.