/// <inheritdoc/> public void DrawConvexPolygon(ReadOnlySpan <Point2> points, ColorStyle color) { if (color.IsEmpty) { return; } Span <Point3> vertices = stackalloc Point3[points.Length]; Point3.Transform(vertices, points, _DepthZ); switch (vertices.Length) { case 0: return; case 1: return; case 2: _DrawThinLine(vertices[0], vertices[1], color.ToXna()); return; default: _DrawConvexSurface(vertices, color.ToXna(), false); return; } }
/// <inheritdoc/> public void DrawThinLines(ReadOnlySpan <Point2> points, float thickness, ColorStyle color) { if (color.IsEmpty) { return; } Span <Point3> vertices = stackalloc Point3[points.Length]; Point3.Transform(vertices, points, _DepthZ); var c = color.ToXna(); for (int i = 1; i < vertices.Length; ++i) { _DrawThinLine(vertices[i - 1], vertices[i], c); } }