官术网_书友最值得收藏!

Compound colliders

A compound collider is when a game object uses multiple colliders to determine whether there was a collision. We are going to use compound circle colliders on our ship to improve the accuracy of our ship collision detection while still providing the increased speed of using circle colliders. We will cover our player's ship and our enemy ship with three circles. Our projectiles are a circle shape, so using a circle for those is entirely natural. There is no reason you need to limit compound colliders to using only one shape of collider. Internally, a compound collider could mix circle colliders with rectangle colliders or any other type you like.

The following diagram shows a hypothetical compound collider made up of a circle and two rectangle colliders:

A compound collider composed of three basic colliders

In the next section, we will learn how to implement a basic circle collision detection algorithm.

主站蜘蛛池模板: 成武县| 涟源市| 新昌县| 辉南县| 修武县| 伽师县| 孙吴县| 开化县| 铜山县| 岳普湖县| 蛟河市| 政和县| 芦山县| 天等县| 武定县| 同德县| 革吉县| 宣恩县| 辰溪县| 太康县| 蒙阴县| 绥棱县| 朔州市| 张家界市| 双鸭山市| 渭南市| 崇州市| 鄂托克旗| 云龙县| 五指山市| 新民市| 河东区| 万年县| 大城县| 会同县| 历史| 汶上县| 迭部县| 嘉义县| 锡林浩特市| 大连市|