Vector.h 408 B

12345678910111213141516171819202122232425262728293031323334353637
  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(Vec3f &other);
  15. Vec3f(float x, float y, float z);
  16. float& operator [](int);
  17. };
  18. class Vec2f
  19. {
  20. public:
  21. union
  22. {
  23. struct
  24. {
  25. float x, y;
  26. };
  27. float v[2];
  28. };
  29. Vec2f();
  30. Vec2f(float x, float y);
  31. Vec2f(Vec2f &other);
  32. float& operator [](int);
  33. Vec2f operator + (const Vec2f &other);
  34. };