载入中...
搜索中...
未找到
CaveObstacleScour.cpp
浏览该文件的文档.
9CaveHydrologyVec3 add(CaveHydrologyVec3 a, CaveHydrologyVec3 b) { return {a.x + b.x, a.y + b.y, a.z + b.z}; }
11CaveHydrologyVec3 subtract(CaveHydrologyVec3 a, CaveHydrologyVec3 b) { return {a.x - b.x, a.y - b.y, a.z - b.z}; }
31float ellipsoid(CaveHydrologyVec3 point, CaveHydrologyVec3 center, const CaveObstacleScourSite& site, float alongRadius,
37 return 1.f - smoothstep(0.12f, 1.f, std::sqrt(along * along + lateral * lateral + vertical * vertical));
42std::vector<CaveObstacleScourSite> createCaveObstacleScourSites(const CaveBreakdownSet& breakdown,
58 const CaveHydrologyVec3 pathDelta = subtract(trunk[segment + 1].position, trunk[segment].position);
72 const float passageRadius = 0.5f * (trunk[nearestSegment].radius + trunk[nearestSegment + 1].radius);
78 const float hydraulic = nearestSegment < hydraulicWeights.size() ? hydraulicWeights[nearestSegment] : 1.f;
101 const CaveHydrologyVec3 left = add(site.frontCenter, multiply(site.lateral, site.frontLateralRadius * 0.42f));
102 const CaveHydrologyVec3 right = add(site.frontCenter, multiply(site.lateral, -site.frontLateralRadius * 0.42f));
104 ellipsoid(point, left, site, site.frontAlongRadius, site.frontLateralRadius * 0.68f, site.depthRadius);
106 ellipsoid(point, right, site, site.frontAlongRadius, site.frontLateralRadius * 0.68f, site.depthRadius);
112 if (erosion > result.erosion) result = {erosion, horseshoe, wake, site.roughnessRetention, int(i)};
Definition EvpackPointGraphLoader.h:12
CaveObstacleScourSample sampleCaveObstacleScour(CaveHydrologyVec3 point, const std::vector< CaveObstacleScourSite > &sites)
Sample deep upstream horseshoe scour and shallower elongated wake erosion.
Definition CaveObstacleScour.cpp:96
std::vector< CaveObstacleScourSite > createCaveObstacleScourSites(const CaveBreakdownSet &breakdown, const std::vector< CaveHydrologyPoint > &trunk, const std::vector< float > &hydraulicWeights, float sedimentLoad, float wallRoughness)
Couple landed breakdown blocks to the nearest authoritative cave-stream segment.
Definition CaveObstacleScour.cpp:42
std::vector< CaveBreakdownEvent > events
Definition CaveBreakdown.h:33
Local upstream horseshoe and downstream wake erosion response.
Definition CaveObstacleScour.h:28
One landed breakdown block coupled to a horseshoe-vortex and wake scour footprint.
Definition CaveObstacleScour.h:13
CaveHydrologyVec3 lateral
Definition CaveObstacleScour.h:18
float frontLateralRadius
Definition CaveObstacleScour.h:20
float erosionPotential
Definition CaveObstacleScour.h:23
float wakeAlongRadius
Definition CaveObstacleScour.h:22
float frontAlongRadius
Definition CaveObstacleScour.h:19
float roughnessRetention
Definition CaveObstacleScour.h:24
CaveHydrologyVec3 frontCenter
Definition CaveObstacleScour.h:15
CaveHydrologyVec3 wakeCenter
Definition CaveObstacleScour.h:16