Minor Cellular opt

This commit is contained in:
Zoe Gidiere
2024-10-12 00:56:37 -06:00
parent 3b9962662e
commit 6946755e31
@@ -279,10 +279,8 @@ public class CellularSampler extends NoiseFunction {
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) { if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
distance0 = Math.sqrt(distance0); distance0 = Math.sqrt(distance0);
if(returnType != ReturnType.CellValue) {
distance1 = Math.sqrt(distance1); distance1 = Math.sqrt(distance1);
} }
}
return switch(returnType) { return switch(returnType) {
case CellValue -> closestHash * (1 / 2147483648.0); case CellValue -> closestHash * (1 / 2147483648.0);
@@ -370,10 +368,8 @@ public class CellularSampler extends NoiseFunction {
if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) { if(distanceFunction == DistanceFunction.Euclidean && returnType != ReturnType.CellValue) {
distance0 = Math.sqrt(distance0); distance0 = Math.sqrt(distance0);
if(returnType != ReturnType.CellValue) {
distance1 = Math.sqrt(distance1); distance1 = Math.sqrt(distance1);
} }
}
return switch(returnType) { return switch(returnType) {
case CellValue -> closestHash * (1 / 2147483648.0); case CellValue -> closestHash * (1 / 2147483648.0);