message: defer calculation of more scene properties
diff: /**
  - * Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
  + * Copyright (c) 2018-2023 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  * @author David Sehnal <david.sehnal@gmail.com>
  @@ -105,6 +105,10 @@ namespace Scene {
  let boundingSphereDirty = true;
  let boundingSphereVisibleDirty = true;
  + let markerAverageDirty = true;
  + let opacityAverageDirty = true;
  + let hasOpaqueDirty = true;
  +
  let markerAverage = 0;
  let opacityAverage = 0;
  let hasOpaque = false;
  @@ -165,9 +169,9 @@ namespace Scene {
  }
  renderables.sort(renderableSort);
  - markerAverage = calculateMarkerAverage();
  - opacityAverage = calculateOpacityAverage();
  - hasOpaque = calculateHasOpaque();
  + markerAverageDirty = true;
  + opacityAverageDirty = true;
  + hasOpaqueDirty = true;
  return true;
  }
  @@ -189,9 +193,9 @@ namespace Scene {
  const newVisibleHash = computeVisibleHash();
  if (newVisibleHash !== visibleHash) {
  boundingSphereVisibleDirty = true;
  - markerAverage = calculateMarkerAverage();
  - opacityAverage = calculateOpacityAverage();
  - hasOpaque = calculateHasOpaque();
  + markerAverageDirty = true;
  + opacityAverageDirty = true;
  + hasOpaqueDirty = true;
  visibleHash = newVisibleHash;
  return true;
  } else {
  @@ -268,9 +272,9 @@ namespace Scene {
  } else {
  syncVisibility();
  }
  - markerAverage = calculateMarkerAverage();
  - opacityAverage = calculateOpacityAverage();
  - hasOpaque = calculateHasOpaque();
  + markerAverageDirty = true;
  + opacityAverageDirty = true;
  + hasOpaqueDirty = true;
  },
  add: (o: GraphicsRenderObject) => commitQueue.add(o),
  remove: (o: GraphicsRenderObject) => commitQueue.remove(o),
  @@ -311,12 +315,24 @@ namespace Scene {
  return boundingSphereVisible;
  },
  get markerAverage() {
  + if (markerAverageDirty) {
  + markerAverage = calculateMarkerAverage();
  + markerAverageDirty = true;
  + }
  return markerAverage;
  },
  get opacityAverage() {
  + if (opacityAverageDirty) {
  + opacityAverage = calculateOpacityAverage();
  + opacityAverageDirty = true;
  + }
  return opacityAverage;
  },
  get hasOpaque() {
  + if (hasOpaqueDirty) {
  + hasOpaque = calculateHasOpaque();
  + hasOpaqueDirty = true;
  + }
  return hasOpaque;
  },
  };
  