code wiki / (root) / nx_gltf_mesh.nx

nx_gltf_mesh.nx

buildroot/runtime/nx_gltf_mesh.nx

9593 B154 linesdepth 4pulls 7 transitivereach 7 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 (float32 VEC3, UNIT) + 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 3 imports · 3 importers

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

imports: nx_syscalls.nxnx_trimesh.nxnx_glbnorm_lib.nx

imported by: nx_gltf_anim.nxnx_gltf_mesh_gate.nxnx_gltf_scene.nx

structs

none

consts

8const K_MAGIC_8388607: i64 = 8388607
9const K_MAGIC_2000000000: i64 = 2000000000
10const K_MAGIC_32767: i64 = 32767
11const K_MAGIC_65535: i64 = 65535
12const K_MAGIC_8192: i64 = 8192
33const GL_V3: i64 = 3
34const GL_VEC3_F32_BYTES: i64 = 12

functions

15func gl_f32bits(v: i64) -> i64
called by 2: ga_f32fxgl_f32
26func gl_u8(out: *u8, at: i64, v: i64) -> i64 { out[at] = (v&255) as u8; return at+1 }
27func 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 }
28func 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 }
29func gl_f32(out: *u8, at: i64, v: i64) -> i64 { return gl_u32(out, at, gl_f32bits(v)) }
30func 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 }
31func gl_align4(x: i64) -> i64 { return (x+3)/4*4 }
49func gl_emit_normals(bin: *u8, at0: i64, nv: i64) -> i64
65func 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 }
66func jnum(o: *u8, at: i64, v: i64) -> i64
80func gltf_export(out: *u8) -> i64