/** Searches for physics shapes that contains the point. */ public void QueryPoint(Func <CCPhysicsWorld, CCPhysicsShape, object, bool> func, CCPoint point, object data) { cp.AssertWarn(func != null, "func shouldn't be nullptr"); if (func != null) { //CCPointQueryCallbackInfo info = new CCPointQueryCallbackInfo(this, func, data); CCPointQueryCallbackInfo info = new CCPointQueryCallbackInfo(this, func, data); CCPhysicsWorldCallback.continues = true; this._info.getSpace().PointQuery( PhysicsHelper.CCPointToCpVect(point), 0f, new cpShapeFilter(cp.NO_GROUP, cp.ALL_LAYERS, cp.ALL_LAYERS), (s, v, f1, f2, o) => CCPhysicsWorldCallback.QueryPointFunc(s, 0f, point, ref info), data ); } }
/** Searches for physics shapes that contains the point. */ public void QueryPoint(Func<CCPhysicsWorld, CCPhysicsShape, object, bool> func, CCPoint point, object data) { cp.AssertWarn(func != null, "func shouldn't be nullptr"); if (func != null) { //CCPointQueryCallbackInfo info = new CCPointQueryCallbackInfo(this, func, data); CCPointQueryCallbackInfo info = new CCPointQueryCallbackInfo(this, func, data); CCPhysicsWorldCallback.continues = true; this._info.getSpace().PointQuery( PhysicsHelper.CCPointToCpVect(point), 0f, new cpShapeFilter(cp.NO_GROUP, cp.ALL_LAYERS, cp.ALL_LAYERS), (s, v, f1, f2, o) => CCPhysicsWorldCallback.QueryPointFunc(s, 0f, point, ref info), data ); } }
public static void QueryPointFunc(cpShape shape, float distance, CCPoint point, ref CCPointQueryCallbackInfo info) { CCPhysicsShapeInfo it; cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it)); continues = info.func(info.world, it.getShape(), info.data); }
public static void QueryPointFunc(cpShape shape, float distance, CCPoint point, ref CCPointQueryCallbackInfo info) { CCPhysicsShapeInfo it; cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it)); Continues = info.Function(info.World, it.Shape, info.Data); }