Add SquarePrism shape into mesh#377
Add SquarePrism shape into mesh#377TheJasonLessard wants to merge 7 commits intobevyengine:masterfrom
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
| } | ||
|
|
||
| /// A Square prism. Just like a cube, but you can specify the dimensions. | ||
| pub struct SquarePrism { |
There was a problem hiding this comment.
Can this be renamed RectangularPrism? A square prism would imply all sides are the same
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.
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.
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.