public PointQueryContext(cpVect point1, float maxDistance1, cpShapeFilter filter1, cpSpacePointQueryFunc func1) { // TODO: Complete member initialization this.point = point1; this.maxDistance = maxDistance1; this.filter = filter1; this.func = func1; }
public SegmentQueryContext(cpVect start1, cpVect end1, float radius1, cpShapeFilter filter1, cpSpacePointQueryFunc func1) { // TODO: Complete member initialization this.start = start1; this.end = end1; this.radius = radius1; this.filter = filter1; this.func = func1; }
cpSpacePointQuery(cpSpace space, cpVect point, cpLayers layers, cpGroup group, cpSpacePointQueryFunc func, object data) {
public void PointQuery(cpVect point, float maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, object data) { PointQueryContext context = new PointQueryContext(point, maxDistance, filter, func); cpBB bb = cpBB.cpBBNewForCircle(point, cp.cpfmax(maxDistance, 0.0f)); Lock(); { this.staticShapes.Query(context, bb, (ctx, shape, colid, o) => NearestPointQuery((PointQueryContext)ctx, shape as cpShape, colid, o), data); this.dynamicShapes.Query(context, bb, (ctx, shape, colid, o) => NearestPointQuery((PointQueryContext)ctx, shape as cpShape, colid, o), data); } Unlock(true); }
public void SegmentQuery(cpVect start, cpVect end, float radius, cpShapeFilter filter, cpSpacePointQueryFunc func, object data) { SegmentQueryContext context = new SegmentQueryContext( start, end, radius, filter, func ); Lock(); { this.staticShapes.SegmentQuery(context, start, end, 1.0f, (o1, o2, o3) => SegmentQueryFunc((SegmentQueryContext)o1, o2 as cpShape, o3) , data); this.dynamicShapes.SegmentQuery(context, start, end, 1.0f, (o1, o2, o3) => SegmentQueryFunc((SegmentQueryContext)o1, o2 as cpShape, o3) , data); } Unlock(true); }