//MARK: BB Query Functions public ulong BBQueryFunc(BBQueryContext context, cpShape shape, ulong id, object data) { if ( !cpShapeFilter.Reject(shape.filter, context.filter) && context.bb.Intersects(shape.bb) ) { context.func(shape, data); } return(id); }
public void BBQuery(cpBB bb, cpShapeFilter filter, cpSpaceBBQueryFunc func, object data) { BBQueryContext context = new BBQueryContext(bb, filter, func); Lock(); { this.staticShapes.Query(context, bb, (o1, o2, s, o3) => BBQueryFunc((BBQueryContext)o1, o2 as cpShape, s, o3) , data); this.dynamicShapes.Query(context, bb, (o1, o2, s, o3) => BBQueryFunc((BBQueryContext)o1, o2 as cpShape, s, o3) , data); } Unlock(true); }