Hi all - what can cause btCollisionWorld::ClosestRayResultCallback.m_hitNormalWorld to return a very large vector instead of a normalized one?
Thanks for any suggestions!
ClosestRayResultCallback.m_hitNormalWorld - weird results
-
- Posts: 11
- Joined: Fri Jan 16, 2009 12:01 pm
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: ClosestRayResultCallback.m_hitNormalWorld - weird results
Hi,
when i remember correctly then the generated 'normal' is simply not normalized. Often you don't need the normal, just the fact that you collided. So i guess Bullet just avoids normalizing it. Of course the name 'normal' is misleading in this case.
Well, in my case i simply coded a wrapper for line and convex casts with a GetNormal() method. So only in the case i need the normal, its going to be normalized.
when i remember correctly then the generated 'normal' is simply not normalized. Often you don't need the normal, just the fact that you collided. So i guess Bullet just avoids normalizing it. Of course the name 'normal' is misleading in this case.
Well, in my case i simply coded a wrapper for line and convex casts with a GetNormal() method. So only in the case i need the normal, its going to be normalized.
-
- Posts: 11
- Joined: Fri Jan 16, 2009 12:01 pm
Re: ClosestRayResultCallback.m_hitNormalWorld - weird results
Thanks pico! It looks like the bigger is the collision polygon, the bigger values are returned in m_hitNormalWorld - but, like you said, after normalization the m_hitNormalWorld value is ok.
-
- Posts: 508
- Joined: Fri May 30, 2008 2:51 am
- Location: Ossining, New York
Re: ClosestRayResultCallback.m_hitNormalWorld - weird results
Yeah I had to normalise it for my vehicle too. I'd suggest renaming it but this would break lots of code. Maybe a comment in the doxygen API would be good.