-
Notifications
You must be signed in to change notification settings - Fork 2
/
bounds.c
28 lines (25 loc) · 1.22 KB
/
bounds.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bounds.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: snicolet <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/05/29 03:26:12 by snicolet #+# #+# */
/* Updated: 2016/06/16 13:54:53 by snicolet ### ########.fr */
/* */
/* ************************************************************************** */
#include "rt.h"
static int rt_bounds_update_in(t_obj *obj, int mode, void *userdata)
{
(void)userdata;
if (mode == PREFIX)
obj->bounds = obj->hitbox;
else if (obj->parent)
update_cube(&obj->parent->bounds, &obj->bounds);
return (0);
}
void rt_bounds_update(t_obj *node)
{
rt_node_foreach(node, SUFFIX | PREFIX, &rt_bounds_update_in, NULL);
}