1
0

curve.h 943 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c), Recep Aslantas.
  3. *
  4. * MIT License (MIT), http://opensource.org/licenses/MIT
  5. * Full license can be found in the LICENSE file
  6. */
  7. #ifndef cglms_curves_h
  8. #define cglms_curves_h
  9. #include "../common.h"
  10. #include "../types-struct.h"
  11. #include "../curve.h"
  12. #include "vec4.h"
  13. #include "mat4.h"
  14. /*!
  15. * @brief helper function to calculate S*M*C multiplication for curves
  16. *
  17. * This function does not encourage you to use SMC,
  18. * instead it is a helper if you use SMC.
  19. *
  20. * if you want to specify S as vector then use more generic glm_mat4_rmc() func.
  21. *
  22. * Example usage:
  23. * B(s) = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1})
  24. *
  25. * @param[in] s parameter between 0 and 1 (this will be [s3, s2, s, 1])
  26. * @param[in] m basis matrix
  27. * @param[in] c position/control vector
  28. *
  29. * @return B(s)
  30. */
  31. CGLM_INLINE
  32. float
  33. glms_smc(float s, mat4s m, vec4s c) {
  34. return glm_smc(s, m.raw, c.raw);
  35. }
  36. #endif /* cglms_curves_h */