-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Deprecate shapes in bevy_render::mesh::shape
#11773
Conversation
bevy_render::mesh::shapes
bevy_render::mesh::shape
#[deprecated( | ||
since = "0.13.0", | ||
note = "please use the `Cuboid` primitive for meshing or `Aabb2d` for a bounding volume" | ||
)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct Box { | ||
pub min_x: f32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice deprecation notices :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. This must have been pretty tedious. Really appreceate how quickly you got this in.
} | ||
|
||
#[test] | ||
fn test_regular_polygon() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the purpose of this test please. I'm not sure I could fix this if I broke it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not my test, it was added by #11017. Personally, I find it to be a bit redundant and would remove it, but it was on the old RegularPolygon
type so I kept it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Document RegularPolygon by writing a test" and then proceeds to write no documentation for the test.
Fair enough.
Objective
#11431 and #11688 implemented meshing support for Bevy's new geometric primitives. The next step is to deprecate the shapes in
bevy_render::mesh::shape
and to later remove them completely for 0.14.Solution
Deprecate the shapes and reduce code duplication by utilizing the primitive meshing API for the old shapes where possible.
Note that some shapes have behavior that can't be exactly reproduced with the new primitives yet:
Box
is more of an AABB with min/max extentsPlane
supports a subdivision countQuad
has aflipped
propertyThese types have not been changed to utilize the new primitives yet.
Changelog
bevy_render::mesh::shape
Migration Guide
Bevy has previously used rendering-specific types like
UVSphere
andQuad
for primitive mesh shapes. These have now been deprecated to use the geometric primitives newly introduced in version 0.13.Some examples: