bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add Rounded box gizmos

Open lynn-lumen opened this issue 1 year ago • 0 comments

Objective

  • Implement rounded cuboids and rectangles, suggestion of #9400

Solution

  • Added Gizmos::rounded_cuboid, Gizmos::rounded_rect and Gizmos::rounded_rect_2d.
  • All of these return builders that allow configuring of the corner/edge radius using .corner_radius(...) or .edge_radius(...) as well as the line segments of each arc using .arc_segments(...).

Changelog

  • Added a new rounded_box module to bevy_gizmos containing all of the above methods and builders.
  • Updated the examples 2d_gizmos and 3d_gizmos

Additional information

The 3d example now looks like this:

Screenshot 2024-02-28 at 01 47 28

And this is the updated 2d example showcasing negative corner radius:

Screenshot 2024-02-28 at 01 59 37 Screenshot 2024-02-28 at 01 59 47

lynn-lumen avatar Feb 18 '24 15:02 lynn-lumen