 |
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 MAX_FILE_EXT_LEN 64
18 #define MESH_VBO_EXT "vbo"
19 #define MESH_IBO_EXT "ibo"
20 #define MESH_INFO_EXT "info"
21 #define BINARY_MESH_EXT "bmesh"
23 #define LG_BMESH_HEADER_SIZE 65536
25 #define MAX_U32BIT_VALUE 4294967296
27 #define CHECK_PATH(_z_) INFO_OUT("DEBUG: [%s %d]: %s() -> %s\n", basename2(__FILE__), __LINE__, __func__, _z_)
32 #define LG_MESH_IS_RH 1
33 #define LG_MESH_IS_LH 2
44 char name[MAT_NAME_MAX_LEN + 1];
47 char tex_path[LG_TEX_PATH_MAX_LEN + 1];
92 char name[LG_MESH_NAME_MAX_LEN + 1];
109 char mtl_file[LG_MESH_NAME_MAX_LEN + 1];
116 zboolean xyz_normalized;
118 zboolean horiz_centered;
119 zboolean vert_centered;
120 zboolean vert_bottom;
125 zboolean force_reload_obj;
127 zboolean normalize_xyz;
128 zboolean horiz_center;
129 zboolean vert_center;
130 zboolean vert_bottom;
134 #define FORCE_RELOAD_OBJ TRUE
135 #define INVERT_Z TRUE
136 #define NORMALIZE_XYZ TRUE
137 #define HORIZ_CENTER TRUE
138 #define VERT_CENTER TRUE
139 #define VERT_BOTTOM TRUE
163 char name[MAT_NAME_MAX_LEN + 1];
165 uint32_t texture_big;
166 uint32_t texture_little;
167 char tex_path[LG_TEX_PATH_MAX_LEN + 1];
172 char name[LG_MESH_NAME_MAX_LEN + 1];
174 uint32_t vbo_data_big;
175 uint32_t vbo_data_little;
176 uint32_t ibo_data_big;
177 uint32_t ibo_data_little;
184 char mtl_file[LG_MESH_NAME_MAX_LEN + 1];
191 zboolean xyz_normalized;
193 zboolean horiz_centered;
194 zboolean vert_centered;
195 zboolean vert_bottom;
int lg_bmesh_load_from_file(const char *path, LG_Mesh **mesh)
Definition: lg_mesh.c:321
Definition: lg_mesh.h:124
Definition: lg_3d_primitives.h:64
Definition: lg_mesh.h:162
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:182
int lg_bmesh_save_to_file(const char *path, LG_Mesh *mesh)
Definition: lg_mesh.c:262
void lg_serialize_LG_Material_64_to_32(Serializable_LG_Material *s_mat, LG_Material *mat)
Definition: lg_mesh.c:431
int lg_vbo_load_from_file(const char *path, LG_Mesh **mesh)
Definition: lg_mesh.c:749
Definition: lg_vertex.h:46
char * lg_replace_file_extension(const char *path, const char *new_ext)
Definition: lg_mesh.c:670
Definition: lg_3d_primitives.h:53
LG_Mesh * lg_mesh_load(const char *file_name, LG_LoadMesh_Flags flags)
Definition: lg_mesh.c:82
void lg_unserialize_LG_Material_32_to_64(LG_Material *mat, Serializable_LG_Material *s_mat)
Definition: lg_mesh.c:446
void lg_mesh_free(LG_Mesh *mesh)
Definition: lg_mesh.c:223
Definition: math_3d.h:123
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:213
LG_LoadMesh_Flags lg_loadmesh_flags(zboolean force_reload_obj, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition: lg_mesh.c:556
int lg_mesh_reload_mats(LG_Mesh *mesh)
Definition: lg_mesh.c:410
void lg_unserialize_LG_Mesh_32_to_64(LG_Mesh *mesh, Serializable_LG_Mesh *s_mesh)
Definition: lg_mesh.c:502
void lg_mesh_info(LG_Mesh *mesh)
Definition: lg_mesh.c:572
Definition: lg_mesh.h:170
Definition: lg_textures.h:45
int lg_vbo_save_to_file(const char *path, LG_Mesh *mesh)
Definition: lg_mesh.c:707
void lg_serialize_LG_Mesh_64_to_32(Serializable_LG_Mesh *s_mesh, LG_Mesh *mesh)
Definition: lg_mesh.c:460
Definition: lg_vertex.h:62