Is it possible to set the inertia tensor used for a rigid body control?
I have understood thus far that it is possible to set the mass and principal moments of inertia for a rigid body through function calls to jbullet itself through the following functions:
final javax.vecmath.Vector3f principalInertia = new javax.vecmath.Vector3f(inertia.toArray(null)); rbc.getObjectId().setMassProps(mass_kg, principalInertia);
or to set the principal inertias more directly:
final javax.vecmath.Vector3f principalInertia = new javax.vecmath.Vector3f(inertia.toArray(null)); setInvInertiaDiagLocal(Vector3f diagInvInertia);
However, I have not been able to find any way to set the off diagonal terms of the inertia tensor, namely through specifying the principal axes. At the very least, I expected it to be pretty straightforward something as basic as the entire inertia matrix for an rbc to exist, but i have not been able to find anything. At first i considered that jbullet might limit itself to have all rigid bodies require principal axes that align with the reference frame unit vectors( which would be severely limiting, but i considered it nonetheless) but I could clearly see that it was possible to get the inertia tensor as a whole(but not set it?) that the off diagonal terms were not zero. Namely this was observed with the function:
javax.vecmath.Matrix3f inertiaTensor = new javax.vecmath.Matrix3f(); rbc.getObjectId().getInvInertiaTensorWorld(inertiaTensor);
Since the off diagonal terms were clearly non-zero, then the principal axes are clearly not aligned with the rbc reference frame. So the question remains, how can either the principal axes or the entire inertia tensor as a whole be set?