-
-
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
Add SquarePrism shape into mesh #377
Add SquarePrism shape into mesh #377
Conversation
This commit add SquarePrism, a cube-like shape where you can specify the size of each dimentions (x,y,z) independently. It also include refactoring of the shape Cube to use it in order to reduce duplication of code. This commit also normalize the normal and UV values of the mesh created.
crates/bevy_render/src/mesh/mesh.rs
Outdated
@@ -453,20 +400,117 @@ pub mod shape { | |||
} | |||
} | |||
} | |||
|
|||
/// A Square prism. Just like a cube, but you can specify the dimensions. | |||
pub struct SquarePrism { |
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.
Can this be renamed RectangularPrism
? A square prism would imply all sides are the same
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.
Good point!
crates/bevy_render/src/mesh/mesh.rs
Outdated
impl Default for SquarePrism { | ||
fn default() -> Self { | ||
SquarePrism { | ||
min_x: 0.0, |
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.
In interest of keeping the translation around local (0, 0), should this be just length
, width
, and height
, and not allow below 0?
I'm actually slightly surprised the cube
shape isn't centered around (0, 0), dividing the size by 2 for the negative and positive, I'm not sure if that's intentional or not... but obviously that's nothing you changed
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.
I'll change it, it's probably better if the default is centred on 0,0,0. I will also change the shape, it should be a rectangular prism by default, not a cube.
How is this different to using a |
Does #883 make this PR obselete? |
Yup! I'll close this one out. #883 actually uses @TheJasonLessard's code as a base. @e00E did "the right thing" here by working directly off of the commit from this pr (which leaves @TheJasonLessard's git account as an author), but GitHub did "the wrong thing" by not maintaining the correlation between the "commit author" and the github account. I'm annoyed with that ... attribution is important. @TheJasonLessard if you want "github" attribution and not just "git commit" attribution, feel free to create a pr that "moves" the relevant code to a different spot in the file. That way you get the relevant lines associated with your account (and the new PR creates a paper trail back to this conversation). |
@TheJasonLessard do you consent to relicensing this per #2373? |
Sure
…On Thu, Oct 20, 2022, 5:06 PM Alice Cecile ***@***.***> wrote:
@TheJasonLessard <https://github.com/TheJasonLessard> do you consent to
relicensing this per #2373
<#2373>?
—
Reply to this email directly, view it on GitHub
<#377 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQQ4JGFRZSRIRP6N7BGJFC3WEGX65ANCNFSM4QNMJBRQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This commit add RectangularPrism, a cube-like shape where you can specify the size of each dimensions (x,y,z) independently. It also includes refactoring of the shape Cube to use it in order to reduce duplication of code. This commit also normalize the normal and UV values of the mesh created.