Fixed class name
This commit is contained in:
parent
82fa9b1047
commit
640671bfce
8 changed files with 26 additions and 26 deletions
|
@ -3,22 +3,22 @@ package ru.betterend.util.sdf.primitive;
|
|||
import net.minecraft.util.math.MathHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class SDFCapedCone extends SDFPrimitive {
|
||||
public class SDFCappedCone extends SDFPrimitive {
|
||||
private float radius1;
|
||||
private float radius2;
|
||||
private float height;
|
||||
|
||||
public SDFCapedCone setRadius1(float radius) {
|
||||
public SDFCappedCone setRadius1(float radius) {
|
||||
this.radius1 = radius;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDFCapedCone setRadius2(float radius) {
|
||||
public SDFCappedCone setRadius2(float radius) {
|
||||
this.radius2 = radius;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SDFCapedCone setHeight(float height) {
|
||||
public SDFCappedCone setHeight(float height) {
|
||||
this.height = height;
|
||||
return this;
|
||||
}
|
|
@ -12,7 +12,7 @@ import ru.betterend.noise.OpenSimplexNoise;
|
|||
import ru.betterend.util.sdf.SDF;
|
||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
|
||||
public class OverworldIslandFeature extends DefaultFeature {
|
||||
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(412);
|
||||
|
@ -27,7 +27,7 @@ public class OverworldIslandFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
static {
|
||||
SDF cone = new SDFCapedCone().setRadius1(0).setRadius2(6).setHeight(4).setBlock((pos) -> {
|
||||
SDF cone = new SDFCappedCone().setRadius1(0).setRadius2(6).setHeight(4).setBlock((pos) -> {
|
||||
if (pos.getY() == CENTER.getY()) return Blocks.GRASS_BLOCK.getDefaultState();
|
||||
if (pos.getY() == CENTER.getY() - 1) {
|
||||
return Blocks.DIRT.getDefaultState();
|
||||
|
|
|
@ -32,7 +32,7 @@ import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFFlatland;
|
||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
||||
|
@ -52,7 +52,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
int halfHeight = MHelper.randRange(10, 20, random);
|
||||
float radius1 = halfHeight * 0.5F;
|
||||
float radius2 = halfHeight * 0.1F + 0.5F;
|
||||
SDF sdf = new SDFCapedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
SDF sdf = new SDFCappedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
sdf = new SDFTranslate().setTranslate(0, halfHeight - 3, 0).setSource(sdf);
|
||||
|
||||
int count = halfHeight;
|
||||
|
@ -61,14 +61,14 @@ public class GeyserFeature extends DefaultFeature {
|
|||
float delta = (float) i / (float) (count - 1);
|
||||
float radius = MathHelper.lerp(delta, radius1, radius2) * 1.3F;
|
||||
|
||||
SDF bowl = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
SDF bowl = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
||||
SDF brimstone = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE);
|
||||
SDF brimstone = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE);
|
||||
brimstone = new SDFTranslate().setTranslate(0, 2F, 0).setSource(brimstone);
|
||||
bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(brimstone);
|
||||
bowl = new SDFUnion().setSourceA(brimstone).setSourceB(bowl);
|
||||
|
||||
SDF water = new SDFCapedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(Blocks.WATER);
|
||||
SDF water = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(Blocks.WATER);
|
||||
water = new SDFTranslate().setTranslate(0, 4, 0).setSource(water);
|
||||
bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(water);
|
||||
bowl = new SDFUnion().setSourceA(water).setSourceB(bowl);
|
||||
|
@ -102,7 +102,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
SDFPrimitive obj1;
|
||||
SDFPrimitive obj2;
|
||||
|
||||
obj1 = new SDFCapedCone().setHeight(halfHeight + 5).setRadius1(radius1 * 0.5F).setRadius2(radius2);
|
||||
obj1 = new SDFCappedCone().setHeight(halfHeight + 5).setRadius1(radius1 * 0.5F).setRadius2(radius2);
|
||||
sdf = new SDFTranslate().setTranslate(0, halfHeight - 13, 0).setSource(obj1);
|
||||
sdf = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.3F, vec.getY() * 0.3F, vec.getZ() * 0.3F) * 0.5F;
|
||||
|
|
|
@ -16,7 +16,7 @@ import ru.betterend.util.sdf.SDF;
|
|||
import ru.betterend.util.sdf.operator.SDFRotation;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class IceStarFeature extends DefaultFeature {
|
||||
|
@ -38,7 +38,7 @@ public class IceStarFeature extends DefaultFeature {
|
|||
int count = MHelper.randRange(minCount, maxCount, random);
|
||||
List<Vector3f> points = getFibonacciPoints(count);
|
||||
SDF sdf = null;
|
||||
SDF spike = new SDFCapedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
|
||||
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
|
||||
spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike);
|
||||
for (Vector3f point: points) {
|
||||
SDF rotated = spike;
|
||||
|
|
|
@ -30,7 +30,7 @@ import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
@ -119,8 +119,8 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
static {
|
||||
SDFCapedCone cone1 = new SDFCapedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCapedCone cone2 = new SDFCapedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
|
||||
|
@ -134,7 +134,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
innerCone = new SDFScale3D().setScale(1.2F, 1F, 1.2F).setSource(innerCone);
|
||||
cones = new SDFUnion().setSourceA(cones).setSourceB(innerCone);
|
||||
|
||||
SDF glowCone = new SDFCapedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F);
|
||||
SDF glowCone = new SDFCappedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F);
|
||||
CONE_GLOW = (SDFPrimitive) glowCone;
|
||||
glowCone = new SDFTranslate().setTranslate(0, 4.25F, 0).setSource(glowCone);
|
||||
glowCone = new SDFSubtraction().setSourceA(glowCone).setSourceB(posedCone3);
|
||||
|
|
|
@ -15,7 +15,7 @@ import ru.betterend.util.sdf.operator.SDFScale;
|
|||
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
|
||||
public class IslandLayer {
|
||||
private static final Random RANDOM = new Random();
|
||||
|
@ -109,7 +109,7 @@ public class IslandLayer {
|
|||
|
||||
private static SDF makeCone(float radiusBottom, float radiusTop, float height, float minY) {
|
||||
float hh = height * 0.5F;
|
||||
SDF sdf = new SDFCapedCone().setHeight(hh).setRadius1(radiusBottom).setRadius2(radiusTop);
|
||||
SDF sdf = new SDFCappedCone().setHeight(hh).setRadius1(radiusBottom).setRadius2(radiusTop);
|
||||
return new SDFTranslate().setTranslate(0, minY + hh, 0).setSource(sdf);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import ru.betterend.util.sdf.SDF;
|
|||
import ru.betterend.util.sdf.operator.SDFRotation;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
import ru.betterend.world.structures.piece.VoxelPiece;
|
||||
|
||||
public class StructureGiantIceStar extends SDFStructureFeature {
|
||||
|
@ -36,7 +36,7 @@ public class StructureGiantIceStar extends SDFStructureFeature {
|
|||
int count = MHelper.randRange(minCount, maxCount, random);
|
||||
List<Vector3f> points = getFibonacciPoints(count);
|
||||
SDF sdf = null;
|
||||
SDF spike = new SDFCapedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
|
||||
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
|
||||
spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike);
|
||||
for (Vector3f point: points) {
|
||||
SDF rotated = spike;
|
||||
|
|
|
@ -24,15 +24,15 @@ import ru.betterend.util.sdf.operator.SDFSmoothUnion;
|
|||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.operator.SDFUnion;
|
||||
import ru.betterend.util.sdf.primitive.SDFCapedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFCappedCone;
|
||||
import ru.betterend.util.sdf.primitive.SDFPrimitive;
|
||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
||||
|
||||
public class StructureGiantMossyGlowshroom extends SDFStructureFeature {
|
||||
@Override
|
||||
protected SDF getSDF(BlockPos center, Random random) {
|
||||
SDFCapedCone cone1 = new SDFCapedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCapedCone cone2 = new SDFCapedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
|
||||
|
@ -43,7 +43,7 @@ public class StructureGiantMossyGlowshroom extends SDFStructureFeature {
|
|||
innerCone = new SDFScale3D().setScale(1.2F, 1F, 1.2F).setSource(innerCone);
|
||||
cones = new SDFUnion().setSourceA(cones).setSourceB(innerCone);
|
||||
|
||||
SDF glowCone = new SDFCapedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F);
|
||||
SDF glowCone = new SDFCappedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F);
|
||||
SDFPrimitive priGlowCone = (SDFPrimitive) glowCone;
|
||||
glowCone = new SDFTranslate().setTranslate(0, 4.25F, 0).setSource(glowCone);
|
||||
glowCone = new SDFSubtraction().setSourceA(glowCone).setSourceB(posedCone3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue