diff --git a/externals/cage b/externals/cage index b47d07b..bce9989 160000 --- a/externals/cage +++ b/externals/cage @@ -1 +1 @@ -Subproject commit b47d07b7df40f168b668f3ded8765255ab65abd2 +Subproject commit bce9989814505fc9fbd78e0587f9b24529b76ad1 diff --git a/sources/modesConfiguration.cpp b/sources/modesConfiguration.cpp index 399ee23..6f99ff0 100644 --- a/sources/modesConfiguration.cpp +++ b/sources/modesConfiguration.cpp @@ -38,72 +38,74 @@ namespace unnatural void chooseShapeFunction() { static constexpr TerrainFunctor shapeModeFunctions[] = { - &sdfHexagon, - &sdfSquare, - &sdfSphere, - &sdfTorus, - &sdfTube, - &sdfDisk, - &sdfCapsule, + &sdfAsteroid, + &sdfBelt, + &sdfBowl, &sdfBox, + &sdfBunny, + &sdfCapsule, &sdfCube, - &sdfTetrahedron, - &sdfOctahedron, - &sdfKnot, - &sdfMobiusStrip, + &sdfDisk, + &sdfDoubleTorus, &sdfFibers, + &sdfGear, &sdfH2O, &sdfH3O, &sdfH4O, - &sdfTriangularPrism, + &sdfHexagon, &sdfHexagonalPrism, - &sdfGear, + &sdfInsideCube, + &sdfKnot, &sdfMandelbulb, - &sdfTwistedHexagonalPrism, - &sdfBunny, + &sdfMobiusStrip, &sdfMonkeyHead, - &sdfDoubleTorus, - &sdfTorusCross, - &sdfBowl, - &sdfInsideCube, - &sdfAsteroid, + &sdfOctahedron, &sdfPipe, + &sdfSphere, + &sdfSquare, + &sdfTetrahedron, + &sdfTorus, + &sdfTorusCross, + &sdfTriangularPrism, + &sdfTube, + &sdfTwistedHexagonalPrism, &sdfTwistedPlane, }; static constexpr uint32 shapeModesCount = sizeof(shapeModeFunctions) / sizeof(shapeModeFunctions[0]); static constexpr const char *const shapeModeNames[] = { - "hexagon", - "square", - "sphere", - "torus", - "tube", - "disk", - "capsule", + "asteroid", + "belt", + "bowl", "box", + "bunny", + "capsule", "cube", - "tetrahedron", - "octahedron", - "knot", - "mobiusstrip", + "disk", + "doubletorus", "fibers", + "gear", "h2o", "h3o", "h4o", - "triangularprism", + "hexagon", "hexagonalprism", - "gear", + "insidecube", + "knot", "mandelbulb", - "twistedhexagonalprism", - "bunny", + "mobiusstrip", "monkeyhead", - "doubletorus", - "toruscross", - "bowl", - "insidecube", - "asteroid", + "octahedron", "pipe", + "sphere", + "square", + "tetrahedron", + "torus", + "toruscross", + "triangularprism", + "tube", + "twistedhexagonalprism", "twistedplane", }; @@ -132,16 +134,18 @@ namespace unnatural doubleSided = [&]() -> bool { + if (name == "belt") + return true; + if (name == "bowl") + return true; if (name == "hexagon") return true; + if (name == "insidecube") + return true; if (name == "square") return true; if (name == "tube") return true; - if (name == "bowl") - return true; - if (name == "insidecube") - return true; if (name == "twistedplane") return true; return false; diff --git a/sources/sdf.cpp b/sources/sdf.cpp index bdd4611..21d1764 100644 --- a/sources/sdf.cpp +++ b/sources/sdf.cpp @@ -371,4 +371,12 @@ namespace unnatural const Rads angle = Degs(sign(p[2]) * rot * 35); return p[1] * cos(angle) + p[0] * sin(angle); } + + Real sdfBelt(const Vec3 &p) + { + static constexpr Real Radius = 1800; + if (p[0] > 0) + return sdfCylinder(Vec3(p[0], p[2], p[1]), 10000, Radius) * -1; + return Radius - abs(p[2]); + } } diff --git a/sources/sdf.h b/sources/sdf.h index cfecc61..962f742 100644 --- a/sources/sdf.h +++ b/sources/sdf.h @@ -7,36 +7,37 @@ namespace unnatural { using namespace cage; - Real sdfHexagon(const Vec3 &pos); - Real sdfSquare(const Vec3 &pos); - Real sdfSphere(const Vec3 &pos); - Real sdfCapsule(const Vec3 &pos); - Real sdfTube(const Vec3 &pos); - Real sdfDisk(const Vec3 &pos); + Real sdfAsteroid(const Vec3 &p); + Real sdfBelt(const Vec3 &p); + Real sdfBowl(const Vec3 &p); Real sdfBox(const Vec3 &pos); + Real sdfBunny(const Vec3 &p); + Real sdfCapsule(const Vec3 &pos); Real sdfCube(const Vec3 &pos); - Real sdfTetrahedron(const Vec3 &pos); - Real sdfOctahedron(const Vec3 &pos); - Real sdfTriangularPrism(const Vec3 &pos); - Real sdfHexagonalPrism(const Vec3 &pos); - Real sdfTorus(const Vec3 &pos); - Real sdfKnot(const Vec3 &pos); - Real sdfMobiusStrip(const Vec3 &pos); + Real sdfDisk(const Vec3 &pos); + Real sdfDoubleTorus(const Vec3 &p); Real sdfFibers(const Vec3 &pos); + Real sdfGear(const Vec3 &pos); Real sdfH2O(const Vec3 &pos); Real sdfH3O(const Vec3 &pos); Real sdfH4O(const Vec3 &pos); - Real sdfGear(const Vec3 &pos); + Real sdfHexagon(const Vec3 &pos); + Real sdfHexagonalPrism(const Vec3 &pos); + Real sdfInsideCube(const Vec3 &p); + Real sdfKnot(const Vec3 &pos); Real sdfMandelbulb(const Vec3 &pos); - Real sdfTwistedHexagonalPrism(const Vec3 &pos); - Real sdfBunny(const Vec3 &p); + Real sdfMobiusStrip(const Vec3 &pos); Real sdfMonkeyHead(const Vec3 &p); - Real sdfDoubleTorus(const Vec3 &p); - Real sdfTorusCross(const Vec3 &p); - Real sdfBowl(const Vec3 &p); - Real sdfInsideCube(const Vec3 &p); - Real sdfAsteroid(const Vec3 &p); + Real sdfOctahedron(const Vec3 &pos); Real sdfPipe(const Vec3 &p); + Real sdfSphere(const Vec3 &pos); + Real sdfSquare(const Vec3 &pos); + Real sdfTetrahedron(const Vec3 &pos); + Real sdfTorus(const Vec3 &pos); + Real sdfTorusCross(const Vec3 &p); + Real sdfTriangularPrism(const Vec3 &pos); + Real sdfTube(const Vec3 &pos); + Real sdfTwistedHexagonalPrism(const Vec3 &pos); Real sdfTwistedPlane(const Vec3 &p); } diff --git a/sources/startingPositions.cpp b/sources/startingPositions.cpp index 6e0a53b..a1f6250 100644 --- a/sources/startingPositions.cpp +++ b/sources/startingPositions.cpp @@ -49,7 +49,7 @@ namespace unnatural for (uint32 i : spatQuery->result()) if (tiles[i].buildable) b++; - static constexpr uint32 Threshold = CAGE_DEBUG_BOOL ? 400 : 2500; + static constexpr uint32 Threshold = CAGE_DEBUG_BOOL ? 400 : 2000; return b < Threshold; }); }