vmath.h 773 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <stdint.h>
  3. typedef union c11_vec2i {
  4. struct { int x, y; };
  5. int data[2];
  6. int64_t _i64;
  7. } c11_vec2i;
  8. typedef union c11_vec3i {
  9. struct { int x, y, z; };
  10. int data[3];
  11. } c11_vec3i;
  12. typedef union c11_vec2 {
  13. struct { float x, y; };
  14. float data[2];
  15. } c11_vec2;
  16. typedef union c11_vec3 {
  17. struct { float x, y, z; };
  18. float data[3];
  19. } c11_vec3;
  20. typedef union c11_mat3x3 {
  21. struct {
  22. float _11, _12, _13;
  23. float _21, _22, _23;
  24. float _31, _32, _33;
  25. };
  26. float m[3][3];
  27. float data[9];
  28. } c11_mat3x3;
  29. typedef union c11_color32 {
  30. struct {
  31. unsigned char r;
  32. unsigned char g;
  33. unsigned char b;
  34. unsigned char a;
  35. };
  36. unsigned char data[4];
  37. } c11_color32;