Since the bikes were ok, I wonder if it was your braking more than the impact itself that tossed you. Not that it was necessarily avoidable even if it was. Still, it's worth saying that panic braking can throw you over the bars, and everyone should practice seeing how hard they can stop without nosediving. Just do it carefully and release the front brake if you feel your rear wheel starting to lift!