character demo crashes in ubuntu

uppzab
Posts: 4
Joined: Tue Jan 13, 2009 4:22 pm

character demo crashes in ubuntu

Post by uppzab »

Hello..

The character demo crashes in ubuntu when the character collides with a dynamic object and prints out the following message.
CharacterDemo: ./src/LinearMath/btQuaternion.h:188: btQuaternion& btQuaternion::operator/=(const btScalar&): Assertion `s != btScalar(0.0)' failed.
Aborted
This does not happen in windows. Why is it crashing and how can it be fixed? Does it have anything to do with floating point precision?

Thanks
ZeroSigma
Posts: 5
Joined: Wed Jan 14, 2009 1:14 pm

Re: character demo crashes in ubuntu

Post by ZeroSigma »

Hehe, Im getting exactly the same exception except that I am using windows xp sp 3 and compiled the demo in Debug in MSVC 9. I've done a bit of a trace through the code and found that in the btCollisionDispatcher::defaultNearCallback() function btCollisionObject* colObj1's m_worldTransform is invalid, all float values are -1.#IND which causes the assertion. Further tracing upward would just cause me serious head trauma :) so please can anyone tell me and uppzab what is going on?
uppzab
Posts: 4
Joined: Tue Jan 13, 2009 4:22 pm

Re: character demo crashes in ubuntu

Post by uppzab »

Hello..

I compiled using BT_USE_DOUBLE_PRECISION, and it still crashes with the same error in linux :(
However in windows it does not crash using floating or double precision. I have not tried it in debug mode in windows. Will try it and see what happens.


Please someone shed some light..
uppzab
Posts: 4
Joined: Tue Jan 13, 2009 4:22 pm

Re: character demo crashes in ubuntu

Post by uppzab »

well i am using visual studio 2005/ version 8 and it does not crash in debug mode..!!
ZeroSigma
Posts: 5
Joined: Wed Jan 14, 2009 1:14 pm

Re: character demo crashes in ubuntu

Post by ZeroSigma »

People mention in this thread they also have the same problem. http://www.bulletphysics.com/Bullet/php ... f=9&t=3007
ZeroSigma
Posts: 5
Joined: Wed Jan 14, 2009 1:14 pm

Re: character demo crashes in ubuntu

Post by ZeroSigma »

Ok I think I've solved it, all you have to do is change the code on line 87 of the CharacterDemo.cpp file from

Code: Select all

m_ghostObject->setCollisionFlags (btCollisionObject::CF_CHARACTER_OBJECT);
to

Code: Select all

m_ghostObject->setCollisionFlags (btCollisionObject::CF_KINEMATIC_OBJECT);
I've compiled it and its working.
uppzab
Posts: 4
Joined: Tue Jan 13, 2009 4:22 pm

Re: character demo crashes in ubuntu

Post by uppzab »

thanks a lot Zero Sigma.. it works!!