mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 02:45:13 -04:00
occlusion culling: improve memory efficiency
This commit is contained in:
parent
61668f29e4
commit
13f16e29f9
@ -99,7 +99,7 @@ class SectionOcclusion(
|
|||||||
}
|
}
|
||||||
val nRegion = regions[indexPrefix].toInt()
|
val nRegion = regions[indexPrefix].toInt()
|
||||||
if (nRegion > 0) {
|
if (nRegion > 0) {
|
||||||
sideRegions[nDirection.ordinal] += nRegion
|
sideRegions[nDirection.ordinal].add(nRegion) // primitive
|
||||||
}
|
}
|
||||||
|
|
||||||
val pDirection = when (axis) {
|
val pDirection = when (axis) {
|
||||||
@ -114,7 +114,7 @@ class SectionOcclusion(
|
|||||||
}
|
}
|
||||||
val pRegion = regions[index2].toInt()
|
val pRegion = regions[index2].toInt()
|
||||||
if (pRegion > 0) {
|
if (pRegion > 0) {
|
||||||
sideRegions[pDirection.ordinal] += pRegion
|
sideRegions[pDirection.ordinal].add(pRegion) // primitive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,8 +148,10 @@ class SectionOcclusion(
|
|||||||
val first = if (preferIn) inSides else outSides
|
val first = if (preferIn) inSides else outSides
|
||||||
val second = if (preferIn) outSides else inSides
|
val second = if (preferIn) outSides else inSides
|
||||||
|
|
||||||
for (region in first.intIterator()) {
|
val iterator = first.intIterator()
|
||||||
if (region in second) {
|
while (iterator.hasNext()) {
|
||||||
|
val region = iterator.nextInt()
|
||||||
|
if (second.contains(region)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user