bevy/crates/bevy_gizmos/src
Lynn 05e2552a68
Add Rounded box gizmos (#11948)
# 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:

<img width="1440" alt="Screenshot 2024-02-28 at 01 47 28"
src="https://github.com/bevyengine/bevy/assets/62256001/654e30ca-c091-4f14-a402-90138e95c71b">

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

<img width="1440" alt="Screenshot 2024-02-28 at 01 59 37"
src="https://github.com/bevyengine/bevy/assets/62256001/3904697a-5462-4ee7-abd9-3e893ca07082">
<img width="1440" alt="Screenshot 2024-02-28 at 01 59 47"
src="https://github.com/bevyengine/bevy/assets/62256001/a8892cfd-3aad-4c0c-87eb-559c17c8864c">

---------

Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
Co-authored-by: James Gayfer <10660608+jgayfer@users.noreply.github.com>
2024-05-16 16:13:49 +00:00
..
primitives gizmos: take normal of normal on plane 3d before rotation (#13326) 2024-05-11 19:32:31 +00:00
aabb.rs Migrate from LegacyColor to bevy_color::Color (#12163) 2024-02-29 19:35:12 +00:00
arcs.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
arrows.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
circles.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
config.rs Gizmo line styles (#12394) 2024-03-25 19:10:45 +00:00
gizmos.rs Add AXES iterators for Dir types (#13305) 2024-05-09 23:30:44 +00:00
grid.rs Contextually clearing gizmos (#10973) 2024-04-23 00:16:12 +00:00
lib.rs Add Rounded box gizmos (#11948) 2024-05-16 16:13:49 +00:00
light.rs Add basic light gizmos (#12228) 2024-03-03 18:50:46 +00:00
line_joints.wgsl Gizmo line joints (#12252) 2024-03-11 19:21:32 +00:00
lines.wgsl Gizmo line styles (#12394) 2024-03-25 19:10:45 +00:00
pipeline_2d.rs Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
pipeline_3d.rs Implement GPU frustum culling. (#12889) 2024-04-28 12:50:00 +00:00
rounded_box.rs Add Rounded box gizmos (#11948) 2024-05-16 16:13:49 +00:00