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

Rename Plane struct to HalfSpace #8744

Merged
merged 13 commits into from
Jun 12, 2023
Merged

Rename Plane struct to HalfSpace #8744

merged 13 commits into from
Jun 12, 2023

Conversation

hate
Copy link
Contributor

@hate hate commented Jun 2, 2023

Objective

Solution

  • Refactor the render::primitives::Plane struct to render::primitives::HalfSpace
  • Modify documentation to reflect this change

Changelog

  • Renamed render::primitives::Plane to render::primitives::HalfSpace to more accurately represent it's use
  • Renamed planes member in render::primitives::Frustum to half_spaces to reflect changes

Migration Guide

  • Change instances of render::primitives::Plane to render::primitives::HalfSpace
  • Change instances of the planes member in render::primitives::Frustum to half_spaces

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Jun 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.

crates/bevy_render/src/primitives/mod.rs Outdated Show resolved Hide resolved
crates/bevy_render/src/primitives/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@nicopap nicopap self-requested a review June 6, 2023 05:10
Copy link
Contributor

@nicopap nicopap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks so much better. Just a couple sentences I think should be reworded.

crates/bevy_render/src/primitives/mod.rs Outdated Show resolved Hide resolved
Comment on lines +95 to +98
/// Constructs a `HalfSpace` from a 4D vector whose first 3 components
/// represent the bisecting plane's unit normal, and the last component signifies
/// the distance from the origin to the plane along the normal.
/// The constructor ensures the normal vector is normalized and the distance is appropriately scaled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Props to you, I like the phrasing 👍

crates/bevy_render/src/primitives/mod.rs Outdated Show resolved Hide resolved
@@ -131,15 +131,15 @@ impl Plane {
#[reflect(Component)]
pub struct Frustum {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the doc string for Frustrum mention planes. Could you reword it as well?

hate and others added 2 commits June 7, 2023 11:17
Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
@alice-i-cecile
Copy link
Member

@hate can you add a tiny migration guide to this PR? They're compiled automatically from the PR description, so it really does make a difference.

@hate
Copy link
Contributor Author

hate commented Jun 7, 2023

@hate can you add a tiny migration guide to this PR? They're compiled automatically from the PR description, so it really does make a difference.

Got it, let me know if I should add more to it/change it up

@hate hate changed the title Rename Plane struct to HalfSpace Rename Plane struct to HalfSpace Jun 7, 2023
Copy link
Contributor

@nicopap nicopap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @superdump what do you think of this change?

crates/bevy_render/src/primitives/mod.rs Outdated Show resolved Hide resolved
hate and others added 2 commits June 8, 2023 01:30
Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jun 8, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 12, 2023
@alice-i-cecile
Copy link
Member

Shouldn't the changelog and migration guide specify which Plane it's talking about to not add confusion with the "shape"/mesh?

https://elk.zone/octodon.social/@Nocta/110532903855059947

@hate
Copy link
Contributor Author

hate commented Jun 12, 2023

Shouldn't the changelog and migration guide specify which Plane it's talking about to not add confusion with the "shape"/mesh?

https://elk.zone/octodon.social/@Nocta/110532903855059947

You're right! Corrected

Merged via the queue into bevyengine:main with commit 278daab Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

render::primitive::Plane is confusing
3 participants