summaryrefslogtreecommitdiff
path: root/include/cglm/clipspace/view_lh_zo.h
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-25 15:10:37 -0600
committerAaditya Dhruv <[email protected]>2026-01-25 15:10:37 -0600
commit118980e02e59ff31871df59dce257075394f3533 (patch)
tree26fba4492bb4b561d21bf49b35d892a821d54fab /include/cglm/clipspace/view_lh_zo.h
parent0e6e1245b70df4dfcba135d50e1b53d1a8ef7eb8 (diff)
wip
Diffstat (limited to 'include/cglm/clipspace/view_lh_zo.h')
-rw-r--r--include/cglm/clipspace/view_lh_zo.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/cglm/clipspace/view_lh_zo.h b/include/cglm/clipspace/view_lh_zo.h
new file mode 100644
index 0000000..6b0c4d1
--- /dev/null
+++ b/include/cglm/clipspace/view_lh_zo.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c), Recep Aslantas.
+ *
+ * MIT License (MIT), http://opensource.org/licenses/MIT
+ * Full license can be found in the LICENSE file
+ */
+
+/*
+ Functions:
+ CGLM_INLINE void glm_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest)
+ CGLM_INLINE void glm_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest)
+ CGLM_INLINE void glm_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest)
+ */
+
+#ifndef cglm_view_lh_zo_h
+#define cglm_view_lh_zo_h
+
+#include "../common.h"
+#include "view_lh.h"
+
+/*!
+ * @brief set up view matrix with left handed coordinate system.
+ *
+ * NOTE: The UP vector must not be parallel to the line of sight from
+ * the eye point to the reference point
+ *
+ * @param[in] eye eye vector
+ * @param[in] center center vector
+ * @param[in] up up vector
+ * @param[out] dest result matrix
+ */
+CGLM_INLINE
+void
+glm_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest) {
+ glm_lookat_lh(eye, center, up, dest);
+}
+
+/*!
+ * @brief set up view matrix with left handed coordinate system.
+ *
+ * convenient wrapper for lookat: if you only have direction not target self
+ * then this might be useful. Because you need to get target from direction.
+ *
+ * NOTE: The UP vector must not be parallel to the line of sight from
+ * the eye point to the reference point
+ *
+ * @param[in] eye eye vector
+ * @param[in] dir direction vector
+ * @param[in] up up vector
+ * @param[out] dest result matrix
+ */
+CGLM_INLINE
+void
+glm_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest) {
+ glm_look_lh(eye, dir, up, dest);
+}
+
+/*!
+ * @brief set up view matrix with left handed coordinate system.
+ *
+ * convenient wrapper for look: if you only have direction and if you don't
+ * care what UP vector is then this might be useful to create view matrix
+ *
+ * @param[in] eye eye vector
+ * @param[in] dir direction vector
+ * @param[out] dest result matrix
+ */
+CGLM_INLINE
+void
+glm_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest) {
+ glm_look_anyup_lh(eye, dir, dest);
+}
+
+#endif /*cglm_view_lh_zo_h*/