view_lh_no.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /*
  8. Functions:
  9. CGLM_INLINE void glm_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest)
  10. CGLM_INLINE void glm_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest)
  11. CGLM_INLINE void glm_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest)
  12. */
  13. #ifndef cglm_view_lh_no_h
  14. #define cglm_view_lh_no_h
  15. #include "../common.h"
  16. #include "view_lh.h"
  17. /*!
  18. * @brief set up view matrix with left handed coordinate system.
  19. *
  20. * NOTE: The UP vector must not be parallel to the line of sight from
  21. * the eye point to the reference point
  22. *
  23. * @param[in] eye eye vector
  24. * @param[in] center center vector
  25. * @param[in] up up vector
  26. * @param[out] dest result matrix
  27. */
  28. CGLM_INLINE
  29. void
  30. glm_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest) {
  31. glm_lookat_lh(eye, center, up, dest);
  32. }
  33. /*!
  34. * @brief set up view matrix with left handed coordinate system.
  35. *
  36. * convenient wrapper for lookat: if you only have direction not target self
  37. * then this might be useful. Because you need to get target from direction.
  38. *
  39. * NOTE: The UP vector must not be parallel to the line of sight from
  40. * the eye point to the reference point
  41. *
  42. * @param[in] eye eye vector
  43. * @param[in] dir direction vector
  44. * @param[in] up up vector
  45. * @param[out] dest result matrix
  46. */
  47. CGLM_INLINE
  48. void
  49. glm_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest) {
  50. glm_look_lh(eye, dir, up, dest);
  51. }
  52. /*!
  53. * @brief set up view matrix with left handed coordinate system.
  54. *
  55. * convenient wrapper for look: if you only have direction and if you don't
  56. * care what UP vector is then this might be useful to create view matrix
  57. *
  58. * @param[in] eye eye vector
  59. * @param[in] dir direction vector
  60. * @param[out] dest result matrix
  61. */
  62. CGLM_INLINE
  63. void
  64. glm_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest) {
  65. glm_look_anyup_lh(eye, dir, dest);
  66. }
  67. #endif /*cglm_view_lh_no_h*/