code wiki / (root) / nx_gltf_export.nx

nx_gltf_export.nx

buildroot/runtime/nx_gltf_export.nx

23887 B349 linesdepth 3pulls 8 transitivereach 19 importersview sourcekind librarytopic gltf
docsdependenciesstructsconstsfunctions

about

nx_gltf_export.nx -- export a bestiary mesh as binary glTF (.glb), roadmap R7 / the VRM foundation. glTF 2.0 is THE modern interchange format (web three.js/babylon, Unity/Godot/Blender, and the container VRM extends for riggable avatars). Extends the STL/OBJ export (nx_meshgen verts+tris) to a real scene-graph format: a JSON chunk (scene/node/mesh/accessors) + a BIN chunk (float32 positions + uint32 indices). Positions are the fx1024 integer verts encoded as float32, with a node scale of 1/1024 so the imported mesh is correctly sized. v0 = static mesh; the skeleton + skin + VRM humanoid extension are the next layer. license_tier: ORIGINAL

dependencies 6 imports · 15 importers

nx_syscalls.nx nx_atomic_rewrite.nx nx_gltf_writer.nx nx_vecmath.nx nx_vnormals_lib.nx nx_glbnorm_lib.nx nx_gltf_export.nx nx_char_asset.nx nx_faceanat_hires_gate.nx nx_faceanat_mesh_gate.nx nx_faceanat_texbake_gate.nx nx_glbnorm_gate.nx nx_gltf_export_gate.nx nx_gltf_multipart_gate_t345.nx nx_meshgen_cell_audit_t337.nx nx_meshgen_connected_audit_t335.nx nx_meshgen_connected_locations_t33

diagram shows first 10 each side; +0 more imports, +5 more importers in the complete lists below.

imports: nx_syscalls.nxnx_atomic_rewrite.nxnx_gltf_writer.nxnx_vecmath.nxnx_vnormals_lib.nxnx_glbnorm_lib.nx

imported by: nx_char_asset.nxnx_faceanat_hires_gate.nxnx_faceanat_mesh_gate.nxnx_faceanat_texbake_gate.nxnx_glbnorm_gate.nxnx_gltf_export_gate.nxnx_gltf_multipart_gate_t345.nxnx_meshgen_cell_audit_t337.nxnx_meshgen_connected_audit_t335.nxnx_meshgen_connected_locations_t335.nxnx_meshgen_domain_gate_t337.nxnx_meshgen_domain_locations_t337.nxnx_meshgen_orientation_gate_t336.nxnx_vnormals_gate.nxnx_xport_lib.nx

structs

286struct GlMaterialParts { face_material:*i64, face_count:i64, materials:*i64, material_count:i64, material_words:i64 }

consts

13const K_MAGIC_8192: i64 = 8192
158const GL_MAT_R:i64=0
159const GL_MAT_G:i64=1
160const GL_MAT_B:i64=2
161const GL_MAT_METALLIC:i64=3
162const GL_MAT_ROUGHNESS:i64=4
163const GL_MAT_WORDS:i64=5
164const GL_MAT_IO_RC_BASE:i64=-100
165const GL_MAT_LINEAR_Q:i64=100000
166const GL_MAT_RATIO_Q:i64=1000
287const GL_PART_U32_MAX:i64=4294967295

functions

16func gl_i2f32(v: i64) -> i64
30func gl_wr32(buf: *u8, o: i64, v: i64) -> i64
34func gl_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i }
35func gl_num(d: *u8, o: i64, v: i64) -> i64
64func gl_vnormals(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, nrm: *i64) -> i64
71func write_glb_colored(vbuf: *i64, fbuf: *i64, cbuf: *i64, nv: i64, nf: i64, path: *u8) -> i64
167func gl_material_ok(m:*i64,words:i64)->i64
173func gl_material_decimal(out:*u8,pos:i64,value:i64,q:i64)->i64
called by 1: gl_material_json calls 2: gl_numgl_cat
177func gl_material_json(out:*u8,pos:i64,m:*i64)->i64
185func gl_write_glb_scalar(vbuf: *i64, fbuf: *i64, nv: i64, nf: i64, path: *u8, material:*i64) -> i64
278func write_glb(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,path:*u8)->i64{return gl_write_glb_scalar(vbuf,fbuf,nv,nf,path,0 as *i64)}
280func write_glb_material(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,material:*i64,words:i64,path:*u8)->i64
288func gl_parts_decimal(w:*i64,value:i64,q:i64)->i64
called by 1: gl_parts_material calls 3: glw_nglw_sglw_put
291func gl_parts_material(w:*i64,m:*i64)->i64
called by 1: gl_parts_json calls 2: glw_sgl_parts_decimal
298func gl_parts_json(w:*i64,nv:i64,nf:i64,recipe:*GlMaterialParts,counts:*i64,bounds:*i64)->i64
314func gl_parts_admit(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,r:*GlMaterialParts)->i64
322func write_glb_material_parts(vbuf:*i64,fbuf:*i64,nv:i64,nf:i64,r:*GlMaterialParts,path:*u8)->i64