iron_obj.h 919 B

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