Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Nov 08, 2012 10:26 pm 
Offline

Joined: Thu Nov 08, 2012 8:51 pm
Posts: 6
I have a class member

btRigidBody* carBody;

I created a rigid body they same way it is done in the HelloWorld demo, along with a btDiscreteDynamicsWorld* dynamicsWorld from the demo also.

Later I use carBody->applyImpulse(btVector3(0.f,0.5f, 0.f), btVector3(0.f, 0.f, 0.f)).

If I call applyImpulse early, then the impulse is applied and the block takes off. If I wait some time to use it, then nothing happens and the block stays stationary. I am more than willing to post code, or create a test case, but I have not done so yet, maybe there is something obvious I am missing.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 5:47 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3886
Location: California, USA
applyImpulse (and applyForce) doesn't wake up the body once it is fallen asleep.

Call body->activate() first.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 9:36 pm 
Offline

Joined: Thu Nov 08, 2012 8:51 pm
Posts: 6
Perfect, that is exactly what was happening. The object was going to sleep. If I applied the impulses early it would stay away. Thank you.


Top
 Profile  
 
PostPosted: Thu Jan 16, 2014 5:10 pm 
Offline

Joined: Sat Dec 29, 2012 7:20 pm
Posts: 25
Any reason why activate() isn't called by Bullet when applying forces/impulse?


Top
 Profile  
 
PostPosted: Thu Jan 16, 2014 5:20 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3886
Location: California, USA
We probably should add a 'wakeUp' argument. In many cases, it is better to let the bodies go asleep, once it reaches a stable state.

I'll re-think about it for the Bullet 3.x API.
Thanks,
Erwin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group