mesh.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. tex2_t *textureVertices; /**< List of texture vertices */
  21. face_t *faces; /**< List of faces */
  22. vec3_t rotation; /**< Rotation of the object */
  23. vec3_t scale; /**< Scaling of the object */
  24. vec3_t translation; /**< Translation of the object */
  25. } mesh_t;
  26. /***********************************************************************************************************************
  27. * Global variables
  28. **********************************************************************************************************************/
  29. extern mesh_t mesh;
  30. /***********************************************************************************************************************
  31. * Prototypes
  32. **********************************************************************************************************************/
  33. void loadCubeMeshData();
  34. void meshFree();
  35. void loadOBJFile(const char *filepath);
  36. #endif /* THREEDENGINE_SOURCE_INCLUDE_MESH_H */