iron_vec4.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #define mat4_t iron_matrix4x4_t
  3. #define mat3_t iron_matrix3x3_t
  4. #define quat_t iron_quaternion_t
  5. #define vec4_t iron_vector4_t
  6. #define vec3_t iron_vector3_t
  7. #define vec2_t iron_vector2_t
  8. #include "iron_mat4.h"
  9. #include <iron_math.h>
  10. vec4_t vec4_create(float x, float y, float z, float w);
  11. vec4_t vec4_cross(vec4_t a, vec4_t b);
  12. vec4_t vec4_add(vec4_t a, vec4_t b);
  13. vec4_t vec4_fadd(vec4_t a, float x, float y, float z, float w);
  14. vec4_t vec4_norm(vec4_t a);
  15. vec4_t vec4_mult(vec4_t v, float f);
  16. float vec4_dot(vec4_t a, vec4_t b);
  17. vec4_t vec4_clone(vec4_t v);
  18. vec4_t vec4_lerp(vec4_t from, vec4_t to, float s);
  19. vec4_t vec4_apply_proj(vec4_t a, mat4_t m);
  20. vec4_t vec4_apply_mat(vec4_t a, mat4_t m);
  21. vec4_t vec4_apply_mat4(vec4_t a, mat4_t m);
  22. vec4_t vec4_apply_axis_angle(vec4_t a, vec4_t axis, float angle);
  23. vec4_t vec4_apply_quat(vec4_t a, quat_t q);
  24. bool vec4_equals(vec4_t a, vec4_t b);
  25. bool vec4_almost_equals(vec4_t a, vec4_t b, float prec);
  26. float vec4_len(vec4_t a);
  27. vec4_t vec4_sub(vec4_t a, vec4_t b);
  28. vec4_t vec4_exp(vec4_t a);
  29. float vec4_dist(vec4_t v1, vec4_t v2);
  30. float vec4_fdist(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z);
  31. vec4_t vec4_reflect(vec4_t a, vec4_t n);
  32. vec4_t vec4_clamp(vec4_t a, float min, float max);
  33. vec4_t vec4_x_axis();
  34. vec4_t vec4_y_axis();
  35. vec4_t vec4_z_axis();
  36. vec4_t vec4_nan();
  37. bool vec4_isnan(vec4_t v);