Basic 2d collision detection

后端 未结 1 1385
深忆病人
深忆病人 2020-12-01 17:32

Where can I go to read more about basic 2d collision detection for games or just applications that have some interactivity?

Edit: How about javascript for Canvas gam

相关标签:
1条回答
  • 2020-12-01 17:46

    The most important theorem to know is the Separating Axis Theorem (SAT). Basicly, it allows you to detect collision between two convex polygons. A good reading material is here.

    If your game only concerns with convex shapes, then sat.js is a decent choice.

    However, if you need to work with concave shapes, you need to other algorithms. You can decompose a concave shape into several convex shapes, poly-decomp.js can do it for you.

    This paper is very interesting if you want to dive deeper.

    0 讨论(0)
提交回复
热议问题