Maxmin and restoring

Official forum for the Chipmunk2D Physics Library.
Post Reply
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Maxmin and restoring

Post by Mixel »

I want to create a system so that a pivot joint exists between two bodies and another joint is used to create a maximum and minimum rotation about one of the bodies, and a restoring force. What joint should I use?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Maxmin and restoring

Post by slembcke »

Rotary limit joint. Use a damped spring if you want a separate restoring force.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Re: Maxmin and restoring

Post by Mixel »

Rotary limit joint does not work for this purpose as I meant that the minimum and maximum rotation should be that of one body's position about the other. In other words, the rotation of the pinjoint about one of the bodies. What constraint should I use?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Maxmin and restoring

Post by slembcke »

Still sounds like you want a rotary limit joint from what you are describing. A picture might help?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Re: Maxmin and restoring

Post by Mixel »

flowRoot3778.png
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Re: Maxmin and restoring

Post by Mixel »

The black line is a pinjoint. The blue lines show the angles. The upper body has rotation limits while the lower one does not.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Maxmin and restoring

Post by slembcke »

So to be specific, not the rotation of the bodies themselves, but angle of the relative position of the bodies? Do you care about the rotation of the bodies themselves? There are a couple ways you can do that depending.

If you lock the rotation of the upper right body by giving it an infinite moment of inertia, you can use a pivot joint with the pivot set the center of the upper right body. This will cause the second body to rotate around the center of the first body. Then use a rotary limit joint to control the angle (and position based on that angle) to the second body. If you want the second body to be able to rotate about it's own center freely and only constrain the angle of it's relative position, you can use a slide joint to "tie" the center of the second body to some point relative to the first like a rope.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Re: Maxmin and restoring

Post by Mixel »

The upper body should be able to rotate between the max and min. Could you explain better how to use a slide joint to do this.
Mixel
Posts: 41
Joined: Mon Feb 14, 2011 7:10 am
Contact:

Re: Maxmin and restoring

Post by Mixel »

It would be good to create a constraint for this purpose.
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 14 guests