Collision of two rigid spheres with spin
I'm trying to create a particle simulation (solar system kind). Until now my particles have no spin so the collision is rather simple
void collide(const Particle& b) {
const Vector3d normal = math::normal(position(), b.position());
const Vector3d relativeVelocity = velocity() - b.velocity();
const double dot = math::dot(relativeVelocity, normal);
const Vector3d work = normal * dot;
_velocity = _velocity - work;
}
Since I've read that particle spin plays a huge part in such simulations I'm trying to implement angular momentum but unfortunately this exceeds my math skills. I tried searching the internet for quite a while now for any source I understand but I'm at the brink of giving up.
How can I integrate particle spin into my code? I can work with any kind of (pseudo) code as long as the variables are somewhat clear. Particles are rigid spheres with mass = volume.
Edit: Dont get hang up on what the simulation is trying to achieve. The task can be simplified down to: Two rigid spheres collide in space. Calculate their motion and spin after the collision.