RegularPolygon
should allow circumradius
to be 0.0
#13332
Labels
A-Math
Fundamental domain-agnostic mathematical operations
C-Usability
A simple quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
It currently panics when
circumradius
is zero.bevy/crates/bevy_math/src/primitives/dim2.rs
Line 729 in 443ce9a
Is there any advantage to rejecting 0.0?
Since the value 0.0 is frequently used as a default or minimum value, not allowing it would increase the chances of the game panicking.
Consider, for example, an animation that smoothly resizes a circle. When the circle appears, the radius increases from zero, and when the circle disappears, the radius decreases toward zero. Implementing this animation in v0.12 is simple, but v0.13 requires additional code to make the radius greater than zero to prevent panic.
What solution would you like?
That assertion should be
circumradius >= 0.0
to allow zero.Additional context
Bevy v0.12 can handle a circle of radius 0.0, but v0.13 panics.
The text was updated successfully, but these errors were encountered: