-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_directional_light.c
24 lines (21 loc) · 1.21 KB
/
process_directional_light.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* process_directional_light.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ajaehaer <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/16 15:11:35 by ajaehaer #+# #+# */
/* Updated: 2019/03/20 15:48:32 by ajaehaer ### ########.fr */
/* */
/* ************************************************************************** */
#include "light.h"
void process_directional_light(t_lighting lighting, t_lightsource light,
double *diffuse, double *specular)
{
t_vector direction;
direction = normalize(vector_sub(lighting.point, light.position));
if (acos(dot(direction, light.direction)) > light.angle)
return ;
process_point_light(lighting, light, diffuse, specular);
}