Learning-Based Physics Simulation With Collision Handling