I can't find any example for using function cpSpaceBBQuery.
Thanks a lot for advices
Code: Select all
/*
ScreenBox.l = 0;
ScreenBox.t = 0;
ScreenBox.r = 1280;
ScreenBox.b = 760;
static_objects_filter.categories = 1;
static_objects_filter.group = 0;
static_objects_filter.mask = 1 | 2 | 3;
...
cpShapeSetFilter(static_objects[i][ii].shape, static_objects_filter);
...
*/
void draw(cpShape *shape, void *data)
{
draw_bitmap(bitmap_static_objects[0],
STATIC_OBJECT_W / 2, STATIC_OBJECT_H / 2,
cpBodyGetPosition(cpShapeGetBody(shape)).x - ScreenBox.l,
cpBodyGetPosition(cpShapeGetBody(shape)).y - ScreenBox.t,
0, 0);
printf("Called?"); /*no printf*/
}
void to_display()
{
cpSpaceBBQuery(space, ScreenBox, static_objects_filter, (cpSpaceBBQueryFunc)draw, 0);
}