Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Have Vector Normalization Functions Assert On The Zero Vector #11

Open
randomPoison opened this issue Jun 15, 2015 · 1 comment
Open

Comments

@randomPoison
Copy link
Owner

Right now the normalization functions return a zero-length vector if run on the zero vector. This can lead to subtle problems if the code assumes the vector was correctly normalized, so we should instead assert that the incoming vector is not the zero vector.

We should also do the same for Quaternion normalization. It's much less likely to ever get a zero quaternion, but it's worth having the check for correctness (at least in debug builds).

@randomPoison
Copy link
Owner Author

Should we only assert if all coordinates are exactly 0, or should we use an epsilon to check if all members are really close to 0? My vote is for the latter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant