-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
From
implementations from the direction types (#10857)
This removes the `From<Vec2/3>` implementations for the direction types. It doesn't seem right to have when it only works if the vector is nonzero and finite and produces NaN otherwise. Added `Direction2d/3d::new` which uses `Vec2/3::try_normalize` to guarantee it returns either a valid direction or `None`. This should make it impossible to create an invalid direction, which I think was the intention with these types.
- Loading branch information
1 parent
2c5639e
commit 83ee6de
Showing
2 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters