code wiki / (root) / nx_body_anchors.nx

nx_body_anchors.nx

buildroot/runtime/nx_body_anchors.nx

13032 B292 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic body
docsdependenciesstructsconstsfunctions

about

nx_body_anchors.nx -- per-body anchor-feature data (Olympus Mons, Hellas Basin, Caloris Basin, Maxwell Montes, Mt Everest, etc.). The "Olympus Mons pops out" data layer. Composes: - nx_solar_system_catalog (body ids, body kinds) - nx_anchor_feature (shape functions for DOME/BASIN/RIDGE) Reads per-body anchor lists and sums their height contributions at any (px, py) query point. Consumed by per-body surface generators (nx_terrestrial_surface in nishi-engine/nx) which add the anchor sum to base FBM noise to produce signature landmarks. V1 ships anchors for the 4 terrestrial planets only. Future slices extend to moons (Tycho crater on Luna; Pavonis on Mars already in Mars list; Mons Huygens on Luna), dwarf planets, etc. Coordinate convention: world coords in arbitrary Q14 units. V1 uses "flat-projected metres at body-scale" -- a body's surface is modelled as a 2D plane in Q14 metres. V2 will project from (latitude, longitude) onto the sphere using nx_camera_q14 sin/cos. Anchor record layout (6 i64 per anchor; matches nx_anchor_feature dispatch signature): out[0] = kind (NX_ANCHOR_*) out[1] = cx_q14 (world x of feature centre) out[2] = cy_q14 out[3] = scale_q14 (characteristic radius / length) out[4] = magnitude_q14_m (peak height or depression depth) out[5] = orient (NX_ANCHOR_ORIENT_*; ignored for radial kinds) Real-world reference values from NASA JPL / USGS / Wikipedia planetary topography. Per cardinal feedback-no-third-party-trust: numbers absorbed from public-domain scientific data (NASA / USGS are US federal civil-service work, TIER_0_UNENCUMBERED). genealogy_id: nasa_mars_global_surveyor_topography + nasa_messenger_mercury_topography + magellan_venus_radar_topography + usgs_earth_dem_canon lineage_id: nx_body_anchors_flat_q14_v1

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_solar_system_catalog.nx nx_anchor_feature.nx nx_body_anchors.nx

imports: nx_syscalls.nxnx_tier.nxnx_solar_system_catalog.nxnx_anchor_feature.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_body_anchor_count sys_mmap nx_body_anchor_at nx_body_anchor_sum_contrib nx_body_anchor_count ↻ sys_mmap ↻ nx_body_anchor_at ↻ nx_anchor_feature_contribu nx_anchor_volcanic_dome nx_anchor_impact_basin nx_anchor_ridge nx_anchor_orient_is_valid nx_anchor_canyon nx_anchor_orient_is_valid ↻ nx_anchor_plateau

structs

none

consts

56const NX_MAGIC_5000: i64 = 5000
57const NX_MAGIC_1550: i64 = 1550
58const NX_MAGIC_4000: i64 = 4000
59const NX_MAGIC_3000: i64 = 3000
60const NX_MAGIC_11000: i64 = 11000
61const NX_MAGIC_2500: i64 = 2500
62const NX_MAGIC_3500: i64 = 3500
63const NX_MAGIC_8849: i64 = 8849
64const NX_MAGIC_2400: i64 = 2400
65const NX_MAGIC_6000: i64 = 6000
66const NX_MAGIC_1800: i64 = 1800
67const NX_MAGIC_22000: i64 = 22000
68const NX_MAGIC_4500: i64 = 4500
69const NX_MAGIC_1500: i64 = 1500
70const NX_MAGIC_1150: i64 = 1150
71const NX_MAGIC_7000: i64 = 7000
72const NX_MAGIC_20000: i64 = 20000
73const NX_MAGIC_16000: i64 = 16000
76const NX_BA_Q: nx_int = 16384
79const NX_BA_STRIDE: nx_int = 6
82const NX_BA_OFF_KIND: nx_int = 0
83const NX_BA_OFF_CX: nx_int = 1
84const NX_BA_OFF_CY: nx_int = 2
85const NX_BA_OFF_SCALE: nx_int = 3
86const NX_BA_OFF_MAGNITUDE: nx_int = 4
87const NX_BA_OFF_ORIENT: nx_int = 5

functions

92func nx_body_anchor_count(body_id: nx_int) -> nx_int
104func nx_body_anchor_at(body_id: nx_int, n: nx_int, out: *i64)
197func nx_body_anchor_sum_contribution(
227func main() -> i64