Simulating a tight joint.

Official forum for the Chipmunk2D Physics Library.
Post Reply
scorp
Posts: 29
Joined: Sat May 10, 2008 1:41 pm
Contact:

Simulating a tight joint.

Post by scorp »

Recently I was thinking of a way to simulate a joint which won't move until torque reaches certain amount. I guess that can also be described as “adding friction to the joint” or “making it tight”.

My thinking failed epically. :D

Anyone has any ideas?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Simulating a tight joint.

Post by slembcke »

You can do it with the joint constraint changes in trunk pretty trivially.

To simulate the "tightness", you would add a simple motor constraint with a speed of 0. You would also want to change the maximum force of the simple motor to be the minimum torque to rotate the joint. I've done this before and it works excellently. Because it's run as a real constraint inside the impulse solver, there is no "creeping" or other issues you would get if you only used forces.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
raposon
Posts: 3
Joined: Sat Feb 14, 2009 8:39 pm
Contact:

Re: Simulating a tight joint.

Post by raposon »

I saw your reference to "truck".
What do you mean by that? Is it an example? Where can I find it?

Is there a way to not allow a joint to get stretched?
I'm using a slide joint but it still allows it to be stretched if enough force is applied to it.

Thanks for the library.
I'm having a lot of fun with it.
ker
Posts: 56
Joined: Tue Jul 15, 2008 4:13 am
Contact:

Re: Simulating a tight joint.

Post by ker »

that's a typo. slembcke meant "trunk", which is the most recent version of chipmunk in the svn-repository. Take a look at http://code.google.com/p/chipmunk-physi ... e/checkout to learn how to obtain this. You will need to compile this yourself. Linux and Mac compilation is pretty straight forward, but it will get messy with windows. Read the msvc thread for windows compilation.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Simulating a tight joint.

Post by slembcke »

Oh, whoops. Fixed the typo.

Depending on what is causing the stretching, try increasing the iterations or decreasing the time step. You cannot prevent it entirely.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 26 guests