mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fix cellular noise
This commit is contained in:
parent
9d634ba4d7
commit
a6d6814f27
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.volmit</groupId>
|
||||
<artifactId>Iris</artifactId>
|
||||
<version>1.1.12</version>
|
||||
<version>1.2</version>
|
||||
<name>Iris</name>
|
||||
<properties>
|
||||
<skip.copy>false</skip.copy>
|
||||
|
@ -4,31 +4,31 @@ import com.volmit.iris.util.RNG;
|
||||
|
||||
public class CellularNoise implements NoiseGenerator
|
||||
{
|
||||
private final FastNoiseDouble n;
|
||||
private final FastNoise n;
|
||||
|
||||
public CellularNoise(long seed)
|
||||
{
|
||||
this.n = new FastNoiseDouble(new RNG(seed).lmax());
|
||||
n.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
|
||||
n.setCellularReturnType(FastNoiseDouble.CellularReturnType.CellValue);
|
||||
n.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
|
||||
this.n = new FastNoise(new RNG(seed).imax());
|
||||
n.SetNoiseType(FastNoise.NoiseType.Cellular);
|
||||
n.SetCellularReturnType(FastNoise.CellularReturnType.CellValue);
|
||||
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double noise(double x)
|
||||
{
|
||||
return (n.GetCellular(x, 0) / 2D) + 0.5D;
|
||||
return (n.GetCellular((float) x, 0) / 2D) + 0.5D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double noise(double x, double z)
|
||||
{
|
||||
return (n.GetCellular(x, z) / 2D) + 0.5D;
|
||||
return (n.GetCellular((float)x, (float)z) / 2D) + 0.5D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double noise(double x, double y, double z)
|
||||
{
|
||||
return (n.GetCellular(x, y, z) / 2D) + 0.5D;
|
||||
return (n.GetCellular((float)x, (float)y, (float)z) / 2D) + 0.5D;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user