This project has moved. For the latest updates, please go here.

Get the location of an existing joint

Topics: Developer Forum, User Forum
Jun 19, 2012 at 10:40 PM

I want to draw the joints in my world, but I can't figure out a way to get the location of the joint. I can get a list of all the joints with World.JointList and loop through it, but there's no Position property or anything similar. Is there any way I can get or at least calculate the position of a joint?

Jun 19, 2012 at 11:08 PM

A joint constraints the DoFs of two anchor points (and consequently the two rigid bodies by definition of rigid body). You can get them in world coordinates as WorldAnchorA and WorldAnchorB. You can look at the DrawJoint() method in the DebugViewXNA project for an example of how to draw joints based on type.