-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathray.c
35 lines (30 loc) · 1.2 KB
/
ray.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
25
26
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ray.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sboeuf <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/02/16 19:21:04 by sboeuf #+# #+# */
/* Updated: 2014/02/16 19:21:06 by sboeuf ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/rtv1.h"
t_ray *new_ray(t_vect *o, t_vect *d)
{
t_ray *r;
r = (t_ray*)malloc(sizeof(t_ray));
r->origin = o;
r->direction = d;
return (r);
}
t_ray *cpy_ray(t_ray *r)
{
return (new_ray(r->origin, r->direction));
}
void delete_ray(t_ray *r)
{
delete_vect(r->origin);
delete_vect(r->direction);
free(r);
}