Expand description
Beardifier: terrain density modification around structure pieces.
Matches vanillaβs Beardifier class. Modifies terrain density at cell corners
using a gaussian kernel falloff around rigid structure pieces and jigsaw junctions.
This creates the terrain adaptation effects like carving out space for villages
or burying ancient cities.
StructsΒ§
- Beardifier
- Computes terrain density contributions from nearby structure pieces and junctions.
- Rigid π
- A rigid structure piece that modifies terrain density.
ConstantsΒ§
- KERNEL_
RADIUS π - KERNEL_
SIZE π - KERNEL_
TOTAL π
StaticsΒ§
- BEARD_
KERNEL π - Pre-computed gaussian beard kernel.
Layout:
[z][x][y]where indices go from 0..24, representing offsets -12..+11.
FunctionsΒ§
- fast_
inv_ πsqrt - Vanillaβs
Mth.fastInvSqrtβ the Quake III fast inverse square root, ported exactly. - get_
beard_ πcontribution - Computes the beard density contribution for a point near a structure piece.
- get_
bury_ πcontribution - Computes the bury density contribution for a point near a structure piece.
- is_
close_ πto_ chunk - Check if a bounding box is within
marginblocks of a chunk. - is_
in_ πkernel_ range