Box2D Forums

It is currently Wed May 22, 2013 5:19 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Feb 25, 2013 3:54 am 
Offline

Joined: Tue Feb 07, 2012 2:29 pm
Posts: 8
Hello!
I am trying to add a "rope" behavior to PulleyJoint... According to box2D manual : "The total length of the pulley rope is conserved according to the initial configuration".

But this give a very strange behavior when second body is on an horizontal surface : the body is pushed according to first body...
I tried to modify b2PulleyJoint::SolveVelocityConstraints and b2PulleyJoint::SolvePositionConstraints but without success.

Has someone any idea how I can achieve this type of effect?

Thanks in advance,
Thibault!


Top
 Profile  
 
PostPosted: Wed Mar 13, 2013 7:04 am 
Offline

Joined: Fri Sep 28, 2007 7:49 am
Posts: 61
If I'm understanding your question correctly, you want to prevent the rope from "pushing", so that it only "pulls"? In this case, rather than a constant-length constraint, you want a max-length constraint.


Top
 Profile  
 
PostPosted: Wed Mar 13, 2013 7:33 am 
Offline

Joined: Tue Feb 07, 2012 2:29 pm
Posts: 8
Hello!
Yes, that is exactly what I want : a max-length constraint (sorry for my bad explaination, I'm not a native english speaker ;)!

Do you have any idea on how to achieve this?
Thanks!


Top
 Profile  
 
PostPosted: Sat Apr 06, 2013 9:02 pm 
Offline

Joined: Fri Sep 28, 2007 7:49 am
Posts: 61
If you think about the contact constraint, it's a sort of min-distance constraint (I forget what the convention is in box2d, but assume that negative distance means penetration into the ground) -- the min distance is 0 for contacts. You should be able to apply the same sort of approach for a max distance constraint (or, I would assume any constraint with min/max limits should be analogous).

I'm not sure of the specifics since it's been a while since I looked at box2d :(


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:
Powered by phpBB® Forum Software © phpBB Group