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

[Merged by Bors] - Add RegularPolygon and Circle meshes #3730

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1e2f715
Add RegularPolygon and Circle
rparrett Jan 20, 2022
fb6f09f
Add example to readme
rparrett Jan 20, 2022
2c137d7
Use usize for sides for consistency
rparrett Jan 20, 2022
03c7cc7
Preallocate vecs
rparrett Jan 20, 2022
08e366e
Minor cleanup
rparrett Jan 20, 2022
63fa48c
Generate mesh with fewer triangles
rparrett Jan 20, 2022
c6e7923
Add missing doc string
rparrett Feb 4, 2022
10b3f0f
Consolidate examples
rparrett Feb 4, 2022
630d9c5
Use new mesh attribute api
rparrett Feb 24, 2022
8dc3c72
Use new default shorthand
rparrett Mar 1, 2022
216b769
Update crates/bevy_render/src/mesh/shape/regular_polygon.rs
rparrett Mar 2, 2022
9cc7852
Update crates/bevy_render/src/mesh/shape/regular_polygon.rs
rparrett Mar 2, 2022
ea920b8
Update crates/bevy_render/src/mesh/shape/regular_polygon.rs
rparrett Mar 2, 2022
62ed3d4
Update crates/bevy_render/src/mesh/shape/regular_polygon.rs
rparrett Mar 2, 2022
f9d62b7
Optimize by calculating sin and cos simultaneously
rparrett Mar 2, 2022
4b68753
Add constructors for RegularPolygon and Circle
rparrett Mar 2, 2022
689c074
Fix unnecessary return
rparrett Mar 2, 2022
994c252
Remove accidental newline
rparrett Mar 2, 2022
880d4a2
Fix doc comment
rparrett Mar 3, 2022
d774e70
Vertices terminology seems more correct than subdivisions
rparrett Mar 4, 2022
40b925e
Fix extra garbage triangle
rparrett Mar 4, 2022
b02089e
Minor optimization
rparrett Mar 7, 2022
1e1ba1f
Friendlier panic when sides <= 2
rparrett Mar 7, 2022
0a76d2a
Slightly less ambiguous variable names
rparrett Mar 7, 2022
e0b04a6
Fix larger allocation for indices than necessary
rparrett Mar 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix doc comment
  • Loading branch information
rparrett committed Mar 3, 2022
commit 880d4a2c15be582df7778d3efe854884cb6871c3
2 changes: 1 addition & 1 deletion crates/bevy_render/src/mesh/shape/regular_polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Default for RegularPolygon {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is a hexagon the default? Does it make sense to provide a default?


impl RegularPolygon {
// Creates a regular polygon in the xy plane
/// Creates a regular polygon in the xy plane
pub fn new(radius: f32, sides: usize) -> Self {
Self { radius, sides }
}
Expand Down