mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-24 00:56:38 +00:00
reformat
This commit is contained in:
@@ -15,10 +15,10 @@ import com.dfsek.paralithic.functions.dynamic.Context;
|
||||
import com.dfsek.paralithic.functions.dynamic.DynamicFunction;
|
||||
import com.dfsek.paralithic.node.Statefulness;
|
||||
|
||||
import com.dfsek.terra.addons.noise.config.templates.FunctionTemplate;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.dfsek.terra.addons.noise.config.templates.FunctionTemplate;
|
||||
|
||||
|
||||
public class UserDefinedFunction implements DynamicFunction {
|
||||
private final Expression expression;
|
||||
@@ -42,7 +42,7 @@ public class UserDefinedFunction implements DynamicFunction {
|
||||
FunctionTemplate nest = entry.getValue();
|
||||
parser.registerFunction(id, newInstance(nest));
|
||||
}
|
||||
|
||||
|
||||
return new UserDefinedFunction(parser.parse(template.getFunction(), functionScope), template.getArgs().size());
|
||||
}
|
||||
|
||||
|
||||
@@ -24,17 +24,17 @@ public class DomainWarpedSampler implements NoiseSampler {
|
||||
@Override
|
||||
public double noise(long seed, double x, double y) {
|
||||
return function.noise(seed++,
|
||||
x + warp.noise(seed++, x, y) * amplitude,
|
||||
y + warp.noise(seed, x, y) * amplitude
|
||||
x + warp.noise(seed++, x, y) * amplitude,
|
||||
y + warp.noise(seed, x, y) * amplitude
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double noise(long seed, double x, double y, double z) {
|
||||
return function.noise(seed++,
|
||||
x + warp.noise(seed++, x, y, z) * amplitude,
|
||||
y + warp.noise(seed++, x, y, z) * amplitude,
|
||||
z + warp.noise(seed, x, y, z) * amplitude
|
||||
x + warp.noise(seed++, x, y, z) * amplitude,
|
||||
y + warp.noise(seed++, x, y, z) * amplitude,
|
||||
z + warp.noise(seed, x, y, z) * amplitude
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ public class GaborNoiseSampler extends NoiseFunction {
|
||||
private double a = 0.1;
|
||||
private double f0 = 0.625;
|
||||
private double kernelRadius = (FastMath.sqrt(-FastMath.log(0.05) / Math.PI) / a);
|
||||
|
||||
private double impulsesPerKernel = 64d;
|
||||
private double impulseDensity = (impulsesPerKernel / (Math.PI * kernelRadius * kernelRadius));
|
||||
private double impulsesPerCell = impulseDensity * kernelRadius * kernelRadius;
|
||||
|
||||
Reference in New Issue
Block a user