Adaptive raster culling #41
+3
-3
@@ -372,9 +372,9 @@ public class OcclusionCuller {
|
|||||||
|
|
||||||
/** An upper bound on the squared chunk distance of any section the search can reach. */
|
/** An upper bound on the squared chunk distance of any section the search can reach. */
|
||||||
private int maxSquaredChunkDistance(float searchDistance) {
|
private int maxSquaredChunkDistance(float searchDistance) {
|
||||||
int radius = (int) Math.ceil(searchDistance / 16.0f) + 1;
|
// the distance test is cylindrical, so dy is bounded by the search distance, not the world height
|
||||||
int height = (this.maxSectionY - this.minSectionY) + 1;
|
int radius = (int) Math.ceil(searchDistance / 16.0f) + 2;
|
||||||
return (radius * radius) + (height * height);
|
return 2 * radius * radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Farthest distance in blocks at which this search will test a section, for sizing the coverage buffer. */
|
/** Farthest distance in blocks at which this search will test a section, for sizing the coverage buffer. */
|
||||||
|
|||||||
Reference in new issue
Block a user