From 1fd8b192c03cfaad385d154ca5df331ad32b3cc9 Mon Sep 17 00:00:00 2001 From: H3XploR Date: Tue, 18 Feb 2025 18:07:38 +0100 Subject: [PATCH] update norme --- miniRT | Bin 348608 -> 348608 bytes miniRT.h | 4 ++-- shadows.c | 30 +++++++++++++++--------------- tags | 8 ++++---- trace.c | 6 +++--- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/miniRT b/miniRT index 315364e5c770e5121885045b1c3ff176539c51c6..efc7ba5119b028e29d7d3934ac9ed0fade5d321e 100755 GIT binary patch delta 2264 zcmZuzdr(wW7(eH`_b$7j$RZ#MDpK(f6v4M6qNtfoiil_`FL~_BYZL_19AzU>Bq7-v z{i4azFwr!F8fK?IbO4z~d-5fe~T<3LgDbaEt{ProeQ6znM=5TYd1|{|OF!DmcjEKA!@Y z6@DDM(qIz*+`sS_+55IL)Ft>(rlA!LJi!i_!ZNXl;V?zT+DuqNE*CQ4!{9@AN!Sa%3rG^fQpO7>-(Gwx z3rhJ9_%I8G^9~%I4dJ{Eld@qe--|ujFpVF>2iaibr!Y7NrcmM390;YXr8#h6q=&L{ zt3~7jS0Q89=?{%@b9E%OZ^gV-u!|4J{#B4g5zBIQ_IoZQaSz7kQ9&!t&jaL{*p~+} zWc10`jnVnAXZDjFi&=r*u{v;%u{5s@WH>L3VyH~bywBKNvv9cb*f_Wsy$T?j`j0Pw zxm2pE0CGaS$rHLm^U2NETum$IrjC=;^&q@j01@%aNgrW$kxiX$AZ`Oc&4GtkLmrPn-$L5fa$Hgfb0`E0 zp(sG?PU#L^OMb?_U=RirLEJMnq-YztpE$3J^iybBOlc8|ey-lPu%L(rW5t#t*cL2q z6ihaKO!^ad%B*5?F}y@hjm5Bs*I{f4*n<8!e34jA#Crf&mcTT5LHxbM7Qj`&SOk|B zqDjmv$k6w=poAN2P?GC{fyb-O*_-tAF(Mp=v2 zRNB|sEAlII*5(!4^D8TGg{F>i@7C1qzpgB$>!L;P6Kl+BvDWgtbZND%{IY;;e3vl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 +/* Updated: 2025/02/18 17:50:11 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -221,7 +221,7 @@ float intersectCylinder(t_ray ray, t_cylinder cy, t_vec3 *hitNormal); float intersectPlane(t_ray ray, t_plane p, t_vec3 *hitNormal); float intersectSphere(t_ray ray, t_sphere s, t_vec3 *hitNormal); bool is_in_shadow(t_vec3 hitPoint, t_vec3 lightPos, t_scene scene); -bool intersectObjects(t_ray ray, float *tMin, t_vec3 *hitNormal, +bool intersect_objects(t_ray ray, float *tMin, t_vec3 *hitNormal, t_vec3 *objColor, t_scene scene); t_vec3 calcLighting(t_vec3 hitPoint, t_vec3 hitNormal, t_vec3 objColor, t_scene scene); diff --git a/shadows.c b/shadows.c index 51751f6..ee61115 100644 --- a/shadows.c +++ b/shadows.c @@ -13,13 +13,13 @@ #include "miniRT.h" // Vérifie les intersections avec les sphères -static bool check_shadow_sphere(const t_ray shadow_ray, \ - float max_t, t_scene scene) +static bool check_shadow_sphere(const t_ray shadow_ray, float max_t, + t_scene scene) { const float epsilon = 1e-3f; - int i; - t_vec3 dummy; - float t; + int i; + t_vec3 dummy; + float t; i = 0; while (i < scene.numSpheres) @@ -33,13 +33,13 @@ static bool check_shadow_sphere(const t_ray shadow_ray, \ } // Vérifie les intersections avec les plans -static bool check_shadow_plane(const t_ray shadow_ray, \ - float max_t, t_scene scene) +static bool check_shadow_plane(const t_ray shadow_ray, float max_t, + t_scene scene) { const float epsilon = 1e-3f; - int i; - t_vec3 dummy; - float t; + int i; + t_vec3 dummy; + float t; i = 0; while (i < scene.numPlanes) @@ -53,13 +53,13 @@ static bool check_shadow_plane(const t_ray shadow_ray, \ } // Vérifie les intersections avec les cylindres -static bool check_shadow_cylinder(const t_ray shadow_ray, \ - float max_t, t_scene scene) +static bool check_shadow_cylinder(const t_ray shadow_ray, float max_t, + t_scene scene) { const float epsilon = 1e-3f; - int i; - t_vec3 dummy; - float t; + int i; + t_vec3 dummy; + float t; i = 0; while (i < scene.numCylinders) diff --git a/tags b/tags index 89f06b8..99e747b 100644 --- a/tags +++ b/tags @@ -292,9 +292,9 @@ center miniRT.h /^ t_vec3 center;$/;" m struct:s_cylinder typeref:typename:t_ve center miniRT.h /^ t_vec3 center;$/;" m struct:s_sphere typeref:typename:t_vec3 check minilibx-linux/Makefile.mk /^check: all$/;" t check_if_max check.c /^void check_if_max(t_scene scene, const int to_test, const int max)$/;" f typeref:typename:void -check_shadow_cylinder shadows.c /^static bool check_shadow_cylinder(const t_ray shadow_ray, \\$/;" f typeref:typename:bool file: -check_shadow_plane shadows.c /^static bool check_shadow_plane(const t_ray shadow_ray, \\$/;" f typeref:typename:bool file: -check_shadow_sphere shadows.c /^static bool check_shadow_sphere(const t_ray shadow_ray, \\$/;" f typeref:typename:bool file: +check_shadow_cylinder shadows.c /^static bool check_shadow_cylinder(const t_ray shadow_ray, float max_t,$/;" f typeref:typename:bool file: +check_shadow_plane shadows.c /^static bool check_shadow_plane(const t_ray shadow_ray, float max_t,$/;" f typeref:typename:bool file: +check_shadow_sphere shadows.c /^static bool check_shadow_sphere(const t_ray shadow_ray, float max_t,$/;" f typeref:typename:bool file: check_sign ft_atof.c /^inline static char *check_sign(char *str, int *sign)$/;" f typeref:typename:char * file: check_tokens check.c /^int check_tokens(char **tokens, int expected)$/;" f typeref:typename:int clean libft/Makefile /^clean:$/;" t @@ -434,8 +434,8 @@ img miniRT.h /^ void *img;$/;" m struct:s_app typeref:typename:void * init_app_config main.c /^static int init_app_config(t_app *app, int argc, char **argv)$/;" f typeref:typename:int file: init_intersection parsing_cylinder_utils.c /^static int init_intersection(t_ray ray, t_cylinder cy, t_calc *calc)$/;" f typeref:typename:int file: init_mlx_and_image main.c /^static int init_mlx_and_image(t_app *app)$/;" f typeref:typename:int file: +interesct_objects trace.c /^bool interesct_objects(t_ray ray, float *tMin, t_vec3 *hitNormal,$/;" f typeref:typename:bool intersectCylinder parsing_cylinder_utils.c /^float intersectCylinder(t_ray ray, t_cylinder cy, t_vec3 *hitNormal)$/;" f typeref:typename:float -intersectObjects trace.c /^bool intersectObjects(t_ray ray, float *tMin, t_vec3 *hitNormal,$/;" f typeref:typename:bool intersectPlane parsing_plane.c /^float intersectPlane(t_ray ray, t_plane p, t_vec3 *hitNormal)$/;" f typeref:typename:float intersectSphere parsing_sphere.c /^float intersectSphere(t_ray ray, t_sphere s, t_vec3 *hitNormal)$/;" f typeref:typename:float is_in_shadow shadows.c /^bool is_in_shadow(t_vec3 hitPoint, t_vec3 lightPos, t_scene scene)$/;" f typeref:typename:bool diff --git a/trace.c b/trace.c index 02e9753..8cea09c 100644 --- a/trace.c +++ b/trace.c @@ -6,7 +6,7 @@ /* By: yantoine +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/02/17 19:07:07 by yantoine #+# #+# */ -/* Updated: 2025/02/18 17:40:17 by yantoine ### ########.fr */ +/* Updated: 2025/02/18 18:04:11 by yantoine ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,7 @@ // Renvoie true si le rayon intersecte un objet, et met à jour tMin, //hitNormal et objColor -bool intersectObjects(t_ray ray, float *tMin, t_vec3 *hitNormal, +bool interesct_objects(t_ray ray, float *tMin, t_vec3 *hitNormal, t_vec3 *objColor, t_scene scene) { bool hit; @@ -117,7 +117,7 @@ t_vec3 trace(t_ray ray, t_scene scene) tMin = 1e9; hitNormal = (t_vec3){0, 0, 0}; objColor = (t_vec3){0, 0, 0}; - if (intersectObjects(ray, &tMin, &hitNormal, &objColor, scene)) + if (interesct_objects(ray, &tMin, &hitNormal, &objColor, scene)) { hitPoint = vec3_add(ray.origin, vec3_scale(ray.dir, tMin)); return (calcLighting(hitPoint, hitNormal, objColor, scene));