1
0

plane.h 740 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c), Recep Aslantas.
  3. *
  4. * MIT License (MIT), http://opensource.org/licenses/MIT
  5. * Full license can be found in the LICENSE file
  6. */
  7. #ifndef cglms_planes_h
  8. #define cglms_planes_h
  9. #include "../common.h"
  10. #include "../types-struct.h"
  11. #include "../plane.h"
  12. #include "vec4.h"
  13. /*
  14. Plane equation: Ax + By + Cz + D = 0;
  15. It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance
  16. */
  17. /*
  18. Functions:
  19. CGLM_INLINE vec4s glms_plane_normalize(vec4s plane);
  20. */
  21. /*!
  22. * @brief normalizes a plane
  23. *
  24. * @param[in] plane plane to normalize
  25. * @returns normalized plane
  26. */
  27. CGLM_INLINE
  28. vec4s
  29. glms_plane_normalize(vec4s plane) {
  30. glm_plane_normalize(plane.raw);
  31. return plane;
  32. }
  33. #endif /* cglms_planes_h */