Calculate direction vector after collision
For other bodies the force direction depends on the shape and the point of contact.
The velocity of the bodies after collision depends on the masses of the bodies and the restitution, as well as the contact normal. But again, for a perfectly bouncing ball against a wall the solution is easy: reverse the component of velocity along the wall's normal vector.
The velocity of the bodies after collision depends on the masses of the bodies and the restitution, as well as the contact normal. But again, for a perfectly bouncing ball against a wall the solution is easy: reverse the component of velocity along the wall's normal vector.
Gravity still applies while the wall and ball are in contact. This is irrelevant for rigid collisions but becomes important for other types of collisions (notably, soft-body).
The velocity of the bodies after collision depends on the masses of the bodies and the restitution, as well as the contact normal. But again, for a perfectly bouncing ball against a wall the solution is easy: reverse the component of velocity along the wall's normal vector.
Gravity still applies while the wall and ball are in contact. This is irrelevant for rigid collisions but becomes important for other types of collisions (notably, soft-body).
Gravity is quite far down the list of effects to consider. Given the nature of the question, I'm sure frictionless rigid bodies is a good starting point.
Gravity is quite far down the list of effects to consider. Given the nature of the question, I'm sure frictionless rigid bodies is a good starting point.
I was just highlighting that other forces don't suddenly stop acting upon collision, and must still be considered (and added to the collision response force properly) if the collision time is nonzero (for rigid bodies, it is zero, which is why I said that this is irrelevant for rigid collisions). So in fact gravity is not even on the list of effects to consider.