3 ms·
The description seems to ignore elastic collision - contact always occurs on a frame boundary which is noticeable wrong when higher velocities occur. Wouldn't t
by JoeAltmaier 16y ago
The description seems to ignore elastic collision - contact always occurs on a frame boundary which is noticeable wrong when higher velocities occur. Wouldn't the described solution result in 'sticking'?
- philh 16y agoNo, because the rebound velocity doesn't depend on how far two bodies intersect. To answer the wider question - when a contact is detected, you can immediately calculate the new velocity of the two bodies. Then you move things around to be nonintersecting. Then next frame, everything has the correct velocity. (In fact, this will be done in two passes. Collision detection will generate a list of contacts, containing properties like the initial velocities of the two bodies. Then the collision resolution phase will change the velocities.)
- JoeAltmaier 16y agoIts harder than that - the rebound path can generate more collisions. Its iterative and can take an indefinite amount of time to calculate a frame.