Is diagonlize/extractRotation broken, i.e., does nothing? see 3 lines of example code and try yourself
Posted: Thu May 03, 2018 12:10 am
Example inertia tensor:
0.00076275 -0.00047298 0
-0.00047298 0.0019185 0
0 0 0.0022293
btMatrix3x3 inertia(0.00076275, -0.00047298, 0, -0.00047298, 0.0019185, 0, 0, 0, 0.0022293);
btQuaternion q = btQuaternion::getIdentity();
inertia.extractRotation(q);
The omega computed in extractRotation is 0 on the very first iteration of the loop resulting in exiting. This basically just returns your identity quaternion.... This function has been in bullet for a long time I'm hoping I'm just doing something wrong but...
Omega computes the sum of cross product of the columns of the identity q and the inertia tensor. This result in 0,0,0 since you get 0,0,-0.4730
+ 0,0,0.4730 and 0,0,0
Running eig to do vd decomp in matlab reveals correct rotation and principle axis.
0.00076275 -0.00047298 0
-0.00047298 0.0019185 0
0 0 0.0022293
btMatrix3x3 inertia(0.00076275, -0.00047298, 0, -0.00047298, 0.0019185, 0, 0, 0, 0.0022293);
btQuaternion q = btQuaternion::getIdentity();
inertia.extractRotation(q);
The omega computed in extractRotation is 0 on the very first iteration of the loop resulting in exiting. This basically just returns your identity quaternion.... This function has been in bullet for a long time I'm hoping I'm just doing something wrong but...
Omega computes the sum of cross product of the columns of the identity q and the inertia tensor. This result in 0,0,0 since you get 0,0,-0.4730
+ 0,0,0.4730 and 0,0,0
Running eig to do vd decomp in matlab reveals correct rotation and principle axis.