Exemple #1
0
        public static void QueryRectCallbackFunc(cpShape shape, CCRectQueryCallbackInfo info)
        {
            CCPhysicsShapeInfo it;

            cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it));

            if (!continues)
            {
                return;
            }

            continues = info.func(info.world, it.getShape(), info.data);
        }
        public static void QueryRectCallbackFunc(cpShape shape, CCRectQueryCallbackInfo info)
        {
            CCPhysicsShapeInfo it;

            cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it));

            if (!Continues)
            {
                return;
            }

            Continues = info.Function(info.World, it.Shape, info.Data);
        }
Exemple #3
0
        /** Searches for physics shapes that contains in the rect. */
        public void QueryRect(Func <CCPhysicsWorld, CCPhysicsShape, object, bool> func, CCRect rect, object data)
        {
            cp.AssertWarn(func != null, "func shouldn't be nullptr");
            if (func != null)
            {
                CCRectQueryCallbackInfo info = new CCRectQueryCallbackInfo()
                {
                    world = this,
                    func  = func,
                    data  = data
                };

                CCPhysicsWorldCallback.continues = true;

                this._info.getSpace().BBQuery(
                    PhysicsHelper.rect2cpbb(rect),
                    new cpShapeFilter(cp.NO_GROUP, cp.ALL_LAYERS, cp.ALL_LAYERS),
                    (s, o) => CCPhysicsWorldCallback.QueryRectCallbackFunc(s, info),
                    data
                    );
            }
        }
		/** Searches for physics shapes that contains in the rect. */
		public void QueryRect(Func<CCPhysicsWorld, CCPhysicsShape, object, bool> func, CCRect rect, object data)
		{
			cp.AssertWarn(func != null, "func shouldn't be nullptr");
			if (func != null)
			{
				CCRectQueryCallbackInfo info = new CCRectQueryCallbackInfo()
					{
						world = this,
						func = func,
						data = data
					};

				CCPhysicsWorldCallback.continues = true;

				this._info.getSpace().BBQuery(
									PhysicsHelper.rect2cpbb(rect),
									new cpShapeFilter(cp.NO_GROUP, cp.ALL_LAYERS, cp.ALL_LAYERS),
									(s, o) => CCPhysicsWorldCallback.QueryRectCallbackFunc(s, info),
									data
									);
			}
		}
		public static void QueryRectCallbackFunc(cpShape shape, CCRectQueryCallbackInfo info)
		{
			CCPhysicsShapeInfo it;

			cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it));

			if (!continues)
			{
				return;
			}

			continues = info.func(info.world, it.getShape(), info.data);

		}
		public static void QueryRectCallbackFunc(cpShape shape, CCRectQueryCallbackInfo info)
		{
			CCPhysicsShapeInfo it;

			cp.AssertWarn(!CCPhysicsShapeInfo.Map.TryGetValue(shape, out it));

			if (!Continues)
			{
				return;
			}

			Continues = info.Function(info.World, it.Shape, info.Data);

		}