1
0

ray.h 757 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 cglmc_ray_h
  8. #define cglmc_ray_h
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #include "../cglm.h"
  13. CGLM_EXPORT
  14. bool
  15. glmc_ray_triangle(vec3 origin,
  16. vec3 direction,
  17. vec3 v0,
  18. vec3 v1,
  19. vec3 v2,
  20. float *d);
  21. CGLM_EXPORT
  22. bool
  23. glmc_ray_sphere(vec3 origin,
  24. vec3 dir,
  25. vec4 s,
  26. float * __restrict t1,
  27. float * __restrict t2);
  28. CGLM_EXPORT
  29. void
  30. glmc_ray_at(vec3 orig, vec3 dir, float t, vec3 point);
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif /* cglmc_ray_h */