|
Gama C Library
Gama C API Documentation
|
Implements a Wavefront OBJ 3D model file loader. More...
#include <ctype.h>#include <float.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mesh.h"#include "mtl.h"#include "position.h"Go to the source code of this file.
Data Structures | |
| struct | gm3ObjLine |
Functions | |
| int | gm3_obj_parse_next_line (char **end, gm3ObjLine *ln) |
| int | gm3_obj_parse (char *content, gm3ObjLine **result, size_t *n_lines) |
| int32_t | gm3_obj_load (gm3Mesh *m, const char *path, const char *dir) |
| Loads a Wavefront OBJ 3D model from a file into a gm3Mesh structure. | |
Implements a Wavefront OBJ 3D model file loader.
This file provides functionality to parse .obj files and load their geometric and material data into a gm3Mesh structure. It also handles the parsing of associated .mtl files indirectly via mtl.h.
| int32_t gm3_obj_load | ( | gm3Mesh * | m, |
| const char * | path, | ||
| const char * | dir ) |
Loads a Wavefront OBJ 3D model from a file into a gm3Mesh structure.
This function parses the .obj file, including vertices, normals, texture coordinates, and faces. It also loads associated .mtl material libraries. The gm3Mesh will be populated with all the data.
| m | A pointer to the gm3Mesh structure to populate. |
| path | The file path to the .obj model. |
| dir | The directory containing the .obj file, used for resolving relative .mtl paths. |
| int gm3_obj_parse | ( | char * | content, |
| gm3ObjLine ** | result, | ||
| size_t * | n_lines ) |
| int gm3_obj_parse_next_line | ( | char ** | end, |
| gm3ObjLine * | ln ) |