favreau / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Normalization of null-vectors produces a NaN-vector #516

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a null-vector
2. normalize it
3. u get a vector with NaNs

What is the expected output? What do you see instead?
I expect a null-vector. I get NaNs.

What version of the product are you using? On what operating system?
bullet 2.77

Please provide any additional information below.

there should be a check for null-vectors in the normalize(d) function.

Original issue reported on code.google.com by acm...@googlemail.com on 20 May 2011 at 1:09

GoogleCodeExporter commented 9 years ago
You should not normalize a null vector. Does it happen in Bullet? If so, please 
provide a call stack.

You can add a safeNormalize and contribute it. It should be only used when 
strictly necessary.

Original comment by erwin.coumans on 20 May 2011 at 1:34

GoogleCodeExporter commented 9 years ago
Actually you can use the btVector3::safeNormalize instead of normalize, in case 
you are not sure that the input is (close) to a zero vector.

Let's close the issue.

Original comment by erwin.coumans on 14 Jun 2011 at 6:41