From 7b214503608550dc2853b9e01526723f8c65baf3 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 May 2020 14:14:06 +0200 Subject: Added mat4 in libftm, can rotate, scale and translate vector --- vendor/libftm/inc/libftm_mat4.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 vendor/libftm/inc/libftm_mat4.h (limited to 'vendor/libftm/inc/libftm_mat4.h') 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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 +# include +# 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 -- cgit