Module terrain

Source

Re-exports§

pub use self::biome::BiomeKind;
pub use self::block::Block;
pub use self::block::BlockKind;
pub use self::map::MapSizeLg;
pub use self::site::SiteKindMeta;
pub use self::sprite::SpriteCfg;
pub use self::sprite::SpriteKind;
pub use self::sprite::UnlockKind;
pub use self::structure::Structure;
pub use self::structure::StructuresGroup;

Modules§

biome
block
chonk
map
site
sprite
Here’s the deal.
structure

Structs§

TerrainChunkMeta
TerrainChunkSize

Constants§

NEIGHBOR_DELTA
TERRAIN_CHUNK_BLOCKS_LG
Base two logarithm of the number of blocks along either horizontal axis of a chunk.
TERRAIN_GRID_SEARCH_DIST 🔒

Traits§

CoordinateConversions

Functions§

neighbors
Iterate through all cells adjacent to a chunk.
quadratic_nearest_point
Find the nearest point from a quadratic spline to this point (in terms of t, the “distance along the curve” by which our spline is parameterized). Note that if t < 0.0 or t >= 1.0, we probably shouldn’t be considered “on the curve”… hopefully this works out okay and gives us what we want (a river that extends outwards tangent to a quadratic curve, with width configured by distance along the line).
river_spline_coeffs
uniform_idx_as_vec2
Computes the position Vec2 of a SimChunk from an index, where the index was generated by uniform_noise.
vec2_as_uniform_idx
Computes the index of a Vec2 of a SimChunk from a position, where the index is generated by uniform_noise. NOTE: Both components of idx should be in-bounds!

Type Aliases§

TerrainChunk
TerrainGrid