Put math primitives in bevy_shapes crate#25003
Conversation
|
@rparrett I saw you reacted with a 'confused' emoji. Mind sharing your concerns? I'm genuinely interested |
|
Someone behind the discord wall suggested that we change the crate name from |
|
After work I will also try to fix all of the |
|
Also we need to discuss what's reasonable to have in the prelude |
Yeah, of course. I am confused about what motivated this PR. I was later able to dig a small amount of context out of #24849 and It's not self-evident to me that this new organization scheme is better, and it doesn't seem to address the motivations for the current scheme, as laid out in https://github.com/bevyengine/rfcs/blob/main/rfcs/12-primitive-shapes.md. |
|
Thank you!
Initially I just wanted to make some progress on the primitives tracking issue and implemented another primitive that was listed there. Alice asked the question mentioned in #24849. She said that we should further define what a primitive is and maybe put them in a separate crate before adding new ones. I kind of agreed. Implementing the new primitive felt weird because the traits are scattered all over the place and it was easy to miss one. In a following analysis I suggested two disjunct purposes for primitives: high level for users and low level for in-engine use. Unfortunately I didn't have the RFC in mind and picked the wrong route (the former suggestion). (Thanks for the reminder about the RFC btw!) I might start a second attempt with the RFC in mind and just scratch this PR here if people are not completely opposed to the idea.
Mainly to improve the scattering of the implementations and to increase discoverability in general. |
2066496 to
76432cd
Compare
|
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
76432cd to
0c6cf61
Compare
|
Closing due to #25047 |
Objective
The math library contains so called primitives. They are mostly just really high level features for users to draw some quick shapes on the screen or to debug things. Additionally there were a few very simple use cases in the engine. On closer inspection, those use cases don't really require the primitives and all of the features they are coming with.
This PR tries to move all of the mentioned primitives into a new crate
bevy_shapes. There we consolidate all of the features primitives currently support in one place. Opposed to this those mentioned features were spread throughout a lot of bevy crates previously (bevy_mesh, bevy_gizmos, bevy_math).Pros:
bevy_shapescrateCons:
quad_meshconstructor on theMeshstruct and use that for the in-engine use cases as well as theMeshableimplementation of theRectangleprimitiveTesting
cargo clippysuccessfully runs without showing any further errors