Skip to content

Commit

Permalink
Revert tactical graphics changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 14, 2024
1 parent af5a5bc commit 88b5635
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import earth.worldwind.geom.AltitudeMode
import earth.worldwind.geom.Angle
import earth.worldwind.geom.Location
import earth.worldwind.geom.Sector
import earth.worldwind.layer.RenderableLayer
import earth.worldwind.render.AbstractSurfaceRenderable
import earth.worldwind.render.RenderContext
import earth.worldwind.render.Renderable
Expand Down Expand Up @@ -34,7 +33,6 @@ abstract class AbstractMilStd2525TacticalGraphic(
private var maxScale = Double.MAX_VALUE
private val lodBuffer = mutableMapOf<Int, List<Renderable>>()
private val lodSector = mutableMapOf<Int, Sector>()
private var previousLod = -1

protected companion object {
const val MAX_WIDTH_DP = 1e-3
Expand Down Expand Up @@ -75,18 +73,6 @@ abstract class AbstractMilStd2525TacticalGraphic(
// Check if tactical graphics visible
val terrainSector = rc.terrain.sector
if (!terrainSector.isEmpty && terrainSector.intersects(sector) && getExtent(rc).intersectsFrustum(rc.frustum)) {
if(previousLod != lod) {
val previousLodShapes = lodBuffer[previousLod]
if(previousLodShapes != null) {
val layer = rc.currentLayer as RenderableLayer
for (renderable in previousLodShapes) {
val renderer = layer.batchRenderers[renderable::class]?: continue
renderer.removeRenderable(renderable)
}
}
}
previousLod = lod

val shapes = lodBuffer[lod] ?: run {
sector.setEmpty() // Prepare bounding box to be extended by real graphics measures
makeRenderables(computeLoDScale(equatorialRadius, lod)).also {
Expand All @@ -107,7 +93,6 @@ abstract class AbstractMilStd2525TacticalGraphic(
protected fun reset() {
lodBuffer.clear()
lodSector.clear()
previousLod = -1
}

protected fun applyShapeAttributes(shape: AbstractShape) = shape.apply {
Expand Down

0 comments on commit 88b5635

Please sign in to comment.