mesh.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * 3D Engine
  3. * mesh.h:
  4. * Based on pikuma.com 3D software renderer in C
  5. * Copyright (c) 2021 986-Studio. All rights reserved.
  6. *
  7. * Created by Manoël Trapier on 04/03/2021.
  8. */
  9. #ifndef THREEDENGINE_SOURCE_INCLUDE_MESH_H
  10. #define THREEDENGINE_SOURCE_INCLUDE_MESH_H
  11. #include <vector.h>
  12. #include <triangle.h>
  13. /***********************************************************************************************************************
  14. * Data types
  15. **********************************************************************************************************************/
  16. typedef struct mesh_t
  17. {
  18. vec3_t *vertices; /**< List of vertices */
  19. vec3_t *normalVertices; /**< List of normal vertices */
  20. vec2_t *textureVertices; /**< List of texture vertices */
  21. face_t *faces; /**< List of faces */
  22. vec3_t rotation; /**< Rotation of the object */
  23. } mesh_t;
  24. /***********************************************************************************************************************
  25. * Global variables
  26. **********************************************************************************************************************/
  27. extern mesh_t mesh;
  28. /***********************************************************************************************************************
  29. * Prototypes
  30. **********************************************************************************************************************/
  31. void loadCubeMeshData();
  32. void meshFree();
  33. void loadOBJFile(const char *filepath);
  34. #endif /* THREEDENGINE_SOURCE_INCLUDE_MESH_H */