Example #1
0
        public static void RayCastCallbackFunc(cpShape shape, float t, CCPoint n, ref CCRayCastCallbackInfo info)
        {
            if (!continues)
            {
                return;
            }

            CCPhysicsShapeInfo it;

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

            CCPhysicsRayCastInfo callbackInfo = new CCPhysicsRayCastInfo(
                it.getShape(),
                info.p1,
                info.p2,
                new CCPoint(info.p1.X + (info.p2.X - info.p1.X) * t, info.p1.Y + (info.p2.Y - info.p1.Y) * t),
                new CCPoint(n.Y, n.Y),
                t, null
                );

            continues = info.func(info.world, callbackInfo, info.data);
        }
Example #2
0
        public static void RayCastCallbackFunc(cpShape shape, float t, CCPoint n, ref CCRayCastCallbackInfo info)
        {
            if (!Continues)
            {
                return;
            }

            CCPhysicsShapeInfo it;

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

            CCPhysicsRayCastInfo callbackInfo = new CCPhysicsRayCastInfo(
                it.Shape,
                info.Pont1,
                info.Point2,
                new CCPoint(info.Pont1.X + (info.Point2.X - info.Pont1.X) * t, info.Pont1.Y + (info.Point2.Y - info.Pont1.Y) * t),
                new CCPoint(n.Y, n.Y),
                t, null
                );

            Continues = info.Function(info.World, callbackInfo, info.Data);
        }
Example #3
0
		public static void RayCastCallbackFunc(cpShape shape, float t, CCPoint n, ref CCRayCastCallbackInfo info)
		{
			if (!continues)
			{
				return;
			}

			CCPhysicsShapeInfo it;

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

			CCPhysicsRayCastInfo callbackInfo = new CCPhysicsRayCastInfo(
		it.getShape(),
		info.p1,
		info.p2,
		new CCPoint(info.p1.X + (info.p2.X - info.p1.X) * t, info.p1.Y + (info.p2.Y - info.p1.Y) * t),
		 new CCPoint(n.Y, n.Y),
		t, null
	);

			continues = info.func(info.world, callbackInfo, info.data);
		}
Example #4
0
		public static void RayCastCallbackFunc(cpShape shape, float t, CCPoint n, ref CCRayCastCallbackInfo info)
		{
			if (!Continues)
			{
				return;
			}

			CCPhysicsShapeInfo it;

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

			CCPhysicsRayCastInfo callbackInfo = new CCPhysicsRayCastInfo(
        		it.Shape,
        		info.Pont1,
        		info.Point2,
        		new CCPoint(info.Pont1.X + (info.Point2.X - info.Pont1.X) * t, info.Pont1.Y + (info.Point2.Y - info.Pont1.Y) * t),
        		 new CCPoint(n.Y, n.Y),
        		t, null
        	);

			Continues = info.Function(info.World, callbackInfo, info.Data);
		}