Which constraint type ?

Official forum for the Chipmunk2D Physics Library.
Post Reply
Lylith
Posts: 8
Joined: Sun Aug 21, 2011 9:21 am
Contact:

Which constraint type ?

Post by Lylith »

I can not figure out how to limit the movement of two blocks relative to each other only along the axis Y. And without rotation relative to each other.
Image
I tried different types, but only got this.
Image
Lylith
Posts: 8
Joined: Sun Aug 21, 2011 9:21 am
Contact:

Re: Which constraint type ?

Post by Lylith »

Another additional question.
How to fix the body rotated at some angle, with two PivotJoint ?
I am creating a body, turn it to the desired angle, add a Pivots. The body pushes and rotated by an angle 0.
*Blue shows the original position, before adding Pivots.
Image
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Which constraint type ?

Post by slembcke »

I can not figure out how to limit the movement of two blocks relative to each other only along the axis Y. And without rotation relative to each other.
Use a groove joint for the vertical motion and a gear joint with a ratio of 1.0 for the rotation.
How to fix the body rotated at some angle
Use a gear joint again with a ratio of 1.0. Use the phase property to set the angle between them.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Lylith
Posts: 8
Joined: Sun Aug 21, 2011 9:21 am
Contact:

Re: Which constraint type ?

Post by Lylith »

How did you know that it works!? :)
Thank you very much. You saved a lot of my time. I left a detailed study of Gear on later. I hade association: gear- mean movement.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Which constraint type ?

Post by slembcke »

Yeah, I guess it's not obvious, but a gear joint with a ratio of 1.0 means both objects rotate at the same speed. It basically locks their rotation together.
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: No registered users and 29 guests