Dive into solving tunneling issues, movement bounds, and swept shapes in game physics to improve collision detection accuracy and prevent false positives and negatives.
01 / 112Physics for Games Programmers Reframing the Problem
1 / 17
Télécharger la présentation
Physics for Games Programmers Reframing the Problem
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Tunneling • Question #1: Do objects A and B overlap? • Plenty of reference material to help solve this, but... • ...this is often the wrong question to ask (begs tunneling).
Tunneling (cont’d) • Tunneling is very, very bad – this is not a “mundane detail” • Things falling through world • Bullets passing through people or walls • Players getting places they shouldn’t • Players missing a trigger boundary • Tunneling is a false negative • Okay, so tunneling really sucks. What can we do about it?
Movement Bounds • Question #2: Could A and B have collided during the frame? • Better than Question #1 (solves tunneling!), but...
Movement Bounds • Question #2: Could A and B have collided during the frame? • Better than Question #1 (solves tunneling!), but... • ...even if the answer is “yes”, we still don’t know for sure (false positive).
Movement Bounds • Conclusion • Good: They prevent tunneling! (i.e. no false negatives) • Bad: They don’t actually tell us whether A and B collided (still have false positives). • Good: They can be used as a cheap, effective early rejection test.
Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling).
Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling). • Finally, no false positives, either!
Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling). • Finally, no false positives, either! • No, wait, nevermind. Still have ‘em. Rats.
Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling). • Finally, no false positives, either! • No, wait, nevermind. Still have ‘em. Rats.
Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling). • Finally, no false positives, either! • No, wait, nevermind. Still have ‘em. Rats.
Swept Shapes (cont’d) • Conclusion • Suck? • Can be used as early rejection test, but... • ...movement bounds are better for that. • If you’re not too picky... • ...they DO solve a large number of nasty problems (especially tunneling) • ...and can serve as a poor man’s continuous collision detection for a basic engine.
Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates • x component • y component • in impact coordinates • parallel component • perpendicular component
Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates • x component • y component • in impact coordinates • parallel component • perpendicular component • Change in motion happens along the perpendicular axis
Relative Coordinate Systems (cont’d) • Ball vs. ball... • in world coordinates • x component • y component • in impact coordinates • parallel component • perpendicular component • Energy is exchanged along the perpendicular axis