In my 3d rigid-body simulation, when the ball hits an object it doesn't get rotated. I'm using AABB for collision detection
this is how i update the objects
void RigidBody::Update(float h)
{
x += h*v;
v += h*(F_Total/Mass);
q += 0.5f*h*Omegaq;
L += h*Tau_Total;
q = XMQuaternionNormalize(q);
R = XMMatrixRotationQuaternion(q);
IInverse = XMMatrixMultiply(XMMatrixTranspose(R), IBodyInverse);
IInverse = XMMatrixMultiply(IInverse, R);
Omega = XMVector4Transform(L, IInverse);
F_Total = XMVectorSet(0, 0, 0, 0);
Tau_Total = XMVectorSet(0, 0, 0, 0);
UpdateAABB();
}
This is how add impulsive torque and torque to the system
void RigidBody::AddTorque(XMVECTOR Torque)
{
Tau_Total += Torque …