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

Dedicated primitive example #11697

Merged
merged 13 commits into from
Feb 14, 2024

Conversation

RobWalt
Copy link
Contributor

@RobWalt RobWalt commented Feb 4, 2024

I just implemented this to record a video for the new blog post, but I figured it would also make a good dedicated example. This also allows us to remove a lot of code from the 2d/3d gizmo examples since it supersedes this portion of code.

Depends on: #11699

Copy link
Contributor

github-actions bot commented Feb 4, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

1 similar comment
Copy link
Contributor

github-actions bot commented Feb 4, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@Jondolf Jondolf added C-Examples An addition or correction to our examples A-Math Fundamental domain-agnostic mathematical operations labels Feb 4, 2024
@RobWalt RobWalt force-pushed the dedicated-primitive-example branch 2 times, most recently from 138fa9f to 879e2e5 Compare February 4, 2024 17:13
@RobWalt
Copy link
Contributor Author

RobWalt commented Feb 4, 2024

For anyone reviewing this: Please note that I extracted a bugfix which was previously included. The polygon in 2D will be fixed. The bugfix can be found here f7473ec

github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2024
This is just a minor fix extracted from #11697

A logic error. We tried to close the polygon shape, if the user
specifies an
unclosed polygon. The closing linestring previously didn't close the
polygon
though, but instead added a zero length line at the last coordinate.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
lynn-lumen pushed a commit to lynn-lumen/bevy that referenced this pull request Feb 5, 2024
This is just a minor fix extracted from bevyengine#11697

A logic error. We tried to close the polygon shape, if the user
specifies an
unclosed polygon. The closing linestring previously didn't close the
polygon
though, but instead added a zero length line at the last coordinate.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Copy link
Contributor

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

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

Typos and naming nits

examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
@Jondolf
Copy link
Contributor

Jondolf commented Feb 5, 2024

I like the look of the actual example, but:

  • The naming doesn't quite work when using the same enum for 2D and 3D, e.g. this is not a circle:

not a circle

  • The 2D view doesn't have shape names: (the layout is also a bit different)

no names

  • There are several empty choices in the 2D mode without explanation

empty

tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
This is just a minor fix extracted from bevyengine#11697

A logic error. We tried to close the polygon shape, if the user
specifies an
unclosed polygon. The closing linestring previously didn't close the
polygon
though, but instead added a zero length line at the last coordinate.

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
@RobWalt
Copy link
Contributor Author

RobWalt commented Feb 6, 2024

I like the look of the actual example, but:

* The naming doesn't quite work when using the same enum for 2D and 3D, e.g. this is not a circle:

not a circle

* The 2D view doesn't have shape names: (the layout is also a bit different)

no names

* There are several empty choices in the 2D mode without explanation

empty

I'm not really sure how to do this (yet?). Somehow it's hard for me to position the text consistently between 2D and 3D views. On my screen it looked ok but I see that the current state won't work for everyone. If you have any ideas on how to resolve that, let me know.

@RobWalt
Copy link
Contributor Author

RobWalt commented Feb 6, 2024

@Jondolf just addressed the last issue in my lunch break 👍🏼

Copy link
Contributor

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

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

There's a bug with text not updating (see review comment below) and a few more nits, but otherwise the example looks good now!

It could be nice to show the active dimension with text too, but I won't block over that

examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
examples/math/primitives.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@Jondolf Jondolf left a comment

Choose a reason for hiding this comment

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

File name should be snake-cased, but otherwise LGTM

Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Feb 6, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

2 similar comments
Copy link
Contributor

github-actions bot commented Feb 6, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

Copy link
Contributor

github-actions bot commented Feb 6, 2024

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@Jondolf
Copy link
Contributor

Jondolf commented Feb 12, 2024

Meshing for most 3D primitives was added in #11688, so this example should probably be updated to reflect that

@RobWalt
Copy link
Contributor Author

RobWalt commented Feb 13, 2024

@Jondolf done 👍🏼

This should also help users to check which primitives have rendering
support already.

Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
superseded by dedicated example

Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Reviewed-by: Joona Aalto <jondolf.dev@gmail.com>
The issue was that, by default, only one camera renders the UI. This was
defaulted to the 3D camera we spawned. A recently merged PR added the
functionality to change which Camera UI Nodes are rendered on via a
component. (`TargetCamera`)

We use that here and it works. Thanks to @teodosin on discord helping me
to find this out <3

Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: RobWalt <robwalter96@gmail.com>
Reviewed-by: Joona Aalto <jondolf.dev@gmail.com>
Authored-by: Aviac <aviac@mailbox.org>
Authored-by: RobWalt <robwalter96@gmail.com>
Authored-by: Aviac <aviac@mailbox.org>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 14, 2024
@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 Feb 14, 2024
Merged via the queue into bevyengine:main with commit b446374 Feb 14, 2024
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Examples An addition or correction to our examples 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.

4 participants