distance Joint and Revolute joint with one body

Posts that don't fit into other categories.
maheshkurmi
Posts: 63
Joined: Tue Mar 27, 2012 7:20 am
Location: India
Contact:

distance Joint and Revolute joint with one body

Postby maheshkurmi » Mon Feb 25, 2013 12:55 pm

I want to use distance joint with one end anchored to a body and other end anchored to world.
So we will need just 3 parameters for distance joint, body to be anchored, first anchor Point on body and second anchor point not on body in world space.
For revolute joint we will need just 2 parameters , body to be anchored and point on body in world space.

One way to achieve this is to create one immovable body (which doesn't sense collision and is not rendered ) and the create distance joint between this body and given body.
Is there any better way to achieve this?
Mahesh

William
Site Admin
Posts: 378
Joined: Sat Feb 06, 2010 10:23 pm

Re: distance Joint and Revolute joint with one body

Postby William » Mon Feb 25, 2013 7:51 pm

You can use the mouse joint to create a springy distance joint (always a distance of zero), but this is the only single-body joint. You can create one immovable body for the world and just use it over and over again however. The anchor points don't actually have to be *on* the bodies really, they are just solved as if they were. For example, your world body could be at (0,0) and have no shape (no fixtures need to be added IIRC) but you can specify the anchor to be (10, 10).

William

maheshkurmi
Posts: 63
Joined: Tue Mar 27, 2012 7:20 am
Location: India
Contact:

Re: distance Joint and Revolute joint with one body

Postby maheshkurmi » Tue Feb 26, 2013 7:36 am

Thank you very much, it is super easy now!!! :P
Mahesh


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest