载入中...
搜索中...
未找到
CaveSurfaceReactivity.cpp
浏览该文件的文档.
28Normal densityNormal(const std::vector<float>& density, int x, int y, int z, int nx, int ny, float hx, float hy,
30 const float gx = (density[voxelIndex(x + 1, y, z, nx, ny)] - density[voxelIndex(x - 1, y, z, nx, ny)]) / (2.f * hx);
31 const float gy = (density[voxelIndex(x, y + 1, z, nx, ny)] - density[voxelIndex(x, y - 1, z, nx, ny)]) / (2.f * hy);
32 const float gz = (density[voxelIndex(x, y, z + 1, nx, ny)] - density[voxelIndex(x, y, z - 1, nx, ny)]) / (2.f * hz);
44 if (strength <= 0.f || iterations <= 0 || nx < 5 || ny < 5 || nz < 5 || density.size() != rateField.size() ||
129 nominalLevel + std::sin(input.along * 1.7f + seedPhase + float(stage) * 1.91f) * halfThickness * 0.22f;
169 const uint32_t h = hash(uint32_t(sx) * 73856093u ^ uint32_t(sy) * 19349663u ^ uint32_t(sz) * 83492791u ^ seed);
183 const float t = std::fabs(denominator) > 1e-12f ? std::clamp(a.wetness / denominator, 0.f, 1.f) : 0.5f;
205void emitPolygon(MeshBuild& mesh, const std::vector<WetVertex>& polygon, const std::string& group) {
211 mesh.addVertex(vertex.px, vertex.py, vertex.pz, vertex.nx, vertex.ny, vertex.nz, vertex.u, vertex.v);
218float caveWetnessField(CaveHydrologyVec3 point, const std::vector<CaveHydrologyPoint>& drainageSpine,
231 ? std::clamp((relative.x * segment.x + relative.y * segment.y + relative.z * segment.z) / length2, 0.f,
234 const CaveHydrologyVec3 nearest{start.x + segment.x * t, start.y + segment.y * t, start.z + segment.z * t};
240 nearestRadius = drainageSpine[i - 1].radius + (drainageSpine[i].radius - drainageSpine[i - 1].radius) * t;
245 const float gravity = (nearestY - nearestRadius * 0.22f - point.y) / std::max(nearestRadius, 1e-4f);
250CaveWetnessRefinement refineCaveWetnessBoundary(MeshBuild& mesh, const std::vector<CaveHydrologyPoint>& drainageSpine,
259 if (name != "caveWalls" && name != "wetWalls" && name != "speleothems") refined.setActiveGroup(name);
283 const bool anyWet = triangle[0].wetness >= 0.f || triangle[1].wetness >= 0.f || triangle[2].wetness >= 0.f;
284 const bool anyDry = triangle[0].wetness < 0.f || triangle[1].wetness < 0.f || triangle[2].wetness < 0.f;
286 const CaveHydrologyVec3 center{(triangle[0].px + triangle[1].px + triangle[2].px) * (2.f / 3.f),
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:20
int setActiveGroup(const std::string &name)
Select/create the named group assigned to subsequently added triangles.
Definition MeshBuild.cpp:55
Vec3 interpolate(Vec3 start, Vec3 end, float amount) noexcept
Interpolate.
Definition ClimbingTrajectory.h:17
constexpr HexDirection next(HexDirection d) noexcept
The next direction clockwise (NW wraps to NE).
Definition HexMetrics.h:76
constexpr HexVec3 lerp(HexVec3 a, HexVec3 b, float t) noexcept
Linear interpolation between two positions.
Definition HexMetrics.h:51
float latticeNoise(float x, float y, float z, uint32_t seed)
Definition CaveGeometry.cpp:102
Definition EvpackPointGraphLoader.h:12
CaveSurfaceReactivityResult evolveCaveSurfaceByReactivity(std::vector< float > &density, const std::vector< float > &rateField, int nx, int ny, int nz, float strength, int iterations)
Retreat rough, highly reactive surface sites using rotation-invariant normal dispersion.
Definition CaveSurfaceReactivity.cpp:40
CaveWaterTableSample sampleCaveWaterTableCorrosion(const CaveWaterTableInput &input)
Sample laterally continuous corrosion belts left by one or more water-table stages.
Definition CaveSurfaceReactivity.cpp:117
CaveWetnessRefinement refineCaveWetnessBoundary(MeshBuild &mesh, const std::vector< CaveHydrologyPoint > &drainageSpine, float fallbackRadius, uint32_t seed, bool splitBoundary)
Refine cave wetness boundary.
Definition CaveSurfaceReactivity.cpp:250
float caveWetnessField(CaveHydrologyVec3 point, const std::vector< CaveHydrologyPoint > &drainageSpine, float fallbackRadius, uint32_t seed)
Cave wetness field.
Definition CaveSurfaceReactivity.cpp:218
@ Normal
Diagnostics from geometry-controlled cave-surface dissolution.
Definition CaveSurfaceReactivity.h:10
Inputs for a staged epiphreatic water-table corrosion belt.
Definition CaveWaterTable.h:10
Local staged water-table corrosion and the dominant historical level.
Definition CaveWaterTable.h:22