SlideServe
Menu
Préférences
© SlideServe · v2026

Physics for Games Programmers Reframing the Problem

thuong avatar
112 diapositives · 1.3K Views · Mar 08, 2014

Dive into solving tunneling issues, movement bounds, and swept shapes in game physics to improve collision detection accuracy and prevent false positives and negatives.

Physics for Games Programmers Reframing the Problem - slide 1
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.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Physics for Games Programmers Reframing the Problem Squirrel EiserlohTechnical DirectorMumboJumbo Gamessquirrel@eiserloh.netwww.algds.org

  2. Physics for Games Programmers Reframing the Problema.k.a. “It’s All Relative” Squirrel EiserlohTechnical DirectorMumboJumbo Gamessquirrel@eiserloh.netwww.algds.org

  3. Overview • Tunneling • Movement Bounds • Swept Shapes • Einstein Says... • Minkowski Says... • Rotation

  4. Tunneling (Sucks)

  5. 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).

  6. Tunneling

  7. Tunneling

  8. Tunneling

  9. Tunneling

  10. 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?

  11. Movement Bounds

  12. Movement Bounds • Disc / Sphere

  13. Movement Bounds • Disc / Sphere • AABB (Axis-Aligned Bounding Box)

  14. Movement Bounds • Disc / Sphere • AABB (Axis-Aligned Bounding Box) • OBB (Oriented Bounding Box)

  15. Movement Bounds • Question #2: Could A and B have collided during the frame? • Better than Question #1 (solves tunneling!), but...

  16. 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).

  17. 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.

  18. Swept Shapes

  19. Swept Shapes • Swept disc / sphere (n-sphere): capsule

  20. Swept Shapes • Swept disc / sphere (n-sphere): capsule • Swept AABB: convexpolytope (polygon in 2d, polyhedron in 3d)

  21. Swept Shapes • Swept disc / sphere (n-sphere): capsule • Swept AABB: convex polytope (polygon in 2d, polyhedron in 3d) • Swept triangle / tetrahedron (simplex): convex polytope

  22. Swept Shapes • Swept disc / sphere (n-sphere): capsule • Swept AABB: convex polytope (polygon in 2d, polyhedron in 3d) • Swept triangle / tetrahedron (simplex): convex polytope • Swept polytope: convexpolytope

  23. Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit!

  24. Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling).

  25. Swept Shapes (cont’d) • Like movement bounds, only with a perfect fit! • Still no false negatives (tunneling). • Finally, no false positives, either!

  26. 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.

  27. 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.

  28. 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.

  29. 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.

  30. Einstein Says... • Coordinate systems are relative

  31. Relative Coordinate Systems

  32. Relative Coordinate Systems • World coordinates

  33. Relative Coordinate Systems • World coordinates • A’s local coordinates

  34. Relative Coordinate Systems • World coordinates • A’s local coordinates • B’s local coordinates

  35. Relative Coordinate Systems • World coordinates • A’s local coordinates • B’s local coordinates • Many others (e.g. origin at point of impact)

  36. Relative Coordinate Systems (cont’d) • Ball vs. world...

  37. Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates

  38. Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates • x component • y component

  39. Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates • x component • y component • in impact coordinates

  40. Relative Coordinate Systems (cont’d) • Ball vs. world... • in world coordinates • x component • y component • in impact coordinates • parallel component • perpendicular component

  41. 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

  42. Relative Coordinate Systems (cont’d) • Ball vs. ball...

  43. Relative Coordinate Systems (cont’d) • Ball vs. ball... • in world coordinates

  44. Relative Coordinate Systems (cont’d) • Ball vs. ball... • in world coordinates • x component • y component

  45. Relative Coordinate Systems (cont’d) • Ball vs. ball... • in world coordinates • x component • y component • in impact coordinates

  46. 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

  47. Relative Coordinate Systems (cont’d) Also, math is often nicer at the origin. x2 - 2xh + h2 + y2 - 2yk + k2 = r2 x2 + y2 = r2

  48. Einstein Says... • Coordinate systems are relative • Motion is relative

  49. Relative Motion