载入中...
搜索中...
未找到
TerrainStamp.cpp
浏览该文件的文档.
17Result<int> blendTerrainMask(Heightmap& target, const Heightmap& source, TerrainMaskBlend mode, float strength,
22 if (!std::isfinite(strength) || strength < 0 || strength > 1 || mode < TerrainMaskBlend::Multiply ||
43Result<int> applyTerrainStamp(Heightmap& target, const Heightmap& stamp, const TerrainStampSettings& s,
45 if (!validRaster(target) || !validRaster(stamp) || !validRaster(localMask) || !validRaster(globalMask))
47 for (double v : {s.originX, s.originZ, s.spacingX, s.spacingZ, s.centerX, s.centerZ, s.width, s.depth, s.rotation,
68 if (u < -edgeTolerance || u > 1 + edgeTolerance || v < -edgeTolerance || v > 1 + edgeTolerance) continue;
78 fade(std::min(u, 1.0 - u) * s.width, s.edgeFade) * fade(std::min(v, 1.0 - v) * s.depth, s.edgeFade);
102 if (!isRepresentable(next)) return invalid("terrain.stamp: result exceeds finite height range");
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
float smoothMax(float a, float b, float width)
C1 polynomial maximum for blending two height fields.
Definition SmoothMax.h:24
Result< int > publish(Heightmap &target, std::vector< float > candidate)
Publish.
Definition TerrainRasterInternal.h:62
Definition EvpackPointGraphLoader.h:12
Result< int > blendTerrainMask(Heightmap &target, const Heightmap &source, TerrainMaskBlend mode, float strength, bool invert)
Blend one scalar raster into an existing mask stack, in call order.
Definition TerrainStamp.cpp:17
TerrainMaskBlend
Ordered scalar-mask arithmetic; intermediate values are not clamped.
Definition TerrainStamp.h:9
@ Subtract
@ Multiply
Result< int > applyTerrainStamp(Heightmap &target, const Heightmap &stamp, const TerrainStampSettings &s, const Heightmap &localMask, const Heightmap &globalMask)
Apply a rotated, bilinearly sampled stamp; publish only after all checks succeed.
Definition TerrainStamp.cpp:43
@ SmoothRaise
Value configuration for a rectangular stamp in world X/Z coordinates.
Definition TerrainStamp.h:22