 |
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_VBO_CACHE "vbo_cache"
17 #define MAX_FILE_EXT_LEN 64
18 #define LG_MESH_INFO_EXT ".info"
19 #define LG_MESH_VBO_EXT ".vbo"
20 #define LG_MESH_IBO_EXT ".ibo"
22 #define LG_OBJ_CACHE "obj_cache"
24 #define LG_OBJ_FILE_MAXSIZE ((size_t)50 * (size_t)(1024 * 1024))
26 #define CHECK_PATH(_z_) INFO_OUT("DEBUG: [%s %d]: %s() -> %s\n", basename2(__FILE__), __LINE__, __func__, _z_)
28 #define LG_MESH_IS_RH 1
29 #define LG_MESH_IS_LH 2
42 char name[MAT_NAME_MAX_LEN + 1];
45 char tex_path[LG_TEX_PATH_MAX_LEN + 1];
90 char name[LG_MESH_NAME_MAX_LEN + 1];
107 char mtl_file[LG_MESH_NAME_MAX_LEN + 1];
114 zboolean xyz_normalized;
116 zboolean horiz_centered;
117 zboolean vert_centered;
118 zboolean vert_bottom;
123 zboolean force_reload;
125 zboolean normalize_xyz;
126 zboolean horiz_center;
127 zboolean vert_center;
128 zboolean vert_bottom;
132 #define FORCE_RELOAD TRUE
133 #define INVERT_Z TRUE
134 #define NORMALIZE_XYZ TRUE
135 #define HORIZ_CENTER TRUE
136 #define VERT_CENTER TRUE
137 #define VERT_BOTTOM TRUE
141 LG_Mesh *
lg_load_vbo(
const char *, zboolean, zboolean, zboolean, zboolean, zboolean, zboolean);
Definition: lg_mesh.h:122
Definition: lg_3d_primitives.h:64
void * lg_obj_file_open_from_cache(const char *file_name)
Definition: lg_mesh.c:389
int lg_vbo_load_from_file(const char *path, LG_Mesh **mesh)
Definition: lg_mesh.c:551
Definition: lg_vertex.h:46
Definition: lg_3d_primitives.h:53
void lg_mesh_free(LG_Mesh *mesh)
Definition: lg_mesh.c:253
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:358
int lg_vbo_load_from_file_in_cache(const char *path, LG_Mesh **mesh)
Definition: lg_mesh.c:563
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:616
int lg_mesh_reload_mats(LG_Mesh *mesh)
Definition: lg_mesh.c:581
LG_Mesh * lg_load_vbo(const char *path, zboolean force_reload, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:129
void lg_mesh_info(LG_Mesh *mesh)
Definition: lg_mesh.c:278
Definition: lg_textures.h:45
LG_Mesh * lg_mesh_new_from_objfile(const char *path, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:173
LG_Mesh * lg_mesh_new_from_fbxfile(const char *path, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:243
int lg_vbo_save_to_file_in_cache(const char *path, LG_Mesh *mesh)
Definition: lg_mesh.c:465
int lg_vbo_save_to_file(const char *path, LG_Mesh *mesh)
Definition: lg_mesh.c:450
Definition: lg_vertex.h:62
LG_Mesh * lg_load_vbo_or_mesh(const char *mesh_file, LG_LoadMesh_Flags flags)
Definition: lg_mesh.c:81