mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-09 01:06:21 +00:00
Implement BiomeConfig, BiomeGridConfig, and PaletteConfig.
This commit is contained in:
34
src/main/java/com/dfsek/terra/math/NoiseFunction2.java
Normal file
34
src/main/java/com/dfsek/terra/math/NoiseFunction2.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.dfsek.terra.math;
|
||||
|
||||
import org.polydev.gaea.math.FastNoise;
|
||||
import org.polydev.gaea.math.parsii.eval.Expression;
|
||||
import org.polydev.gaea.math.parsii.eval.Function;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction2 implements Function {
|
||||
private static FastNoise gen = new FastNoise();
|
||||
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double eval(List<Expression> list) {
|
||||
return gen.getSimplexFractal((float) list.get(0).evaluate(), (float) list.get(1).evaluate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaturalFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void setNoise(FastNoise gen) {
|
||||
NoiseFunction2.gen = gen;
|
||||
}
|
||||
|
||||
public static FastNoise getNoise() {
|
||||
return gen;
|
||||
}
|
||||
}
|
||||
34
src/main/java/com/dfsek/terra/math/NoiseFunction3.java
Normal file
34
src/main/java/com/dfsek/terra/math/NoiseFunction3.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.dfsek.terra.math;
|
||||
|
||||
import org.polydev.gaea.math.FastNoise;
|
||||
import org.polydev.gaea.math.parsii.eval.Expression;
|
||||
import org.polydev.gaea.math.parsii.eval.Function;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction3 implements Function {
|
||||
private static FastNoise gen = new FastNoise();
|
||||
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double eval(List<Expression> list) {
|
||||
return gen.getSimplexFractal((float) list.get(0).evaluate(), (float) list.get(1).evaluate(), (float) list.get(2).evaluate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaturalFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void setNoise(FastNoise gen) {
|
||||
NoiseFunction3.gen = gen;
|
||||
}
|
||||
|
||||
public static FastNoise getNoise() {
|
||||
return gen;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user