Skip to content
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

Arc2d does not implement GizmoPrimitive2d #13606

Closed
Olle-Lukowski opened this issue May 31, 2024 · 3 comments · Fixed by #13610
Closed

Arc2d does not implement GizmoPrimitive2d #13606

Olle-Lukowski opened this issue May 31, 2024 · 3 comments · Fixed by #13610
Labels
A-Gizmos Visual editor and debug gizmos C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples X-Uncontroversial This work is generally agreed upon

Comments

@Olle-Lukowski
Copy link
Contributor

Bevy version

main

What you did

Try to draw a Arc2d using gizmos.primitive_2d().

What went wrong

Got an error:

Compiling bevy_contrib_raycast v0.1.0-dev (/Users/olle/Dev/bevy_contrib_raycast)
error[E0277]: the trait bound `bevy::prelude::Gizmos<'_, '_>: bevy::prelude::GizmoPrimitive2d<bevy::prelude::Arc2d>` is not satisfied
   --> examples/visual.rs:163:33
    |
163 |             gizmos.primitive_2d(&arc, position.0, rotation.0, RED);
    |                    ------------ ^^^^ the trait `bevy::prelude::GizmoPrimitive2d<bevy::prelude::Arc2d>` is not implemented for `bevy::prelude::Gizmos<'_, '_>`
    |                    |
    |                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `bevy::prelude::GizmoPrimitive2d<P>`:
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Dir2>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Circle>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Ellipse>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<Annulus>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<Rhombus>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Capsule2d>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Line2d>>
              <bevy::prelude::Gizmos<'w, 's, Config, Clear> as bevy::prelude::GizmoPrimitive2d<bevy::prelude::Plane2d>>
            and 8 others

For more information about this error, try `rustc --explain E0277`.

Additional information

`Arc2d was added recently, so we probably just forgot to implement this. IMO, this should happen before 0.14 though.

@Olle-Lukowski Olle-Lukowski added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 31, 2024
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Gizmos Visual editor and debug gizmos D-Straightforward Simple bug fixes and API improvements, docs, test and examples X-Uncontroversial This work is generally agreed upon and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 31, 2024
@alice-i-cecile
Copy link
Member

Yep, good to have. Not worth blocking the release over, but if it's done I'll review and merge it.

@Olle-Lukowski
Copy link
Contributor Author

Yeah I understand, I'll try and get a PR in soon. Might take an hour or two because I am a bit busy.

@Olle-Lukowski
Copy link
Contributor Author

Oh while I'm at it, I'll fix it for CircularSegment and CircularSector too.

github-merge-queue bot pushed a commit that referenced this issue Jun 1, 2024
…rSector`, and make arc_2d use counter-clockwise angle. (#13610)

# Objective

Fixes #13606.
Also Fixes #13614.

## Solution

Added the missing trait impls, and made `gizmos.arc_2d()` work with a
counter-clockwise angle.
## Testing

- Updated the render_primitives example, and it works.
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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples X-Uncontroversial This work is generally agreed upon
Projects
None yet
2 participants