matrix4x4.h - Engine C API Reference

matrix4x4.h
  1. #pragma once
  2. #include "types.h"
  3. #include "platform.h"
  4. namespace stingray_plugin_foundation {
  5. // Operators
  6. __forceinline Matrix4x4 operator *(const Matrix4x4& lhs, const Matrix4x4 &rhs);
  7. __forceinline Matrix4x4 operator +(const Matrix4x4& lhs, const Matrix4x4 &rhs);
  8. __forceinline Matrix4x4 operator -(const Matrix4x4& lhs, const Matrix4x4 &rhs);
  9. __forceinline void operator *=(Matrix4x4& lhs, const Matrix4x4 &rhs);
  10. __forceinline void operator +=(Matrix4x4& lhs, const Matrix4x4 &rhs);
  11. __forceinline void operator -=(Matrix4x4& lhs, const Matrix4x4 &rhs);
  12. __forceinline bool operator==(const Matrix4x4 &lhs, const Matrix4x4 &rhs);
  13. __forceinline bool operator!=(const Matrix4x4 &lhs, const Matrix4x4 &rhs);
  14. __forceinline Matrix4x4 operator *(const Matrix4x4& lhs, float rhs);
  15. __forceinline Matrix4x4 operator *(float lhs, const Matrix4x4 &rhs);
  16. // Methods
  17. __forceinline void set_to_zero_matrix(Matrix4x4 &m);
  18. __forceinline void set_to_identity_matrix(Matrix4x4 &m);
  19. __forceinline void set_to_scale_matrix(Matrix4x4 &m, const Vector3 &s);
  20. __forceinline void set_to_translation_matrix(Matrix4x4 &m, const Vector3 &t);
  21. __forceinline const Matrix4x4 &matrix4x4_zero();
  22. __forceinline const Matrix4x4 &matrix4x4_identity();
  23. __forceinline void normalize(Matrix4x4 &m);
  24. __forceinline float determinant(const Matrix4x4 &m);
  25. __forceinline bool has_mirroring(const Matrix4x4 &m);
  26. Matrix4x4 inverse(const Matrix4x4 &m);
  27. __forceinline float & element(Matrix4x4 &m, int i, int j);
  28. __forceinline const float & element(const Matrix4x4 &m, int i, int j);
  29. __forceinline void transpose(Matrix4x4 &m);
  30. __forceinline Matrix4x4 rotation(const Matrix4x4 &m);
  31. __forceinline void set_rotation(Matrix4x4 &m, const Matrix4x4 &rot);
  32. __forceinline Vector3 scale(const Matrix4x4 &m);
  33. __forceinline void set_scale(Matrix4x4 &m, const Vector3 &scale);
  34. // Vector3 helper access
  35. __forceinline Vector3 &translation(Matrix4x4 &m);
  36. __forceinline Vector3 &x_axis(Matrix4x4 &m);
  37. __forceinline Vector3 &y_axis(Matrix4x4 &m);
  38. __forceinline Vector3 &z_axis(Matrix4x4 &m);
  39. __forceinline const Vector3 &translation(const Matrix4x4 &m);
  40. __forceinline const Vector3 &x_axis(const Matrix4x4 &m);
  41. __forceinline const Vector3 &y_axis(const Matrix4x4 &m);
  42. __forceinline const Vector3 &z_axis(const Matrix4x4 &m);
  43. __forceinline void set_translation(Matrix4x4 &m, const Vector3 &t);
  44. __forceinline Vector3 &forward_axis(Matrix4x4 &m);
  45. __forceinline Vector3 &up_axis(Matrix4x4 &m);
  46. __forceinline Vector3 &right_axis(Matrix4x4 &m);
  47. __forceinline const Vector3 &forward_axis(const Matrix4x4 &m);
  48. __forceinline const Vector3 &up_axis(const Matrix4x4 &m);
  49. __forceinline const Vector3 &right_axis(const Matrix4x4 &m);
  50. __forceinline Vector3 &axis(Matrix4x4 &m, int i);
  51. __forceinline const Vector3 &axis(const Matrix4x4 &m, int i);
  52. __forceinline Vector4 &row(Matrix4x4 &m, int i);
  53. __forceinline const Vector4 &row(const Matrix4x4 &m, int i);
  54. // Transforms the point p with the matrix m.
  55. __forceinline Vector3 transform(const Matrix4x4 &m, const Vector3 &p);
  56. __forceinline Vector3 transform_without_translation(const Matrix4x4 &m, const Vector3 &p);
  57. __forceinline Vector4 transform(const Matrix4x4 &m, const Vector4 &p);
  58. }
  59. #include "matrix4x4.inl"