mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
210c79c9f9
# Objective Since https://github.com/bevyengine/bevy/pull/14731 is merged, it unblocked a few utility methods for 2D arcs. In 2D the pendant to `long_arc_3d_between` and `short_arc_3d_between` are missing. Since `arc_2d` can be a bit hard to use, this PR is trying to plug some holes in the `arcs` API. ## Solution Implement - `long_arc_2d_between(center, from, tp, color)` - `short_arc_2d_between(center, from, tp, color)` ## Testing - There are new doc tests - The `2d_gizmos` example has been extended a bit to include a few more arcs which can easily be checked with respect to the grid --- ## Showcase ![image](https://github.com/user-attachments/assets/b90ad8b1-86c2-4304-a481-4f9a5246c457) Code related to the screenshot (from outer = first line to inner = last line) ```rust my_gizmos.arc_2d(Isometry2d::IDENTITY, FRAC_PI_2, 80.0, ORANGE_RED); my_gizmos.short_arc_2d_between(Vec2::ZERO, Vec2::X * 40.0, Vec2::Y * 40.0, ORANGE_RED); my_gizmos.long_arc_2d_between(Vec2::ZERO, Vec2::X * 20.0, Vec2::Y * 20.0, ORANGE_RED); ``` |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml | ||
README.md |