aboutsummaryrefslogtreecommitdiff
path: root/vendor/libftm/inc
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-09 21:31:30 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-09 21:33:14 +0200
commit0ae5be6c6697f5f5f578a27c5ad9ba845aec43c9 (patch)
tree4cda3590f185cb485bf57e2dbd3d9b8b81dba6d7 /vendor/libftm/inc
parent6618fed5933f26d9bee8a42f049115146d4a1113 (diff)
downloadscop-0ae5be6c6697f5f5f578a27c5ad9ba845aec43c9.tar.gz
scop-0ae5be6c6697f5f5f578a27c5ad9ba845aec43c9.tar.bz2
scop-0ae5be6c6697f5f5f578a27c5ad9ba845aec43c9.zip
Added basic vector and matrix library
Diffstat (limited to 'vendor/libftm/inc')
-rw-r--r--vendor/libftm/inc/libftm_vec3.h31
-rw-r--r--vendor/libftm/inc/libftm_vec4.h30
2 files changed, 61 insertions, 0 deletions
diff --git a/vendor/libftm/inc/libftm_vec3.h b/vendor/libftm/inc/libftm_vec3.h
new file mode 100644
index 0000000..fc86dcb
--- /dev/null
+++ b/vendor/libftm/inc/libftm_vec3.h
@@ -0,0 +1,31 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm_vec3.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/09 20:38:30 by charles #+# #+# */
+/* Updated: 2020/05/09 21:12:05 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_VEC3_H
+# define LIBFTM_VEC3_H
+
+/*
+** \brief 3 component vector [x, y, z]
+*/
+
+typedef struct
+{
+ float v[3];
+} t_ftmvec3;
+
+t_ftmvec3 *ftm_vec3add(t_ftmvec3 *dst, t_ftmvec3 *other);
+t_ftmvec3 *ftm_vec3sub(t_ftmvec3 *dst, t_ftmvec3 *other);
+float ftm_vec3dot(t_ftmvec3 *a, t_ftmvec3 *b);
+void ftm_vec3cross(t_ftmvec3 *dst, t_ftmvec3 *a, t_ftmvec3 *b);
+t_ftmvec3 *ftm_vec3scale(t_ftmvec3 *dst, float scalar);
+
+#endif
diff --git a/vendor/libftm/inc/libftm_vec4.h b/vendor/libftm/inc/libftm_vec4.h
new file mode 100644
index 0000000..e89bd89
--- /dev/null
+++ b/vendor/libftm/inc/libftm_vec4.h
@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/09 20:48:30 by charles #+# #+# */
+/* Updated: 2020/05/09 21:11:12 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_VEC4_H
+# define LIBFTM_VEC4_H
+
+/*
+** \brief 4 component vector [x, y, z, w]
+*/
+
+typedef struct
+{
+ float v[4];
+} t_ftmvec4;
+
+t_ftmvec4 *ftm_vec4add(t_ftmvec4 *dst, t_ftmvec4 *other);
+t_ftmvec4 *ftm_vec4sub(t_ftmvec4 *dst, t_ftmvec4 *other);
+float ftm_vec4dot(t_ftmvec4 *a, t_ftmvec4 *b);
+t_ftmvec4 *ftm_vec4scale(t_ftmvec4 *dst, float scalar);
+
+#endif