aboutsummaryrefslogtreecommitdiff
path: root/vendor/libftm/inc
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-05-12 14:14:06 +0200
committerCharles <sircharlesaze@gmail.com>2020-05-12 14:14:06 +0200
commit7b214503608550dc2853b9e01526723f8c65baf3 (patch)
treeddbc37eb2627b43eb33774bd2bf205336cd1a9e6 /vendor/libftm/inc
parentd07d87964f13d3c1e6ad8c2f6d7db21101f1ef34 (diff)
downloadscop-7b214503608550dc2853b9e01526723f8c65baf3.tar.gz
scop-7b214503608550dc2853b9e01526723f8c65baf3.tar.bz2
scop-7b214503608550dc2853b9e01526723f8c65baf3.zip
Added mat4 in libftm, can rotate, scale and translate vector
Diffstat (limited to 'vendor/libftm/inc')
-rw-r--r--vendor/libftm/inc/libftm.h20
-rw-r--r--vendor/libftm/inc/libftm_mat4.h35
-rw-r--r--vendor/libftm/inc/libftm_vec3.h23
3 files changed, 78 insertions, 0 deletions
diff --git a/vendor/libftm/inc/libftm.h b/vendor/libftm/inc/libftm.h
new file mode 100644
index 0000000..9755d68
--- /dev/null
+++ b/vendor/libftm/inc/libftm.h
@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/12 11:07:32 by charles #+# #+# */
+/* Updated: 2020/05/12 13:42:27 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_H
+# define LIBFTM_H
+
+# include <math.h>
+
+float ftm_radian(float degree);
+
+#endif
diff --git a/vendor/libftm/inc/libftm_mat4.h b/vendor/libftm/inc/libftm_mat4.h
new file mode 100644
index 0000000..f69d7e6
--- /dev/null
+++ b/vendor/libftm/inc/libftm_mat4.h
@@ -0,0 +1,35 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm_mat4.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/12 11:04:59 by charles #+# #+# */
+/* Updated: 2020/05/12 13:53:40 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_MAT4_H
+# define LIBFTM_MAT4_H
+
+# include <stddef.h>
+# include <math.h>
+# include "libftm_vec3.h"
+
+typedef struct
+{
+ float m[4 * 4];
+} t_ftmmat4;
+
+t_ftmmat4 *ftm_mat4init_eye(t_ftmmat4 *mat4, float x);
+t_ftmmat4 *ftm_mat4init_fill(t_ftmmat4 *mat4, float x);
+t_ftmmat4 *ftm_mat4translate(t_ftmmat4 *mat4, float x, float y, float z);
+t_ftmmat4 *ftm_mat4rotate(t_ftmmat4 *mat4, float radian, t_ftmvec3 *axis);
+t_ftmmat4 *ftm_mat4scale(t_ftmmat4 *mat4, float x, float y, float z);
+t_ftmmat4 *ftm_mat4mul(t_ftmmat4 *dst, t_ftmmat4 *other);
+t_ftmmat4 *ftm_mat4set(t_ftmmat4 *mat4, size_t y, size_t x, float value);
+float ftm_mat4get(t_ftmmat4 *mat4, size_t y, size_t x);
+
+
+#endif
diff --git a/vendor/libftm/inc/libftm_vec3.h b/vendor/libftm/inc/libftm_vec3.h
new file mode 100644
index 0000000..e9df2c7
--- /dev/null
+++ b/vendor/libftm/inc/libftm_vec3.h
@@ -0,0 +1,23 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* libftm_vec3.h :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/12 11:02:29 by charles #+# #+# */
+/* Updated: 2020/05/12 11:04:08 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#ifndef LIBFTM_VEC3_H
+# define LIBFTM_VEC3_H
+
+typedef struct
+{
+ float v[3];
+} t_ftmvec3;
+
+t_ftmvec3 *ftm_vec3init(t_ftmvec3 *vec3, float x, float y, float z);
+
+#endif