mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Parallax customize vacuum interp
This commit is contained in:
parent
05aa0c2482
commit
82b995f96f
@ -572,7 +572,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default void place(RNG rng, int x, int forceY, int z, IrisObjectPlacement objectPlacement) {
|
default void place(RNG rng, int x, int forceY, int z, IrisObjectPlacement objectPlacement) {
|
||||||
for (int i = 0; i < objectPlacement.getDensity(); i++) {
|
placing: for (int i = 0; i < objectPlacement.getDensity(); i++) {
|
||||||
IrisObject v = objectPlacement.getScale().get(rng, objectPlacement.getObject(getComplex(), rng));
|
IrisObject v = objectPlacement.getScale().get(rng, objectPlacement.getObject(getComplex(), rng));
|
||||||
if (v == null) {
|
if (v == null) {
|
||||||
return;
|
return;
|
||||||
@ -580,10 +580,7 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
int xx = rng.i(x, x + 16);
|
int xx = rng.i(x, x + 16);
|
||||||
int zz = rng.i(z, z + 16);
|
int zz = rng.i(z, z + 16);
|
||||||
int id = rng.i(0, Integer.MAX_VALUE);
|
int id = rng.i(0, Integer.MAX_VALUE);
|
||||||
int maxf = 10000;
|
|
||||||
AtomicBoolean pl = new AtomicBoolean(false);
|
|
||||||
AtomicInteger max = new AtomicInteger(-1);
|
|
||||||
AtomicInteger min = new AtomicInteger(maxf);
|
|
||||||
int h = v.place(xx, forceY, zz, this, objectPlacement, rng, (b) -> {
|
int h = v.place(xx, forceY, zz, this, objectPlacement, rng, (b) -> {
|
||||||
int xf = b.getX();
|
int xf = b.getX();
|
||||||
int yf = b.getY();
|
int yf = b.getY();
|
||||||
@ -597,14 +594,16 @@ public interface EngineParallaxManager extends DataProvider, IObjectPlacer {
|
|||||||
}, null, getData());
|
}, null, getData());
|
||||||
|
|
||||||
if (objectPlacement.isVacuum()) {
|
if (objectPlacement.isVacuum()) {
|
||||||
|
ParallaxChunkMeta rw = getParallaxAccess().getMetaRW(xx >> 4, zz >> 4);
|
||||||
double a = Math.max(v.getW(), v.getD());
|
double a = Math.max(v.getW(), v.getD());
|
||||||
IrisFeature f = new IrisFeature();
|
IrisFeature f = new IrisFeature();
|
||||||
f.setConvergeToHeight(h - (v.getH() >> 1));
|
f.setConvergeToHeight(h - (v.getH() >> 1));
|
||||||
f.setBlockRadius(a);
|
f.setBlockRadius(a);
|
||||||
f.setInterpolationRadius(a / 4);
|
f.setInterpolationRadius(objectPlacement.getVacuumInterpolationRadius());
|
||||||
f.setInterpolator(InterpolationMethod.BILINEAR_STARCAST_9);
|
f.setInterpolator(objectPlacement.getVacuumInterpolationMethod());
|
||||||
f.setStrength(1D);
|
f.setStrength(1D);
|
||||||
getParallaxAccess().getMetaRW(xx >> 4, zz >> 4).getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
|
||||||
|
rw.getFeatures().add(new IrisFeaturePositional(xx, zz, f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import com.volmit.iris.core.IrisDataManager;
|
|||||||
import com.volmit.iris.engine.cache.AtomicCache;
|
import com.volmit.iris.engine.cache.AtomicCache;
|
||||||
import com.volmit.iris.engine.data.B;
|
import com.volmit.iris.engine.data.B;
|
||||||
import com.volmit.iris.engine.data.DataProvider;
|
import com.volmit.iris.engine.data.DataProvider;
|
||||||
|
import com.volmit.iris.engine.interpolation.InterpolationMethod;
|
||||||
import com.volmit.iris.engine.noise.CNG;
|
import com.volmit.iris.engine.noise.CNG;
|
||||||
import com.volmit.iris.engine.object.annotations.*;
|
import com.volmit.iris.engine.object.annotations.*;
|
||||||
import com.volmit.iris.util.collection.KList;
|
import com.volmit.iris.util.collection.KList;
|
||||||
@ -86,6 +87,16 @@ public class IrisObjectPlacement {
|
|||||||
@Desc("When bore is enabled, lower min-y of the cuboid it removes")
|
@Desc("When bore is enabled, lower min-y of the cuboid it removes")
|
||||||
private int boreExtendMinY = 0;
|
private int boreExtendMinY = 0;
|
||||||
|
|
||||||
|
@MaxNumber(64)
|
||||||
|
@MinNumber(4)
|
||||||
|
@Desc("When vacuum is enabled, define the interpolation radius")
|
||||||
|
private int vacuumInterpolationRadius = 16;
|
||||||
|
|
||||||
|
@MaxNumber(64)
|
||||||
|
@MinNumber(4)
|
||||||
|
@Desc("When vacuum is enabled, define the interpolation method")
|
||||||
|
private InterpolationMethod vacuumInterpolationMethod = InterpolationMethod.BILINEAR_STARCAST_9;
|
||||||
|
|
||||||
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
|
@Desc("If set to true, objects will place on the terrain height, ignoring the water surface.")
|
||||||
private boolean underwater = false;
|
private boolean underwater = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user