예제 #1
0
        public static void CircleSupportTests()
        {
            CollisionShape cs1   = CollisionShape.CreateCircle(3);
            Vec2           test1 = Vec2.XAxis;
            Vec2           test2 = Vec2.YAxis;
            Vec2           test3 = Vec2.One.normalized;
            Vec2           test4 = Vec2.fromAngle(3.1415926 * (1.0 / 4.0));
            Vec2           test5 = Vec2.fromAngle(3.1415926 * (3.0 / 4.0));
            Vec2           test6 = Vec2.fromAngle(3.1415926 * (5.0 / 4.0));
            Vec2           test7 = Vec2.fromAngle(3.1415926 * (7.0 / 4.0));

            Vec2 test8  = Vec2.fromAngle(3.1415926 * (1.0 / 6.0));
            Vec2 test9  = Vec2.fromAngle(3.1415926 * (5.0 / 6.0));
            Vec2 test10 = Vec2.fromAngle(3.1415926 * (7.0 / 6.0));
            Vec2 test11 = Vec2.fromAngle(3.1415926 * (11.0 / 6.0));

            Console.WriteLine(cs1.Support(test1, 0));
            Console.WriteLine(cs1.Support(test2, 0));
            Console.WriteLine(cs1.Support(test3, 0));
            Console.WriteLine(cs1.Support(test4, 0));
            Console.WriteLine(cs1.Support(test5, 0));
            Console.WriteLine(cs1.Support(test6, 0));
            Console.WriteLine(cs1.Support(test7, 0));
            Console.WriteLine(cs1.Support(test8, 0));
            Console.WriteLine(cs1.Support(test9, 0));
            Console.WriteLine(cs1.Support(test10, 0));
            Console.WriteLine(cs1.Support(test11, 0));
        }