Page 1 of 1

Anchor alignment

Posted: Sat Jul 13, 2013 6:44 pm
by tescott
Here are a couple of super simple scripts for aligning joint anchors to the same location:

Align anchor A to B

Code: Select all

joint[] j = getSelectedJoints();

j[0].setLocalAnchorA(j[0].getBodyA().getLocalPoint(j[0].getWorldAnchorB()));
Align anchor B to A

Code: Select all

joint[] j = getSelectedJoints();

j[0].setLocalAnchorB(j[0].getBodyB().getLocalPoint(j[0].getWorldAnchorA()));
--tim