Exemplo n.º 1
0
        public static List <Fixture> AttachSolidArc(FP density, FP radians, int sides, FP radius, TSVector2 position, FP angle, Body body)
        {
            Vertices vertices = PolygonTools.CreateArc(radians, sides, radius);

            vertices.Rotate((MathHelper.Pi - radians) / 2 + angle);
            vertices.Translate(ref position);
            vertices.Add(vertices[0]);
            List <Vertices> list = Triangulate.ConvexPartition(vertices, TriangulationAlgorithm.Earclip, true, FP.EN3);

            return(FixtureFactory.AttachCompoundPolygon(list, density, body, null));
        }