scop/inc/mat4.h

44 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mat4.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/22 20:35:00 by gbrochar #+# #+# */
/* Updated: 2020/12/23 16:11:16 by gbrochar ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MAT4_H
# define MAT4_H
typedef struct s_mat4 t_mat4;
typedef struct s_persp_tool t_persp_tool;
struct s_mat4
{
double data[16];
};
struct s_persp_tool
{
double xmin;
double xmax;
double ymin;
double ymax;
};
t_mat4 mat4_transpose(t_mat4 m);
t_mat4 mat4_multiply(t_mat4 m, t_mat4 rhs);
t_mat4 mat4_multiply_tmp(t_mat4 m, t_mat4 rhs);
t_mat4 mat4_perspective(
double fov, double aspect, double near, double far);
t_mat4 mat4_frustrum(
t_persp_tool tool, double near, double far);
t_mat4 mat4_frustrum_tmp(double x, double y, t_vec4 tool);
#endif