Implements a glTF 3D model file loader.
This file provides functionality to parse glTF (.gltf, .glb) files and load their geometric and material data into a gm3Mesh structure. It uses the cgltf library for core glTF parsing.
| int gm3_gltf_load |
( |
gm3Mesh * | mesh, |
|
|
const char * | path ) |
Loads a glTF 3D model from a file.
Loads a glTF 3D model from a file into a gm3Mesh structure.
- Parameters
-
| mesh | A pointer to the gm3Mesh structure to populate. |
| path | The file path to the glTF model (.gltf or .glb). |
- Returns
- 0 on success, -1 on failure.
This function parses the glTF file, including geometric data (vertices, normals, texture coordinates), material properties, and textures. It dynamically allocates memory for the mesh components as it encounters them.
- Parameters
-
| mesh | A pointer to the gm3Mesh structure to populate. |
| path | The file path to the glTF model (.gltf or .glb). |
- Returns
- 0 on success, -1 on file parsing or loading failure.