code wiki / (root) / nx_indoor.nx

nx_indoor.nx

buildroot/runtime/nx_indoor.nx

12011 B245 linesdepth 2pulls 4 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_indoor.nx -- ★R8 of the Infinigen ladder: INDOOR scenes (their CVPR'24 Infinigen-Indoors track). A room shell (floor/ceiling/4 walls) + procedural FURNITURE placed by a CONSTRAINT SOLVER (rule-based positions + collision rejection + in-bounds) -> a valid, seed-varied furnished room, rendered by an integer AABB interior raycaster (rays from a camera inside the room hit the nearest box; shaded by face + a ceiling light). The constraint-solved layout is the intellectual core (their paper is about realistic arrangement). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_vecmath.nx nx_indoor.nx nx_indoor_gate.nx

imports: nx_syscalls.nxnx_vecmath.nx

imported by: nx_indoor_gate.nx

structs

none

consts

8const RM_MAGIC_6364136223846793005: i64 = 6364136223846793005
9const RM_MAGIC_1442695040888963407: i64 = 1442695040888963407
10const RM_MAGIC_2147483647: i64 = 2147483647
11const RM_MAGIC_2654435761: i64 = 2654435761
12const RM_MAGIC_1013904223: i64 = 1013904223
13const RM_MAGIC_65536: i64 = 65536
14const RM_MAGIC_1469598103934665603: i64 = 1469598103934665603
15const RM_MAGIC_1099511628211: i64 = 1099511628211
16const RM_MAGIC_2000000000: i64 = 2000000000
17const RM_MAGIC_1024: i64 = 1024
19const RM_W: i64 = 1000 // room x
20const RM_H: i64 = 700 // room y (height)
21const RM_D: i64 = 1200 // room z (depth)
22const IN_STR: i64 = 8 // per-box: x0,y0,z0,x1,y1,z1,color,kind (0 structure / 1 furniture)
23const IN_CAP: i64 = 64

functions

28func in_isqrt(x: i64) -> i64 { return vm_isqrt(x) }
called by 1: indoor_render calls 1: vm_isqrt
29func in_iabs(v: i64) -> i64 { if v<0 {return 0-v} return v }
30func in_min(a: i64, b: i64) -> i64 { if a<b {return a} return b }
called by 1: indoor_render
31func in_max(a: i64, b: i64) -> i64 { if a>b {return a} return b }
32func in_next(st: *i64) -> i64 { var h: i64=st[0]; h=h*RM_MAGIC_6364136223846793005+RM_MAGIC_1442695040888963407; st[0]=h; return (h>>33)&RM_MAGIC_2147483647 }
called by 2: in_rngindoor_build
33func in_rng(st: *i64, lo: i64, hi: i64) -> i64 { return lo + in_next(st) % (hi-lo+1) }
called by 1: indoor_build calls 1: in_next
35func in_addbox(x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64, col: i64, kind: i64) -> i64
44func in_overlap(ax0: i64, ay0: i64, az0: i64, ax1: i64, ay1: i64, az1: i64, bx0: i64, by0: i64, bz0: i64, bx1: i64, by1: i64, bz1: i64, marg: i64) -> i64
52func in_try_furniture(x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64, col: i64) -> i64
called by 1: indoor_build calls 2: in_overlapin_addbox
70func indoor_build(seed: i64) -> i64
111func in_n() -> i64 { return IN_N }
called by 1: main
112func in_nf() -> i64 { return IN_NF }
113func in_box(i: i64, out: *i64) -> i64 { let B: *i64 = IN_BOX as *i64; var k: i64=0; while k<IN_STR { out[k]=B[i*IN_STR+k]; k=k+1 } return 0 }
115func in_furniture_overlaps() -> i64
called by 1: main calls 1: in_overlap
135func in_layout_sig() -> i64
called by 1: main
154func in_ray_box(ox: i64, oy: i64, oz: i64, dx: i64, dy: i64, dz: i64, bi: i64, nrm: *i64) -> i64
called by 1: indoor_render
198func indoor_render(fb: *i64, W: i64, H: i64) -> i64
245func in_rw() -> i64 { return RM_W }