示例#1
0
        /** 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
                    );
            }
        }
示例#2
0
		/** 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
								);
			}
		}
示例#3
0
		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);
		}
示例#4
0
		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);
		}
示例#5
0
        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);
        }
示例#6
0
        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);
        }