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