I have two objects, A and B, and I need help to solve the following problem about the collision resolution order:
A and B are moving with the same speed, and they don't move both at the same time
- A tries to move to where it should be, and I do the collision test
- A collision is detected, and A is moved outside of collision
- Then B moves after this, and a gap appears between then
I tried resolving the collision of A by discouting the velocity of B, but this fails if B collides on it's path, and A moves inside of it.
Are there any algorithm that can solve this problem? And also when working with multiple objects moving in a row just like A and B.
Also, my objects don't have any mass or elasticity, they are supposed to just move and get out of collision using simple AABB.