From 0ae5be6c6697f5f5f578a27c5ad9ba845aec43c9 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 9 May 2020 21:31:30 +0200 Subject: Added basic vector and matrix library --- vendor/libftm/inc/libftm_vec4.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 vendor/libftm/inc/libftm_vec4.h (limited to 'vendor/libftm/inc/libftm_vec4.h') 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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 -- cgit