Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Apr 09, 2013 5:12 pm 
Offline

Joined: Tue Apr 09, 2013 4:11 pm
Posts: 2
Hello all :) !

First of all thanks a lot to the community behind Bullet which is doing a great work, really !

I am coming here because I would like some help to solve a little issue that I have.

I have two rigid bodies. The right one is not moving and has a friction set to 1, while the left one has his friction set to 0, and has its velocity set to (2.0, 0, 0) making it moves like this:

Image

But when the left body hits the right one, it bounces and goes in the opposite direction like this :
Image

I don't want this to happen, I just want that when the left body hits the right one, it stops moving (no bounce at all). I have already tried to set both restitution to 0 but it did not work :s !

Any idea ?

Thanks for your help =) !

PS : I have another question for you guys ^^" ! How could i disable movement of a rigid body along the X axis, but only negatively ? (my body will only be able to go to the left and never to the right no matter what happens)


Top
 Profile  
 
PostPosted: Wed Apr 10, 2013 1:43 am 
Offline

Joined: Tue Sep 16, 2008 11:31 am
Posts: 116
Might want to try enabling "split impulse". (Assuming you've covered the basics like mass, etc.)
2nd Q: your code can do anything you want after each sim step.


Top
 Profile  
 
PostPosted: Wed Apr 10, 2013 11:37 am 
Offline

Joined: Tue Apr 09, 2013 4:11 pm
Posts: 2
Hello, thanks lot for your answer !!
I have tried your solution for the first question but unfortunately it did not work :s !

For the second question, I think (from what I have read) that 6DoF constraint can solve my problem, but I don't know how to use them at all ^^". I know that to disable movement along the X axis I just have to do:
Code:
myRigidBody->setLinearFactor(btVector3(0, 1, 1));

But I just want to disable movement along the X axis in the "left" direction.
If 6DoF constraint is the solution, can someone explain me how to use it or has any link for a tutorial ? =) (I have done some research but I have not found any simple example and explanations ^^")!

Thanks a lot again =) !


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 3 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