Skip to main content

Crate gltforge_unity

Crate gltforge_unity 

Source

Modules§

convert
error
mesh

Functions§

gltforge_load_mesh
Parse a glTF file and build a UnityMesh for the given node.
gltforge_mesh_index_format
Returns 16 if all submesh index buffers are u16, 32 if they are u32. The format is the same for every submesh and is determined by total vertex count.
gltforge_mesh_name
Return a pointer to the mesh name as UTF-8 bytes (not null-terminated). out_len receives the byte length. Use Marshal.PtrToStringUTF8(ptr, len) in C#. The pointer is valid as long as the handle is alive.
gltforge_mesh_positions
Return a pointer to the position data (tightly packed [x, y, z] floats, left-handed). out_len receives the total number of float values (vertex_count × 3). The pointer is valid as long as the handle is alive.
gltforge_mesh_release
Decrement the reference count of a UnityMesh handle. Frees the underlying data when the count reaches zero.
gltforge_mesh_retain
Increment the reference count of a UnityMesh handle.
gltforge_mesh_submesh_count
Return the number of submeshes (one per glTF primitive).
gltforge_mesh_submesh_indices_u16
Return a pointer to the index data for submesh_idx as u16. out_len receives the number of index values. Returns null if the format is u32 or the submesh index is out of range.
gltforge_mesh_submesh_indices_u32
Return a pointer to the index data for submesh_idx as u32. out_len receives the number of index values. Returns null if the format is u16 or the submesh index is out of range.
gltforge_mesh_vertex_count
Return the total number of vertices across all submeshes.