开发者

Basic 2d collision detection

开发者 https://www.devze.com 2023-01-19 01:15 出处:网络
Where can I go to read more about basic 2d collision detection for games or just applications that have some interactivity开发者_JS百科?

Where can I go to read more about basic 2d collision detection for games or just applications that have some interactivity开发者_JS百科?

Edit: How about javascript for Canvas games?


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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号