mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-18 06:10:16 +00:00
Update to latest Gaea, allow configuration of terrain octaves/frequency
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.dfsek.terra.math;
|
||||
|
||||
import org.polydev.gaea.math.FastNoise;
|
||||
import org.polydev.gaea.math.FastNoiseLite;
|
||||
import parsii.eval.Expression;
|
||||
import parsii.eval.Function;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction2 implements Function {
|
||||
private FastNoise gen;
|
||||
private FastNoiseLite gen;
|
||||
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
@@ -16,10 +16,10 @@ public class NoiseFunction2 implements Function {
|
||||
|
||||
@Override
|
||||
public double eval(List<Expression> list) {
|
||||
return gen.getSimplexFractal((float) list.get(0).evaluate(), (float) list.get(1).evaluate());
|
||||
return gen.getNoise((float) list.get(0).evaluate(), (float) list.get(1).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoise gen) {
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.dfsek.terra.math;
|
||||
|
||||
import org.polydev.gaea.math.FastNoise;
|
||||
import org.polydev.gaea.math.FastNoiseLite;
|
||||
import parsii.eval.Expression;
|
||||
import parsii.eval.Function;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NoiseFunction3 implements Function {
|
||||
private FastNoise gen;
|
||||
private FastNoiseLite gen;
|
||||
@Override
|
||||
public int getNumberOfArguments() {
|
||||
return 3;
|
||||
@@ -15,10 +15,10 @@ public class NoiseFunction3 implements Function {
|
||||
|
||||
@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());
|
||||
return gen.getNoise((float) list.get(0).evaluate(), (float) list.get(1).evaluate(), (float) list.get(2).evaluate());
|
||||
}
|
||||
|
||||
public void setNoise(FastNoise gen) {
|
||||
public void setNoise(FastNoiseLite gen) {
|
||||
this.gen = gen;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user