code wiki / (root) / nx_gltf_mesh.nx

nx_gltf_mesh.nx

buildroot/runtime/nx_gltf_mesh.nx

8201 B132 linesdepth 3pulls 4 transitivereach 6 importersview sourcekind librarytopic gltf
docsdependenciesstructsconstsfunctions

about

nx_gltf_mesh.nx -- ★F6 ASSET IO (graphics foundation ladder): export the current nx_trimesh mesh as a standard binary glTF (.glb) -- POSITION (float32) + NORMAL (normalized int16) + COLOR_0 (normalized uint8 VEC4) + indices (uint32), one PBR material, doubleSided. This makes our sovereign geometry a REAL, universally-readable 3D asset (Blender, web viewers, engines). 100% integer: includes an integer IEEE-754 float32 encoder. license_tier: ORIGINAL

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_trimesh.nx nx_gltf_mesh.nx nx_gltf_anim.nx nx_gltf_mesh_gate.nx nx_gltf_scene.nx

imports: nx_syscalls.nxnx_trimesh.nx

imported by: nx_gltf_anim.nxnx_gltf_mesh_gate.nxnx_gltf_scene.nx

structs

none

consts

7const K_MAGIC_8388607: i64 = 8388607
8const K_MAGIC_2000000000: i64 = 2000000000
9const K_MAGIC_32767: i64 = 32767
10const K_MAGIC_65535: i64 = 65535
11const K_MAGIC_8192: i64 = 8192

functions

14func gl_f32bits(v: i64) -> i64
called by 2: ga_f32fxgl_f32
25func gl_u8(out: *u8, at: i64, v: i64) -> i64 { out[at] = (v&255) as u8; return at+1 }
26func gl_u16(out: *u8, at: i64, v: i64) -> i64 { out[at]=(v&255) as u8; out[at+1]=((v>>8)&255) as u8; return at+2 }
27func gl_u32(out: *u8, at: i64, v: i64) -> i64 { out[at]=(v&255) as u8; out[at+1]=((v>>8)&255) as u8; out[at+2]=((v>>16)&255) as u8; out[at+3]=((v>>24)&255) as u8; return at+4 }
28func gl_f32(out: *u8, at: i64, v: i64) -> i64 { return gl_u32(out, at, gl_f32bits(v)) }
29func gl_str(out: *u8, at: i64, s: *u8) -> i64 { var i: i64=0; var a: i64=at; while s[i]!=(0 as u8){ out[a]=s[i]; a=a+1; i=i+1 } return a }
30func gl_align4(x: i64) -> i64 { return (x+3)/4*4 }
32func jcat(o: *u8, at: i64, s: *u8) -> i64 { var i: i64=0; var a: i64=at; while s[i]!=(0 as u8){o[a]=s[i]; a=a+1; i=i+1} return a }
33func jnum(o: *u8, at: i64, v: i64) -> i64
47func gltf_export(out: *u8) -> i64