Clamp value at pole

This commit is contained in:
2023-10-07 20:47:35 -04:00
parent e7571f3e83
commit 5db8c47aa8
+6 -6
View File
@@ -327,15 +327,15 @@ public class HeightMap {
// Clamp values.
if (zoneLoc.x >= this.fullExtentsX)
Logger.error("Outside of zone");
if (zoneLoc.y >= this.fullExtentsY)
Logger.error("Outside of zone");
float xBucket = zoneLoc.x / this.bucketWidthX;
float yBucket = zoneLoc.y / this.bucketWidthY;
if (xBucket >= this.bucketCountX)
xBucket = this.bucketCountX - 1;
if (yBucket >= this.bucketCountY)
yBucket = this.bucketCountY - 1;
return new Vector2f(xBucket, yBucket);
}