Exemple #1
0
        public static Fixture AttachLineArc(float radians, int sides, float radius, bool closed, Body body)
        {
            var arc = PolygonTools.createArc(radians, sides, radius);

            arc.rotate((MathHelper.Pi - radians) / 2);
            return(closed ? AttachLoopShape(arc, body) : AttachChainShape(arc, body));
        }
Exemple #2
0
        public static List <Fixture> AttachSolidArc(float density, float radians, int sides, float radius, Body body)
        {
            var arc = PolygonTools.createArc(radians, sides, radius);

            arc.rotate((MathHelper.Pi - radians) / 2);

            // Close the arc
            arc.Add(arc[0]);

            var triangles = Triangulate.convexPartition(arc, TriangulationAlgorithm.Earclip);

            return(AttachCompoundPolygon(triangles, density, body));
        }