Skip to content

Commit a366d53

Browse files
committed
fix: arc removal
1 parent 2b0a8a3 commit a366d53

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/components/scene.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default class GlobeScene {
1919

2020
#markerMeshes: THREE.Mesh<THREE.PlaneGeometry, THREE.ShaderMaterial>[] = []
2121
#barMeshes: THREE.Mesh[] = []
22+
#arcMeshes: THREE.Mesh[] = []
2223
#dotSphereMesh: THREE.Mesh<THREE.BufferGeometry, THREE.ShaderMaterial> | null = null
2324
#atmosphere: THREE.Mesh<THREE.IcosahedronGeometry, THREE.ShaderMaterial> | undefined
2425

@@ -169,6 +170,8 @@ export default class GlobeScene {
169170
addArc(arc: Arc): void {
170171
const arcMesh = arc.draw()
171172
this.#scene.add(arcMesh)
173+
174+
this.#arcMeshes.push(arcMesh);
172175
}
173176

174177
addMarkers(markers: Marker | Marker[]): void {
@@ -203,8 +206,15 @@ export default class GlobeScene {
203206
}
204207
}
205208

209+
removeAllArcs():void {
210+
for (const arc of this.#arcMeshes) {
211+
this.#scene.remove(arc)
212+
}
213+
}
214+
206215
removeAllAnnotations(): void {
207216
this.removeAllMarkers()
208217
this.removeAllBars()
218+
this.removeAllArcs()
209219
}
210220
}

0 commit comments

Comments
 (0)