2
0

ray.rst 963 B

12345678910111213141516171819202122232425262728293031
  1. .. default-domain:: C
  2. ray
  3. ====
  4. Header: cglm/ray.h
  5. This is for collision-checks used by ray-tracers and the like.
  6. Table of contents (click to go):
  7. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8. Functions:
  9. 1. :c:func:`glm_ray_triangle`
  10. Functions documentation
  11. ~~~~~~~~~~~~~~~~~~~~~~~
  12. .. c:function:: bool glm_ray_triangle(vec3 origin, vec3 direction, vec3 v0, vec3 v1, vec3 v2, float *d)
  13. Möller–Trumbore ray-triangle intersection algorithm
  14. Parameters:
  15. | *[in]* **origin** origin of ray
  16. | *[in]* **direction** direction of ray
  17. | *[in]* **v0** first vertex of triangle
  18. | *[in]* **v1** second vertex of triangle
  19. | *[in]* **v2** third vertex of triangle
  20. | *[in, out]* **d** float pointer to save distance to intersection
  21. | *[out]* **intersection** whether there is intersection