You have experienced a fainting
spell. It is the body's response to an overwhelming stimulus, in your case, severe pain
from the accident.
When you are not ready for this type of pain, your body could respond just like what you experienced. We call it vaso-vagal stimulation. You will have fast heartbeat, youll feel very weak, and eventually pass out but only for a few seconds. Feel free to follow up if you have other querries.