goat3d
diff src/goat3d.h @ 40:a5c5cec3cb88
- added mesh attribute and face append functions
- added Int4 constructor
- continued the blender exporter
- fixed a bug in clean_filename which made it produce unterminated strings
- renamed clean_filename to goat3d_clean_filename and made it extern
- added call to goat3d_clean_filename in the mesh XML export code to cleanup ctm filenames
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 13 Oct 2013 10:14:19 +0300 |
parents | 4deb0b12fe14 |
children | da3f335e0069 |
line diff
1.1 --- a/src/goat3d.h Wed Oct 09 16:40:59 2013 +0300 1.2 +++ b/src/goat3d.h Sun Oct 13 10:14:19 2013 +0300 1.3 @@ -12,6 +12,7 @@ 1.4 #define GOAT3D_MAT_ATTR_REFLECTION "reflection" 1.5 #define GOAT3D_MAT_ATTR_TRANSMISSION "transmission" 1.6 #define GOAT3D_MAT_ATTR_IOR "ior" 1.7 +#define GOAT3D_MAT_ATTR_ALPHA "alpha" 1.8 1.9 enum goat3d_mesh_attrib { 1.10 GOAT3D_MESH_ATTR_VERTEX, 1.11 @@ -136,7 +137,13 @@ 1.12 * - GOAT3D_MESH_ATTR_SKIN_MATRIX - 4 ints per vertex 1.13 * - GOAT3D_MESH_ATTR_COLOR - 4 floats per vertex 1.14 */ 1.15 -void goat3d_set_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, const void *data, int vnum); 1.16 +void goat3d_set_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.17 + const void *data, int vnum); 1.18 +void goat3d_add_mesh_attrib1f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, float val); 1.19 +void goat3d_add_mesh_attrib3f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.20 + float x, float y, float z); 1.21 +void goat3d_add_mesh_attrib4f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.22 + float x, float y, float z, float w); 1.23 /* returns a pointer to the beginning of the requested mesh attribute array */ 1.24 void *goat3d_get_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib); 1.25 /* returns a pointer to the requested mesh attribute */ 1.26 @@ -144,6 +151,7 @@ 1.27 1.28 /* sets all the faces in one go. data is an array of 3 int vertex indices per face */ 1.29 void goat3d_set_mesh_faces(struct goat3d_mesh *mesh, const int *data, int fnum); 1.30 +void goat3d_add_mesh_face(struct goat3d_mesh *mesh, int a, int b, int c); 1.31 /* returns a pointer to the beginning of the face index array */ 1.32 int *goat3d_get_mesh_faces(struct goat3d_mesh *mesh); 1.33 /* returns a pointer to a face index */