static void bbQueryHelper(cpBB *bb, cpShape *shape, bbQueryContext *context) { if( !(shape->group && context->group == shape->group) && (context->layers&shape->layers) && cpBBintersects(*bb, shape->bb) ){ context->func(shape, context->data); } }
static inline int queryReject(cpShape *a, cpShape *b) { return // BBoxes must overlap !cpBBintersects(a->bb, b->bb) // Don't collide shapes attached to the same body. || a->body == b->body // Don't collide objects in the same non-zero group || (a->group && b->group && a->group == b->group) // Don't collide objects that don't share at least on layer. || !(a->layers & b->layers); }
static VALUE rb_cpBBintersects(VALUE self, VALUE other) { int value = cpBBintersects(*BBGET(self), *BBGET(other)); return value ? Qtrue : Qfalse; }
int bmx_cpbb_intersects(cpBB * bb, cpBB * other) { return cpBBintersects(*bb, *other); }