code wiki / (root) / nx_creaturegen.nx

nx_creaturegen.nx

buildroot/runtime/nx_creaturegen.nx

15492 B256 linesdepth 3pulls 4 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_creaturegen.nx -- ★SOVEREIGN INFINIGEN: procedural ANIMALS. Reuses the SAME layered-anatomy method as the human head (nx_anatstack: skeleton -> muscle -> skin envelope), generalized to a seed-parametric QUADRUPED body plan -- skull+snout, neck, spine, ribcage, pelvis, tail, four (upper+lower+foot) legs, + shoulder/haunch/belly muscles. The skin EMERGES as the smooth-union envelope + dermal offset (not eyeballed). Seeded proportions (body/leg/neck length, head/tail size, build) -> different creatures (dog-ish, deer-ish, ...). Renders via the shared anatstack ray-marcher. No ML, no assets. license_tier: ORIGINAL

dependencies 1 imports · 6 importers

nx_anatstack.nx nx_creaturegen.nx nx_articulate_gate.nx nx_creaturegen_gate.nx nx_diversity_gate.nx nx_diversity_veg_gate.nx nx_gt_annotations_gate.nx nx_livingworld_gate.nx

imports: nx_anatstack.nx

imported by: nx_articulate_gate.nxnx_creaturegen_gate.nxnx_diversity_gate.nxnx_diversity_veg_gate.nxnx_gt_annotations_gate.nxnx_livingworld_gate.nx

structs

none

consts

8const K_MAGIC_6364136223846793005: i64 = 6364136223846793005
9const K_MAGIC_1442695040888963407: i64 = 1442695040888963407
10const K_MAGIC_2147483647: i64 = 2147483647
11const K_MAGIC_4096: i64 = 4096
12const K_MAGIC_65536: i64 = 65536
13const K_MAGIC_2654435761: i64 = 2654435761
14const K_MAGIC_40503: i64 = 40503
15const K_MAGIC_90001: i64 = 90001
16const K_MAGIC_1013904223: i64 = 1013904223

functions

18func cg_next(st: *i64) -> i64 { var h: i64=st[0]; h=h*K_MAGIC_6364136223846793005+K_MAGIC_1442695040888963407; st[0]=h; return (h>>33)&K_MAGIC_2147483647 }
19func cg_range(st: *i64, lo: i64, hi: i64) -> i64 { return lo + cg_next(st) % (hi-lo+1) }
25func cg_fk_leg(hipx: i64, hipy: i64, hipz: i64, thigh: i64, shin: i64, L1: i64, L2: i64, out: *i64) -> i64
38func cg_leg_posed(P: *i64, i: i64, hipx: i64, hipy: i64, hipz: i64, thigh: i64, shin: i64, L1: i64, L2: i64, r: i64) -> i64
52func cg_leg(P: *i64, i: i64, lx: i64, lz: i64, topY: i64, footY: i64, r: i64) -> i64
called by 1: creaturegen_build calls 2: as_capsas_ellip
64func creaturegen_build_plan(P: *i64, seed: i64, plan: i64) -> i64
71func cg_build_bird(P: *i64, seed: i64) -> i64
122func cg_build_fish(P: *i64, seed: i64) -> i64
156func creaturegen_build_posed(P: *i64, seed: i64, pose: *i64) -> i64
189func creaturegen_build(P: *i64, seed: i64) -> i64