 |
LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
|
9 #define LG_MESH_NAME_MAX_LEN (64 - 1)
10 #define MAT_NAME_MAX_LEN (64 - 1)
11 #define N_MAX_MAT_PER_OBJ 64
12 #define N_MAX_USEMTL_PER_OBJ 256
14 #define LG_FLOAT_EPSILON (1e-6)
16 #define LG_APP_CACHE "cache"
17 #define LG_VBO_CACHE LG_APP_CACHE "/vbo"
18 #define LG_OBJ_CACHE LG_APP_CACHE "/obj"
20 #define MAX_FILE_EXT_LEN 64
21 #define LG_MESH_INFO_EXT ".info"
22 #define LG_MESH_VBO_EXT ".vbo"
23 #define LG_MESH_IBO_EXT ".ibo"
25 #define LG_OBJ_FILE_MAXSIZE ((size_t)50 * (size_t)(1024 * 1024))
27 #define CHECK_PATH(_z_) INFO_OUT("DEBUG: [%s %d]: %s() -> %s\n", basename2(__FILE__), __LINE__, __func__, _z_)
29 #define LG_MESH_IS_RH 1
30 #define LG_MESH_IS_LH 2
43 char name[MAT_NAME_MAX_LEN + 1];
46 char tex_path[LG_TEX_PATH_MAX_LEN + 1];
91 char name[LG_MESH_NAME_MAX_LEN + 1];
108 char mtl_file[LG_MESH_NAME_MAX_LEN + 1];
115 zboolean xyz_normalized;
117 zboolean horiz_centered;
118 zboolean vert_centered;
119 zboolean vert_bottom;
124 zboolean force_reload;
126 zboolean normalize_xyz;
127 zboolean horiz_center;
128 zboolean vert_center;
129 zboolean vert_bottom;
133 #define FORCE_RELOAD TRUE
134 #define INVERT_Z TRUE
135 #define NORMALIZE_XYZ TRUE
136 #define HORIZ_CENTER TRUE
137 #define VERT_CENTER TRUE
138 #define VERT_BOTTOM TRUE
int lg_vbo_load_from_file(const char *file_name, LG_Mesh **mesh)
Definition: lg_mesh.c:531
Definition: lg_mesh.h:123
Definition: lg_3d_primitives.h:64
LG_Mesh * lg_mesh_new_from_objfile(const char *file_name, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:136
void * lg_obj_file_open_from_cache(const char *file_name)
Definition: lg_mesh.c:354
int lg_vbo_load_from_file_in_cache(const char *file_name, LG_Mesh **mesh)
Definition: lg_mesh.c:543
Definition: lg_vertex.h:46
Definition: lg_3d_primitives.h:53
LG_Mesh * lg_mesh_load(const char *file_name, LG_LoadMesh_Flags flags)
Definition: lg_mesh.c:71
void lg_mesh_free(LG_Mesh *mesh)
Definition: lg_mesh.c:214
Definition: math_3d.h:123
int lg_obj_file_save_to_cache(void *asset_buf, const char *file_name, size_t size, size_t *written_size)
Definition: lg_mesh.c:319
LG_LoadMesh_Flags lg_loadmesh_flags(zboolean force_reload, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:596
LG_Mesh * lg_mesh_new_from_fbxfile(const char *file_name, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:204
int lg_vbo_save_to_file(const char *file_name, LG_Mesh *mesh)
Definition: lg_mesh.c:425
int lg_mesh_reload_mats(LG_Mesh *mesh)
Definition: lg_mesh.c:561
int lg_vbo_save_to_file_in_cache(const char *file_name, LG_Mesh *mesh)
Definition: lg_mesh.c:440
void lg_mesh_info(LG_Mesh *mesh)
Definition: lg_mesh.c:239
Definition: lg_textures.h:45
Definition: lg_vertex.h:62