Here is my method for returning an inertia tensor for a sphere:
public static Matrix Inertia_Tensor_Sphere_Shell(float object_Mass, float sphere_Radius)
{
float mass = 2.0f / 3.0f * object_Mass;
double powR = Math.Pow(sphere_Radius, 2);
return new Matrix(
(float)(mass * powR), 0, 0, 0,
0, (float)(mass * powR), 0, 0,
0, 0, (float)(mass * powR), 0,
0, 0, 0, 1
);
}
The problem I am having is transforming that matrix/tensor into world coordinates correctly.
If I have the following transform matrix (I assume this is correct):
matrix_Transform = Matrix.CreateFromQuaternion(orientation) * Matrix.CreateTranslation(position);
I then have to transform the inverse of the inertia tensor by the transform matrix to get the inverse inertia tensor in world coordinates
// Tranpose the inertia tensor to get the inverse
inertia_Tensor_Inverse = Matrix.Transpose(inertia_Tensor)
// Calculate the inverse inertiaTensor in world space ----IS THIS CORRECT???
inertia_Tensor_World_Inverse = matrix_Transform * inertia_Tensor_Inverse;
The last line is the one I am concerned about. Have I done this all correctly?
The problem I am having with the physics at the moment is as follows:
When I drop a sphere onto another sphere the sphere "bounces" off. However, if the mass of both the sphere are increased, the bounce response increases which doesn't make any sense.
Thanks for your help on this.