Skip to content

axes_2d gizmo #12222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Jondolf opened this issue Mar 1, 2024 · 3 comments · Fixed by #12334
Closed

axes_2d gizmo #12222

Jondolf opened this issue Mar 1, 2024 · 3 comments · Fixed by #12334
Labels
A-Gizmos Visual editor and debug gizmos C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@Jondolf
Copy link
Contributor

Jondolf commented Mar 1, 2024

What problem does this solve or what need does it fill?

A follow-up item from #12211 by @mweatherley:

Implement something similar for 2d. Honestly, I have no idea if this is desired/useful, but I could probably just implement it in this PR if that's the case.

#12211 added a gizmo for rendering the XYZ axes relative to a Transform (or impl TransformPoint). This is useful for 3D, but it'd also be useful to be able to draw just the XY axes in 2D. The 3D gizmo wouldn't look quite correct in 2D, and most other gizmo methods already have 2D variants.

What solution would you like?

Add an axes_2d method that renders the XY axes.

What alternative(s) have you considered?

Leave it up to the user, or use axes in 2D as well. It'd just look weird in 2D, because the arrows are 3D, and the Z arrow would probably look like a cross in the middle.

@Jondolf Jondolf added C-Feature A new feature, making something new possible A-Gizmos Visual editor and debug gizmos labels Mar 1, 2024
@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Mar 1, 2024
@lambertsbennett
Copy link
Contributor

I would be interested in working on this if it's still an open issue?

@Jondolf
Copy link
Contributor Author

Jondolf commented Mar 2, 2024

I would be interested in working on this if it's still an open issue?

Yep, it's open. Feel free to submit a PR if you're interested :)

@lambertsbennett
Copy link
Contributor

Cool! I'll get to work then.

github-merge-queue bot pushed a commit that referenced this issue Jun 4, 2024
# Objective

This PR addresses #12222 (Fixes #12222). Simple addition to add a 2D
axes gizmo.

## Solution

- Add a new method axes_2d which takes a transform and a case length and
then draws two arrows in the XY plane.

The only thing I'm not sure about here is taking a 3D transform as an
argument. It says in the transform comments that for 2D the z-axis is
used for ordering, so I figured I'd keep it that way?

---

## Changelog

- Add method axes_2d.
- Update arrow_2d to also calculate the tip length depending on arrow
length as in arrow.
- Add axes_2d to examples 2d_gizmos.

---------

Co-authored-by: Ben Lambert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants