cam.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 cglmc_cam_h
  8. #define cglmc_cam_h
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #include "../cglm.h"
  13. CGLM_EXPORT
  14. void
  15. glmc_frustum(float left, float right,
  16. float bottom, float top,
  17. float nearZ, float farZ,
  18. mat4 dest);
  19. CGLM_EXPORT
  20. void
  21. glmc_ortho(float left, float right,
  22. float bottom, float top,
  23. float nearZ, float farZ,
  24. mat4 dest);
  25. CGLM_EXPORT
  26. void
  27. glmc_ortho_aabb(vec3 box[2], mat4 dest);
  28. CGLM_EXPORT
  29. void
  30. glmc_ortho_aabb_p(vec3 box[2], float padding, mat4 dest);
  31. CGLM_EXPORT
  32. void
  33. glmc_ortho_aabb_pz(vec3 box[2], float padding, mat4 dest);
  34. CGLM_EXPORT
  35. void
  36. glmc_ortho_default(float aspect, mat4 dest);
  37. CGLM_EXPORT
  38. void
  39. glmc_ortho_default_s(float aspect, float size, mat4 dest);
  40. CGLM_EXPORT
  41. void
  42. glmc_perspective(float fovy, float aspect, float nearZ, float farZ, mat4 dest);
  43. CGLM_EXPORT
  44. void
  45. glmc_persp_move_far(mat4 proj, float deltaFar);
  46. CGLM_EXPORT
  47. void
  48. glmc_perspective_default(float aspect, mat4 dest);
  49. CGLM_EXPORT
  50. void
  51. glmc_perspective_resize(float aspect, mat4 proj);
  52. CGLM_EXPORT
  53. void
  54. glmc_lookat(vec3 eye, vec3 center, vec3 up, mat4 dest);
  55. CGLM_EXPORT
  56. void
  57. glmc_look(vec3 eye, vec3 dir, vec3 up, mat4 dest);
  58. CGLM_EXPORT
  59. void
  60. glmc_look_anyup(vec3 eye, vec3 dir, mat4 dest);
  61. CGLM_EXPORT
  62. void
  63. glmc_persp_decomp(mat4 proj,
  64. float * __restrict nearZ,
  65. float * __restrict farZ,
  66. float * __restrict top,
  67. float * __restrict bottom,
  68. float * __restrict left,
  69. float * __restrict right);
  70. CGLM_EXPORT
  71. void
  72. glmc_persp_decompv(mat4 proj, float dest[6]);
  73. CGLM_EXPORT
  74. void
  75. glmc_persp_decomp_x(mat4 proj,
  76. float * __restrict left,
  77. float * __restrict right);
  78. CGLM_EXPORT
  79. void
  80. glmc_persp_decomp_y(mat4 proj,
  81. float * __restrict top,
  82. float * __restrict bottom);
  83. CGLM_EXPORT
  84. void
  85. glmc_persp_decomp_z(mat4 proj,
  86. float * __restrict nearZ,
  87. float * __restrict farZ);
  88. CGLM_EXPORT
  89. void
  90. glmc_persp_decomp_far(mat4 proj, float * __restrict farZ);
  91. CGLM_EXPORT
  92. void
  93. glmc_persp_decomp_near(mat4 proj, float * __restrict nearZ);
  94. CGLM_EXPORT
  95. float
  96. glmc_persp_fovy(mat4 proj);
  97. CGLM_EXPORT
  98. float
  99. glmc_persp_aspect(mat4 proj);
  100. CGLM_EXPORT
  101. void
  102. glmc_persp_sizes(mat4 proj, float fovy, vec4 dest);
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif /* cglmc_cam_h */