Sphere or molecules collision detection and response