You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe it should only check for 0, by doing len || 1 for example and leave other numerical instabilities to the caller.
Situation in which this appeared is a demo app where you can zoom in a lot, so vectors become super small. That doesn't mean that these are not valid vector values that can be normalized.
I discovered a bug in my app because
vec2.normalize
was avoiding division by 0 by checking an arbitrarily small length:https://github.com/greggman/wgpu-matrix/blob/main/src/vec2-impl.ts#L506
I believe it should only check for 0, by doing
len || 1
for example and leave other numerical instabilities to the caller.Situation in which this appeared is a demo app where you can zoom in a lot, so vectors become super small. That doesn't mean that these are not valid vector values that can be normalized.
(demo app in question https://deluksic.github.io/apollonian-circles/)
The text was updated successfully, but these errors were encountered: