code wiki / (root) / nx_indoor.nx

nx_indoor.nx

buildroot/runtime/nx_indoor.nx

12060 B244 linesdepth 2pulls 2 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 1 imports · 1 importers

nx_syscalls.nx nx_indoor.nx nx_indoor_gate.nx

imports: nx_syscalls.nx

imported by: nx_indoor_gate.nx

structs

none

consts

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

functions

27func in_isqrt(x: i64) -> i64 { if x<=0 {return 0} var a: i64=x; var b: i64=(a+1)/2; while b<a {a=b; b=(a+x/a)/2} return a }
called by 1: indoor_render
28func in_iabs(v: i64) -> i64 { if v<0 {return 0-v} return v }
29func in_min(a: i64, b: i64) -> i64 { if a<b {return a} return b }
called by 1: indoor_render
30func in_max(a: i64, b: i64) -> i64 { if a>b {return a} return b }
31func 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
32func 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
34func in_addbox(x0: i64, y0: i64, z0: i64, x1: i64, y1: i64, z1: i64, col: i64, kind: i64) -> i64
43func 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
51func 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
69func indoor_build(seed: i64) -> i64
110func in_n() -> i64 { return IN_N }
called by 1: main
111func in_nf() -> i64 { return IN_NF }
112func 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 }
114func in_furniture_overlaps() -> i64
called by 1: main calls 1: in_overlap
134func in_layout_sig() -> i64
called by 1: main
153func 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
197func indoor_render(fb: *i64, W: i64, H: i64) -> i64
244func in_rw() -> i64 { return RM_W }