1 registered members (3s05bmmc),
745
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Newton 2 wrapper
[Re: VeT]
#301039
12/07/09 22:16
12/07/09 22:16
|
Joined: Mar 2007
Posts: 197
yorisimo
Member
|
Member
Joined: Mar 2007
Posts: 197
|
I believe that link is only regarding the internal hinge joint. From the Newton Wiki Newton Wiki: "The internal Hinge joint is a legacy join form previous version that we do not recommend continue using." I am interested in using the CustomHingeJoint from the new joint library in Newton 2 (especially because it has built in joint limits). I had trouble figuring out what the pinsAndPivoChildFrame matrix was supposed to be but I figured it out...here's an example
//about x axis
float pinPivotMatrix[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
//about y axis
//float pinPivotMatrix[16] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
//about z axis
//float pinPivotMatrix[16] = {0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1};
//Set the position of the pivot point
pinPivotMatrix[12] = 160*QUANTTOMETER;
pinPivotMatrix[13] = 147*QUANTTOMETER;
pinPivotMatrix[14] = 400*QUANTTOMETER;
NewtonUserJoint* nujoint = CreateCustomHinge(pinPivotMatrix, nbodyChild, nbodyParent);
HingeEnableLimits (nujoint, 1);
float ub = 45*DEG2RAD;
float lb = -45*DEG2RAD;
HingeSetLimis (nujoint, lb, ub);
Last edited by yorisimo; 12/07/09 22:21.
|
|
|
|