Dieser Commit ist enthalten in:
Ursprung
7c473d3545
Commit
8a7c8597da
@ -37,6 +37,7 @@
|
||||
let renderer: THREE.WebGLRenderer;
|
||||
let controls: OrbitControls;
|
||||
let light: THREE.AmbientLight;
|
||||
let observer: ResizeObserver;
|
||||
|
||||
onMount(() => {
|
||||
scene = new THREE.Scene();
|
||||
@ -70,7 +71,8 @@
|
||||
light = new THREE.AmbientLight(0xffffff, 1);
|
||||
scene.add(light);
|
||||
|
||||
new ResizeObserver(handleResize).observe(div);
|
||||
observer = new ResizeObserver(handleResize);
|
||||
observer.observe(div);
|
||||
|
||||
|
||||
loaded = true;
|
||||
@ -91,6 +93,9 @@
|
||||
if (loaded) {
|
||||
loaded = false;
|
||||
|
||||
observer.unobserve(div);
|
||||
observer.disconnect();
|
||||
|
||||
renderer.dispose();
|
||||
scene.clear();
|
||||
light.dispose();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren