vector2.h - Engine C API Reference

vector2.h
  1. #pragma once
  2. #include "platform.h"
  3. #include "types.h"
  4. namespace stingray_plugin_foundation {
  5. // Operators
  6. __forceinline Vector2 operator / (const Vector2 &lhs, const Vector2 &rhs);
  7. __forceinline Vector2 operator * (const Vector2 &lhs, const Vector2 &rhs);
  8. __forceinline Vector2 operator + (const Vector2 &lhs, const Vector2 &rhs);
  9. __forceinline Vector2 operator - (const Vector2 &lhs, const Vector2 &rhs);
  10. __forceinline void operator /= (Vector2 &lhs, const Vector2 &rhs);
  11. __forceinline void operator *= (Vector2 &lhs, const Vector2 &rhs);
  12. __forceinline void operator += (Vector2 &lhs, const Vector2 &rhs);
  13. __forceinline void operator -= (Vector2 &lhs, const Vector2 &rhs);
  14. __forceinline Vector2 operator - (const Vector2 &v);
  15. __forceinline Vector2 operator + (const Vector2 &v);
  16. __forceinline Vector2 operator / (const Vector2 &lhs, float rhs);
  17. __forceinline Vector2 operator * (const Vector2 &lhs, float rhs);
  18. __forceinline Vector2 operator * (float lhs, const Vector2 &rhs);
  19. __forceinline Vector2 operator + (const Vector2 &lhs, float rhs);
  20. __forceinline Vector2 operator - (const Vector2 &lhs, float rhs);
  21. __forceinline void operator /= (Vector2 &lhs, float rhs);
  22. __forceinline void operator *= (Vector2 &lhs, float rhs);
  23. __forceinline void operator += (Vector2 &lhs, float rhs);
  24. __forceinline void operator -= (Vector2 &lhs, float rhs);
  25. __forceinline bool operator==(const Vector2 &lhs, const Vector2 &rhs);
  26. __forceinline bool operator!=(const Vector2 &lhs, const Vector2 &rhs);
  27. // Methods
  28. __forceinline Vector2 vector2(float x, float y);
  29. __forceinline float & element(Vector2 &m, int i);
  30. __forceinline const float & element(const Vector2 &m, int i);
  31. __forceinline bool is_zero(const Vector2 &v);
  32. __forceinline bool is_zero(const Vector2 &v, float eps);
  33. __forceinline void zero(Vector2 &v);
  34. __forceinline float length(const Vector2 &v);
  35. __forceinline float length_squared(const Vector2 &v);
  36. __forceinline Vector2 normalize(const Vector2 &v);
  37. __forceinline float dot(const Vector2 &v0, const Vector2 &v1);
  38. __forceinline float distance(const Vector2 &v0, const Vector2 &v1);
  39. __forceinline float distance_squared(const Vector2 &v0, const Vector2 &v1);
  40. __forceinline Vector2 lerp(const Vector2 &a, const Vector2 &b, float t);
  41. __forceinline Vector2 min(const Vector2 &v0, const Vector2 &v1);
  42. __forceinline Vector2 max(const Vector2 &v0, const Vector2 &v1);
  43. }
  44. #include "vector2.inl"