Collision processing code and motion integration (forward Euler)