9#define LG_MESH_NAME_MAX_LEN (512 - 1)
10#define LG_MESH_FULLPATH_MAX_LEN (512 - 1)
11#define MAT_NAME_MAX_LEN (64 - 1)
12#define TEX_FILENAME_MAX_LEN (512 - 1)
15#define N_USEMTL_MAX 4096
17#define BINARY_MESH_EXT "bmesh"
18#define LG_BMESH_HEADER_SIZE 65536
20#define LG_FLOAT_EPSILON (1e-6)
21#define MAX_U32BIT_VALUE 4294967296
23#define CHECK_PATH(_z_) INFO_OUT("DEBUG: [%s %d]: %s() -> %s\n", basename2(__FILE__), __LINE__, __func__, _z_)
25#define LG_MESH_IS_RH 1
26#define LG_MESH_IS_LH 2
42 char name[MAT_NAME_MAX_LEN + 1];
44 char tex_full_path[TEX_FILENAME_MAX_LEN + 1];
89 char full_path[LG_MESH_FULLPATH_MAX_LEN + 1];
105 char mtl_file[LG_MESH_FULLPATH_MAX_LEN + 1];
110 uint32_t i_mat_in_vbo[N_USEMTL_MAX];
111 uint32_t i_mat_in_lib[N_MAT_MAX];
115 zboolean xyz_normalized;
117 zboolean horiz_centered;
118 zboolean vert_centered;
119 zboolean vert_bottom;
124 zboolean save_to_assets;
126 zboolean normalize_xyz;
127 zboolean horiz_center;
128 zboolean vert_center;
129 zboolean vert_bottom;
133#define SAVE_TO_ASSETS TRUE
135#define NORMALIZE_XYZ TRUE
136#define HORIZ_CENTER TRUE
137#define VERT_CENTER TRUE
138#define VERT_BOTTOM TRUE
162 char name[MAT_NAME_MAX_LEN + 1];
163 uint32_t texture_big;
164 uint32_t texture_little;
165 char tex_full_path[TEX_FILENAME_MAX_LEN + 1];
170 char full_path[LG_MESH_FULLPATH_MAX_LEN + 1];
172 uint32_t vbo_data_big;
173 uint32_t vbo_data_little;
174 uint32_t ibo_data_big;
175 uint32_t ibo_data_little;
182 char mtl_file[LG_MESH_FULLPATH_MAX_LEN + 1];
186 uint32_t i_mat_in_vbo[N_USEMTL_MAX];
187 uint32_t i_mat_in_lib[N_MAT_MAX];
191 zboolean xyz_normalized;
193 zboolean horiz_centered;
194 zboolean vert_centered;
195 zboolean vert_bottom;
void lg_mesh_info(LG_Mesh *mesh, int show_first_n)
Definition lg_mesh.c:646
LG_Mesh * lg_mesh_new_from_fbx(const char *full_path, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition lg_mesh.c:234
int lg_mesh_reload_mats(LG_Mesh *mesh)
Definition lg_mesh.c:464
void lg_mesh_free_v2(LG_Mesh **mesh)
Definition lg_mesh.c:291
LG_Mesh * lg_mesh_new_from_obj_relpath(const char *relative_path, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition lg_mesh.c:208
LG_Mesh * lg_mesh_new_from_fbx_relpath(const char *relative_path, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition lg_mesh.c:250
LG_LoadMesh_Flags lg_loadmesh_flags(zboolean save_to_assets, zboolean invert_z, zboolean normalize_xyz, zboolean horiz_center, zboolean vert_center, zboolean vert_bottom)
Definition lg_mesh.c:629
int lg_bmesh_load_from_file(const char *full_path, LG_Mesh **mesh)
Definition lg_mesh.c:375
void lg_serialize_LG_Material_64_to_32(Serializable_LG_Material *s_mat, LG_Material *mat)
Definition lg_mesh.c:486
void lg_unserialize_LG_Material_32_to_64(LG_Material *mat, Serializable_LG_Material *s_mat)
Definition lg_mesh.c:500
void lg_unserialize_LG_Mesh_32_to_64(LG_Mesh *mesh, Serializable_LG_Mesh *s_mesh)
Definition lg_mesh.c:565
void lg_serialize_LG_Mesh_64_to_32(Serializable_LG_Mesh *s_mesh, LG_Mesh *mesh)
Definition lg_mesh.c:513
LG_Mesh * lg_mesh_new_from_obj(const char *full_path, 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 *full_path, LG_Mesh *mesh)
Definition lg_mesh.c:316
void lg_mesh_free(LG_Mesh *mesh)
Definition lg_mesh.c:260
char * lg_replace_file_extension(const char *path, const char *new_ext)
Definition lg_mesh.c:751
LG_Mesh * lg_mesh_load(const char *full_path, LG_LoadMesh_Flags flags)
Definition lg_mesh.c:104
Definition lg_3d_primitives.h:67
Definition lg_textures.h:45
Definition lg_3d_primitives.h:53
Definition lg_vertex.h:46
Definition lg_vertex.h:62