-
-
Notifications
You must be signed in to change notification settings - Fork 193
Open
Labels
Description
Description
When normalizing a vector, it is necessary to first check it is not of length zero, otherwise the program will crash.
The game engine bevy has a method for its Vec
s that is normalize_or_zero()
that allows you to normalize a vector that is potentially of length zero, where it returns a zero vector if that is the case, otherwise normalizing it.
I think this would be useful to have in pygame, as it saves having to type an extra line pretty much every time you want to normalize a vector.
DaNubCoding, bigwhoopgames, redawgts, Matiiss and JiffyRob