mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Calculate true interpolation radius for specifc algos
This commit is contained in:
parent
791fd4bc55
commit
1028ebccbb
@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.google.common.util.concurrent.AtomicDouble;
|
||||
import com.volmit.iris.generator.noise.CNG;
|
||||
import com.volmit.iris.object.InterpolationMethod;
|
||||
import com.volmit.iris.object.NoiseStyle;
|
||||
@ -618,6 +619,23 @@ public class IrisInterpolation
|
||||
//@done
|
||||
}
|
||||
|
||||
public static double getRealRadius(InterpolationMethod method, int x, int z, double h)
|
||||
{
|
||||
AtomicDouble rad = new AtomicDouble(h);
|
||||
AtomicDouble accessX = new AtomicDouble();
|
||||
AtomicDouble accessZ = new AtomicDouble();
|
||||
NoiseProvider np = (x1, z1) -> {
|
||||
double d = Math.max(Math.abs(x1-x), Math.abs(z1 - z));
|
||||
if(d > rad.get())
|
||||
{
|
||||
rad.set(d);
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
getNoise(method, x, z, h, np);
|
||||
return rad.get();
|
||||
}
|
||||
|
||||
public static double getNoise(InterpolationMethod method, int x, int z, double h, NoiseProvider n)
|
||||
{
|
||||
if(method.equals(InterpolationMethod.BILINEAR))
|
||||
|
Loading…
x
Reference in New Issue
Block a user