mesh.h 763 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef MESH_H
  2. #define MESH_H
  3. #include "lua.h"
  4. #include "geometry.h"
  5. #include <glplatform/math3d.h>
  6. #include <stdint.h>
  7. struct mesh {
  8. struct buffer_type *type;
  9. int num_verticies;
  10. int num_triangles;
  11. int num_submesh;
  12. int weights_per_vertex;
  13. int has_uv_layers;
  14. uint32_t vertex_array;
  15. uint32_t index_array;
  16. uint32_t uv_array[MAX_UV_LAYERS];
  17. struct submesh submesh[];
  18. };
  19. void render_mesh(lua_State *L, int b2l_data_idx, int materials_idx, const uint8_t *blob,
  20. const char *scene_name,
  21. const char *object_name,
  22. double frame,
  23. struct math3d_mat4 *model,
  24. struct math3d_mat4 *view,
  25. struct math3d_mat4 *proj);
  26. void create_mesh(struct mesh *m, lua_State *L, const uint8_t *blob);
  27. void render_submesh(struct mesh *m, int submesh, int uvmap);
  28. #endif