| 318 |
|
pAxisMat[i][0] = sU[i][maxAxis]; |
| 319 |
|
} |
| 320 |
|
|
| 321 |
+ |
|
| 322 |
|
//calculate the proper rotation matrix |
| 323 |
|
transposeMat3(pAxisMat, pAxisRotMat); |
| 324 |
|
|
| 331 |
|
|
| 332 |
|
identityMat3(iMat); |
| 333 |
|
setA(iMat); |
| 334 |
+ |
|
| 335 |
+ |
//and resort the moments of intertia to match the new orientation |
| 336 |
+ |
for (i=0; i<3; i++) |
| 337 |
+ |
if (evals[i]<momIntTol) |
| 338 |
+ |
evals[i] = 0.0; |
| 339 |
+ |
I[0][0] = evals[maxAxis]; |
| 340 |
+ |
I[1][1] = evals[midAxis]; |
| 341 |
+ |
I[2][2] = evals[pAxis]; |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
void RigidBody::doEulerToRotMat(double euler[3], double myA[3][3] ){ |