10 float sr, sg, sb, shin;
12 /*struct image *texmap, *envmap;*/
18 struct g3d_vertex *varr;
23 struct g3d_material *mtl;
26 void init_g3dmtl(struct g3d_material *mtl);
28 int init_mesh(struct g3d_mesh *mesh, int prim, int num_verts, int num_idx);
30 void free_mesh(struct g3d_mesh *mesh);
31 void destroy_mesh(struct g3d_mesh *mesh);
33 int copy_mesh(struct g3d_mesh *dest, struct g3d_mesh *src);
35 /* takes pointer to a dynamic array (dynarr_*) and populates it */
36 #define load_meshes(mesharr, fname) load_meshes_impl(&(mesharr), fname)
37 int load_meshes_impl(struct g3d_mesh **mesh, const char *fname);
38 /* TODO: idx -1 -> merge all meshes into one? */
39 int load_mesh(struct g3d_mesh *mesh, const char *fname, int idx);
40 int load_named_mesh(struct g3d_mesh *mesh, const char *fname, const char *mname);
41 int save_mesh(struct g3d_mesh *mesh, const char *fname);
42 struct g3d_mesh *find_mesh(struct g3d_mesh *meshes, const char *mname);
44 void zsort_mesh(struct g3d_mesh *mesh);
45 void draw_mesh(struct g3d_mesh *mesh);
47 void apply_mesh_xform(struct g3d_mesh *mesh, const float *xform);
48 int append_mesh(struct g3d_mesh *ma, struct g3d_mesh *mb);
49 int indexify_mesh(struct g3d_mesh *mesh);
51 void normalize_mesh_normals(struct g3d_mesh *mesh);
53 void calc_mesh_centroid(struct g3d_mesh *mesh, float *cent);
55 int gen_sphere_mesh(struct g3d_mesh *mesh, float rad, int usub, int vsub);
56 int gen_plane_mesh(struct g3d_mesh *mesh, float width, float height, int usub, int vsub);
57 int gen_cube_mesh(struct g3d_mesh *mesh, float sz, int sub);
58 int gen_torus_mesh(struct g3d_mesh *mesh, float rad, float ringrad, int usub, int vsub);