Vector.h 493 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. class Vec3f
  3. {
  4. public:
  5. union
  6. {
  7. struct
  8. {
  9. float x, y, z;
  10. };
  11. float v[3];
  12. };
  13. Vec3f();
  14. Vec3f(const Vec3f &other);
  15. Vec3f(float x, float y, float z);
  16. float& operator [](int);
  17. Vec3f operator + (const Vec3f &other);
  18. Vec3f operator / (float value);
  19. };
  20. class Vec2f
  21. {
  22. public:
  23. union
  24. {
  25. struct
  26. {
  27. float x, y;
  28. };
  29. float v[2];
  30. };
  31. Vec2f();
  32. Vec2f(float x, float y);
  33. Vec2f(const Vec2f &other);
  34. float& operator [](int);
  35. Vec2f operator + (const Vec2f &other);
  36. };