curve.rst 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .. default-domain:: C
  2. Curve
  3. ================================================================================
  4. Header: cglm/curve.h
  5. Common helpers for common curves. For specific curve see its header/doc
  6. e.g bezier
  7. Table of contents (click to go):
  8. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9. Functions:
  10. 1. :c:func:`glm_smc`
  11. Functions documentation
  12. ~~~~~~~~~~~~~~~~~~~~~~~
  13. .. c:function:: float glm_smc(float s, mat4 m, vec4 c)
  14. | helper function to calculate **S** * **M** * **C** multiplication for curves
  15. | this function does not encourage you to use SMC, instead it is a helper if you use SMC.
  16. | if you want to specify S as vector then use more generic glm_mat4_rmc() func.
  17. | Example usage:
  18. .. code-block:: c
  19. Bs = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1})
  20. Parameters:
  21. | *[in]* **s** parameter between 0 and 1 (this will be [s3, s2, s, 1])
  22. | *[in]* **m** basis matrix
  23. | *[out]* **c** position/control vector
  24. Returns:
  25. scalar value e.g. Bs