Expand description
R-Tree backed parameter list for climate-based biome lookup.
Implements vanilla’s Climate.ParameterList with a flattened R-Tree for
cache-efficient nearest-neighbor search. The tree is built once at startup
using vanilla’s algorithm, then flattened into a BFS-ordered contiguous
array where children of the same parent occupy adjacent indices.
Structs§
- Build
Entry 🔒 - Build data used during tree construction.
- Flat
Node 🔒 - Compact node for the flattened R-Tree.
- Parameter
List - A list of biome parameter points with their associated values.
Enums§
- RTree
Node 🔒 - R-Tree node used during construction only. After building, the tree is
flattened into a
Vec<FlatNode>for search.
Constants§
- CHILDREN_
PER_ 🔒NODE - Maximum children per tree node. Matches vanilla’s
CHILDREN_PER_NODE= 6.
Functions§
- build_
parameter_ 🔒space - Build the bounding box for a set of child nodes.
- build_
tree 🔒 - Build an R-Tree from a list of entries, matching vanilla’s algorithm.
- cost 🔒
- Calculate the cost of a bounding box (sum of range widths).
- expected_
children_ 🔒count - Compute the expected bucket size from vanilla’s formula.
- flatten_
tree 🔒 - Flatten an R-Tree into a contiguous
Vecusing BFS ordering. - search_
nearest 🔒 - Search the flat R-Tree for the nearest leaf to the target.
- snapshot_
buckets 🔒 - Snapshot the current entry order into buckets and compute total cost.
- sort_
bucket_ 🔒subtrees - Sort bucket subtrees by a dimension (absolute=true), matching vanilla’s
sort(minBuckets, dimensions, minDimension, true). - sort_
entries 🔒 - Sort entries by a dimension, with tiebreaking by subsequent dimensions.