Working with distance joints

General discussion about the R.U.B.E editor
Post Reply
mfagerlund
Posts: 20
Joined: Wed Jul 10, 2013 2:07 pm

Working with distance joints

Post by mfagerlund »

As soon as I move either anchor point of a distance joint, it's in violation with it's limits - which is to be expected. But if I want to change the joint limit to match the new configuration, I have to hover over the joint to figure out how long it is and then manually change the joint limit to the new length. Not too difficult, but perhaps that should be in the action menu?

And also - tab doesn't seem to take me from one property to the next one in the property editor? It's my experience that most programs do that...
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Working with distance joints

Post by iforce2d »

This script will do that for all selected joints, you could add it to the action menu:

Code: Select all

joint[] js = sj();
for (uint i = 0; i < js.length; i++) {
	joint j = js[i];
	float dist = j.getWorldAnchorA().distanceTo( j.getWorldAnchorB() );
	j.setLength( dist );
}
About the tab key, I seem to recall there was some quirk with the Qt framework that made that difficult for some reason. I will take another look and see if it can be improved.
mfagerlund
Posts: 20
Joined: Wed Jul 10, 2013 2:07 pm

Re: Working with distance joints

Post by mfagerlund »

thanks!
Post Reply