iron_obj.h 766 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <stddef.h>
  5. #include "iron_armpack.h"
  6. typedef struct raw_mesh {
  7. struct i16_array *posa;
  8. struct i16_array *nora;
  9. struct i16_array *texa;
  10. struct i16_array *cola;
  11. struct u32_array *inda;
  12. int vertex_count;
  13. int index_count;
  14. float scale_pos;
  15. float scale_tex;
  16. char *name;
  17. bool has_next; // File contains multiple objects
  18. uint64_t pos;
  19. struct any_array *udims; // u32_array_t[] - Indices split per udim tile
  20. int udims_u; // Number of horizontal udim tiles
  21. int udims_v;
  22. void *vertex_arrays; // vertex_array_t[]
  23. void *index_arrays; // index_array_t[]
  24. } raw_mesh_t;
  25. raw_mesh_t *obj_parse(buffer_t *file_bytes, char split_code, uint64_t start_pos, bool udim);
  26. void obj_destroy(raw_mesh_t *part);