summaryrefslogtreecommitdiff
path: root/libs/cglm/docs/source/curve.rst
blob: 26c9b758f00dcdeeb1f77ec8e96aeaf3426cc940 (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
32
33
34
35
36
37
38
39
40
41
.. default-domain:: C

Curve
================================================================================

Header: cglm/curve.h

Common helpers for common curves. For specific curve see its header/doc
e.g bezier

Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Functions:

1. :c:func:`glm_smc`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: float  glm_smc(float s, mat4 m, vec4 c)

    | helper function to calculate **S** * **M** * **C** multiplication for curves

    | this function does not encourage you to use SMC, instead it is a helper if you use SMC.

    | if you want to specify S as vector then use more generic glm_mat4_rmc() func.

    | Example usage:

    .. code-block:: c

       Bs = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1})

    Parameters:
      | *[in]*  **s**  parameter between 0 and 1 (this will be [s3, s2, s, 1])
      | *[in]*  **m**  basis matrix
      | *[out]* **c**  position/control vector

    Returns:
        scalar value e.g. Bs