mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Rebuild a draw set for an option change only where the option is built in
Changing pickable, blend or clampTo through setOptions rebuilt a set of every kind, so a models set loaded each glTF again and blinked. Now blend rebuilds points only, pickable rebuilds only shapes and lines (whose ground primitives build it in), and clampTo rebuilds everything but models, which clamp nothing. The other kinds read those options at pick time.
This commit is contained in:
1 parent
af449184ca
commit
f24b66d80d
2 files changed
+106
-4
No files matched your search
@@ -189,11 +189,15 @@ export function createCesiumDraw({ scene, report }) {
|
||||
const pickable = spec.pickable !== false;
|
||||
Object.assign(spec, options);
|
||||
// What clamped items clamp to, how points blend, and whether ground
|
||||
// primitives pick, are built into them.
|
||||
// primitives pick, are built into them. Models clamp nothing, only
|
||||
// points build in the blend, and only shapes and lines have ground
|
||||
// primitives: other kinds are not rebuilt for those (models would
|
||||
// load again).
|
||||
if (
|
||||
spec.clampTo !== clampTo ||
|
||||
spec.blend !== blend ||
|
||||
(spec.pickable !== false) !== pickable
|
||||
(kind !== 'models' && spec.clampTo !== clampTo) ||
|
||||
(kind === 'points' && spec.blend !== blend) ||
|
||||
((kind === 'shapes' || kind === 'lines') &&
|
||||
(spec.pickable !== false) !== pickable)
|
||||
)
|
||||
rebuild();
|
||||
// A set that stops picking lets its old ground go now: still drawn
|
||||
|
||||
Reference in new issue
Block a user