Skip to main content

Module beardifier

Module beardifier 

Source
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 margin blocks of a chunk.
is_in_kernel_range πŸ”’