"combining" objects with joints

Official forum for the Chipmunk2D Physics Library.
Post Reply
vulh102
Posts: 13
Joined: Tue Sep 25, 2007 9:24 am
Contact:

"combining" objects with joints

Post by vulh102 »

Hi!

i want to fixate two bodies too eachother through the use of a joint.

i thought that i should be using the pin joint, but it gives wierd results.
the effect im after is that i want the two objects to seem like a single object.

i tested with the pivot joint and that works as expected.
solmead
Posts: 2
Joined: Mon Jun 29, 2009 8:22 am
Contact:

Re: "combining" objects with joints

Post by solmead »

The pin joint is like fixing a rod/bar between the two objects with the end points of this "rod" being the points you specify. As you found out much better to use a pivot joint for this.
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: "combining" objects with joints

Post by maximile »

It's usually better to add the shapes of the two bodies to one body instead. That'll be faster and more stable.

Some people have faked it using two crossed pin joints.
vulh102
Posts: 13
Joined: Tue Sep 25, 2007 9:24 am
Contact:

Re: "combining" objects with joints

Post by vulh102 »

how hard would it be to add a new joint?
i am working on a physics editor, so adding the shapes to a shared body will complicate other tools, and using crossed pins just seems hackish


seems wierd that a fixed joint isnt implemented ; they exist in every other physics lib
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: "combining" objects with joints

Post by slembcke »

It wouldn't really be that hard to add, but locking multiple objects together using a joint is most certainly going to be more "hackish" than putting them together on the same body. The reason is that it takes extra CPU time to make the joint work, and on top of that constraining two bodies together like that will never be as solid.
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], Heise IT-Markt [Crawler] and 5 guests