mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 00:36:15 +00:00
Implement new parsing library, implement TerraProfiler
This commit is contained in:
@@ -7,7 +7,7 @@ import org.polydev.gaea.math.parsii.eval.Function;
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction2 implements Function {
|
||||
private static FastNoise gen = new FastNoise();
|
||||
private FastNoise gen;
|
||||
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
@@ -19,16 +19,12 @@ public class NoiseFunction2 implements Function {
|
||||
return gen.getSimplexFractal((float) list.get(0).evaluate(), (float) list.get(1).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoise gen, boolean override) {
|
||||
if(this.gen == null || override) this.gen = gen;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaturalFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void setNoise(FastNoise gen) {
|
||||
NoiseFunction2.gen = gen;
|
||||
}
|
||||
|
||||
public static FastNoise getNoise() {
|
||||
return gen;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ import org.polydev.gaea.math.parsii.eval.Function;
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction3 implements Function {
|
||||
private static FastNoise gen = new FastNoise();
|
||||
|
||||
private FastNoise gen;
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
return 3;
|
||||
@@ -19,16 +18,12 @@ public class NoiseFunction3 implements Function {
|
||||
return gen.getSimplexFractal((float) list.get(0).evaluate(), (float) list.get(1).evaluate(), (float) list.get(2).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoise gen, boolean override) {
|
||||
if(this.gen == null || override) this.gen = gen;
|
||||
}
|
||||
|
||||
@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