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
(in glm/gtc/random.inl)
The functions vec<3, T, defaultp> glm::ballRand(T Radius) and vec<2, T, defaultp> glm::diskRand(T Radius) can result in an infinite loop if called with a negative value for Radius.
The reason for this is that they compare the length of a computed vector (which is always positive or zero) to Radius.
One solution would be to throw an exception if a negative value is given (which shouldn't normally occur), or you could fabs() it.
The text was updated successfully, but these errors were encountered:
Zuzu-Typ
changed the title
infinite loop in ballRand
infinite loop in ballRand and diskRand
Mar 10, 2018
(in glm/gtc/random.inl)
The functions
vec<3, T, defaultp> glm::ballRand(T Radius)
andvec<2, T, defaultp> glm::diskRand(T Radius)
can result in an infinite loop if called with a negative value for Radius.The reason for this is that they compare the length of a computed vector (which is always positive or zero) to Radius.
One solution would be to throw an exception if a negative value is given (which shouldn't normally occur), or you could
fabs()
it.The text was updated successfully, but these errors were encountered: