Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Feb 22, 2010 6:25 am 
Offline

Joined: Mon Feb 22, 2010 4:35 am
Posts: 3
Hello all,

I'm trying to get rope-rope collision working so that examples like Init_RopesAttach in the SoftDemo source would have the ropes twisting around each other if the rigid body spins parallel to the plane. But no matter what I seem to do I can't get the ropes to collide with each other.

So... what's the best way to handle rope-rope collisions? Are they even supported?


Many thanks in advance.
Richard.


Top
 Profile  
 
PostPosted: Tue Feb 23, 2010 10:07 pm 
Offline

Joined: Mon Feb 22, 2010 4:35 am
Posts: 3
Should I be assuming that it isn't possible to do rope-rope collisions?
If anyone knows anything your help would be greatly appreciated.

Many thanks,
Richard.


Top
 Profile  
 
PostPosted: Tue Feb 23, 2010 11:29 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
There is no collision between line segments of the rope / btSoftBody structures.

Have you considered to attach rigid bodies (with a btCapsuleShape) to the rope? That should give you rope-rope collisions. If the capsules needs to be very thin, you can try using a smaller timestep.

Thanks,
Erwin


Top
 Profile  
 
PostPosted: Fri Feb 26, 2010 2:39 am 
Offline

Joined: Mon Feb 22, 2010 4:35 am
Posts: 3
Thanks for the reply and the suggestion. Having capsules anchored along the links seems to work, and I also tried using spheres at the joints which worked too.

Now it's time to start tweaking parameters.... there are so many!! :wink:


Many thanks once again,
Richard.


Top
 Profile  
 
PostPosted: Sun Feb 28, 2010 9:26 am 
Offline

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 318
richiek_AL wrote:
Thanks for the reply and the suggestion. Having capsules anchored along the links seems to work, and I also tried using spheres at the joints which worked too.


I believe that the best way is to reuse the same capsule shape in such a way that the "spheres" inside the capsules overlap (of course constraint collisions between adiacent rope pieces must be disabled). This way the rope collision model is more robust in my opinion.


Top
 Profile  
 
PostPosted: Sat Mar 06, 2010 7:06 am 
Offline
User avatar

Joined: Fri Dec 18, 2009 6:06 pm
Posts: 44
Location: Montreal
Hi

I am trying the samething to create a rigid body rope. I am confused on how to fix one end of a rigid body. Is the case of softbodes you set the nodal mass to zero.. In rigid body how to you achieve the same result. Also i am looking for a quick example how to use btpoint2pointconstraint with capsules as suggested here.

thanks very much
Garibalde


Top
 Profile  
 
PostPosted: Sat Mar 06, 2010 4:15 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
You can use a constraint to lock the btRigidBody to the world, for example a btPoint2PointConstraint.

Code:
btRigidBody* body = ...
btVector3 pivotInA(0,-1,0);
btTypedConstraint* p2p = btPoint2PointConstraint(*body,pivotInA);
world->addConstraint(p2p);


You can modify the pivot (in local space of A) to match the place where you want to fix the object.
Thanks,
Erwin


Top
 Profile  
 
PostPosted: Wed Mar 10, 2010 10:01 pm 
Offline
User avatar

Joined: Fri Dec 18, 2009 6:06 pm
Posts: 44
Location: Montreal
Thanks worked perfectly.

I want to now place sphere objects between the capsules as suggested above.. I need to disable collision between adjacent objects. How do i disable collision check between specific objects?

For example i have a series of objects A, B and C

I want B not to collide with A and C, But everything else, I also want A and C to collide together.

Thanks
Garibalde


Top
 Profile  
 
PostPosted: Thu Mar 11, 2010 12:34 pm 
Offline

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 318
Garibalde wrote:
For example i have a series of objects A, B and C
I want B not to collide with A and C, But everything else, I also want A and C to collide together.


Well, for 3 objects I think you have to use collision flags manually (*).

Anyway I don't understand what kind of rope you are making: why do you need sphere shapes? A single capsule shape should be enough to cover all the roughness of the edges of the rope chunks (you can make the spheres INSIDE the capsule rope chunks match perfectly by overlapping them in the correct way). Isn't this enough for your purpose?

(*) Actually the "avoid collisions in constraint" mechanism seems work like this:
Code:
void   btDiscreteDynamicsWorld::addConstraint(btTypedConstraint* constraint,bool disableCollisionsBetweenLinkedBodies)
{
   m_constraints.push_back(constraint);
   if (disableCollisionsBetweenLinkedBodies)
   {
      constraint->getRigidBodyA().addConstraintRef(constraint);
      constraint->getRigidBodyB().addConstraintRef(constraint);
   }
}

So it seems that rigid bodies stores the constraints between the bodies they don't want to collide with. Maybe you can try to tweak this behavior to your advantage.


Top
 Profile  
 
PostPosted: Sun Mar 14, 2010 4:49 am 
Offline
User avatar

Joined: Fri Dec 18, 2009 6:06 pm
Posts: 44
Location: Montreal
Thanks Flix. I see what you mean. you embed the spherical parts of the bodies within each other and disable
collision between the bodies.. that way there is no gap between the two bodies.. I was thinking as above to
the connection point between the two bodies at the top of the spherical surface.. i was then going to add an
addition sphere centered on that point to close the gap.

However i have come across another problem here. I got the chain of bodies working it creates a rope.. however at run time when i collied with it with a cylinder. it at time passes through the rope.. it seems that the individual elements of the rope (rigid bodies) seem to seperate when jerked around.. (the constraint is loose however springs back) Is there a way to tighten the constraint between the bodies? so that they do not drift part causing gaps?

Thanks.


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

All times are UTC


Who is online

Users browsing this forum: Google [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