docs for new ray functions

This commit is contained in:
Recep Aslantas
2024-03-22 22:30:22 +03:00
parent 6ad0aca7e0
commit da57558078
6 changed files with 132 additions and 2 deletions

View File

@@ -60,6 +60,8 @@ Functions:
#. :c:func:`glm_vec4_lerp`
#. :c:func:`glm_vec4_cubic`
#. :c:func:`glm_vec4_make`
#. :c:func:`glm_vec4_reflect`
#. :c:func:`glm_vec4_refract`
Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~
@@ -424,3 +426,29 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination vector
.. c:function:: void glm_vec4_reflect(vec4 I, vec4 N, vec4 dest)
Reflection vector using an incident ray and a surface normal
Parameters:
| *[in]* **I** incident vector
| *[in]* **N** *❗️ normalized ❗️* normal vector
| *[out]* **dest** destination: reflection result
.. c:function:: void glm_vec4_refract(vec4 I, vec4 N, float eta, vec4 dest)
Refraction vector using entering ray, surface normal and refraction index
If the angle between the entering ray I and the surface normal N is too
great for a given refraction index, the return value is zero
this implementation does not explicitly preserve the 'w' component of the
incident vector 'I' in the output 'dest', users requiring the preservation of
the 'w' component should manually adjust 'dest' after calling this function.
Parameters:
| *[in]* **I** *❗️ normalized ❗️* incident vector
| *[in]* **N** *❗️ normalized ❗️* normal vector
| *[in]* **eta** ratio of indices of refraction ( η )
| *[out]* **dest** destination: refraction result