vector.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * 3D Engine
  3. * vector.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 02/03/2021.
  8. */
  9. #ifndef THREEDENGINE_SOURCE_INCLUDE_VECTOR_H
  10. #define THREEDENGINE_SOURCE_INCLUDE_VECTOR_H
  11. /***********************************************************************************************************************
  12. * Data types
  13. **********************************************************************************************************************/
  14. typedef struct vec2_t
  15. {
  16. double x, y;
  17. } vec2_t;
  18. typedef struct vec3_t
  19. {
  20. double x, y, z;
  21. } vec3_t;
  22. typedef struct vec4_t
  23. {
  24. double x, y, z, w;
  25. } vec4_t;
  26. /***********************************************************************************************************************
  27. * Prototypes
  28. **********************************************************************************************************************/
  29. /* ---------------------------------------------- 2D Vectors operations --------------------------------------------- */
  30. /* ---------------------------------------------- 3D Vectors operations --------------------------------------------- */
  31. vec3_t vec3RotateX(vec3_t original, double angle);
  32. vec3_t vec3RotateY(vec3_t original, double angle);
  33. vec3_t vec3RotateZ(vec3_t original, double angle);
  34. #endif /* THREEDENGINE_SOURCE_VECTOR_H */