applyCentralImpulse bug

Post Reply
Blackhart
Posts: 2
Joined: Wed Mar 26, 2014 3:08 pm

applyCentralImpulse bug

Post by Blackhart »

Hello, :)

I have a problem with bullet physics (the applyCentralImpulse function).
Then here, i did a software powered by Qt/Qml/OpenGL wherein i draw a white cube that i add in my bullet physics world with addRigidBody function. Finally, i add him a force in a given direction. This is an explosion whose epicenter is my mouse ...

In a normally context, it works fine, my cube move. But, when i play with my GUI (click everywhere), Bullet crashes and my cube don't move.

After debug, my software goes through all the stages with success.
- He detects that my mouse [is near the/collide with] cube (with Manifold).
- He goes in applyCentralImpulse function with good force (btVector3).
- He goes in stepSimulation function with good deltaTime.

However, my cube keeps the same position (shown with getWorldTransform().getOrigin()).

I can't shown my source code, it is huge and partitioned between several classes ...
Any Ideas ? :)

Thx and sorry for my english.
bwelch
Posts: 48
Joined: Thu Dec 12, 2013 4:04 pm

Re: applyCentralImpulse bug

Post by bwelch »

Is your box activated? If it's stationary for a while, Bullet will deactivate it and it won't be moved even if you apply an impulse to it. Try doing rigidBody->setActivationState(DISABLE_DEACTIVATION).
Blackhart
Posts: 2
Joined: Wed Mar 26, 2014 3:08 pm

Re: applyCentralImpulse bug

Post by Blackhart »

Hello,

Thanks for your reply :)
I found the answer to my problem with rigidBody-> activate(), but your solution is better if it avoid me functions call.
Post Reply