nx_gltf_pose_broad_gate_t316.nx source
↩ module page · 13 lines · 1634 B
1import "nx_gltf_pose_packet_t316.nx"
2import "nx_syscalls.nx"
3func main(argc:i64,argv:*i64)->i64{
4 if argc!=4{return 2};let a:*i64=sys_mmap(16) as *i64;let p:*i64=sys_read_file(argv[1] as *u8,a) as *i64;let b:*i64=sys_mmap(16) as *i64;let v:*i64=sys_read_file(argv[2] as *u8,b) as *i64;let c:*i64=sys_mmap(16) as *i64;let box:*i64=sys_read_file(argv[3] as *u8,c) as *i64
5 if (p as i64)<=0||(v as i64)<=0||(box as i64)<=0||a[0]!=105072||b[0]!=3177680||c[0]!=4000{return 2}
6 let ww:i64=gltf_pose_work_words(p[3]);let w:*i64=sys_mmap(ww*8) as *i64;let pal:*i64=sys_mmap(8960) as *i64;let exact:*i64=sys_mmap(48) as *i64;let broad:*i64=sys_mmap(48) as *i64;let scratch:*i64=sys_mmap(512) as *i64;let times:*i64=sys_mmap(48) as *i64
7 times[0]=0;times[1]=178956964;times[2]=536870893;times[3]=1252698751;times[4]=1252698752;times[5]=357913941
8 var i:i64=0;while i<6{if gpa_frame(p,a[0]/8,times[i],0,w,ww,pal,1120)!=70{return 3};if gpa_bounds(pal,70,v,36110,exact,scratch)!=36110{return 4};if gpa_broad_bounds(pal,70,box,500,broad,scratch)!=70{return 5};var k:i64=0;while k<3{if broad[k]>exact[k]||broad[3+k]<exact[3+k]{return 6};k=k+1};i=i+1}
9 let old:i64=box[5];box[5]=0;let bad:i64=gpa_broad_bounds(pal,70,box,500,broad,scratch);box[5]=old;if bad>=0{return 7}
10 if gpa_broad_bounds(pal,70,box,499,broad,scratch)>=0{return 7}
11 let save:i64=box[10];box[10]=2;let flagbad:i64=gpa_broad_bounds(pal,70,box,500,broad,scratch);box[10]=save;if flagbad>=0{return 7}
12 let s:*u8="GLTF-BROAD PASS six arbitrary times enclose exact 36110-vertex bounds; three malformed packs refused\n";var n:i64=0;while s[n]!=0 as u8{n=n+1};sys_write(1,s,n);return 0
13}