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

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.

主站蜘蛛池模板: 会泽县| 礼泉县| 侯马市| 开封市| 房山区| 毕节市| 宁河县| 肇州县| 彝良县| 体育| 伊春市| 青岛市| 綦江县| 天水市| 平原县| 威远县| 陆良县| 区。| 丘北县| 武功县| 甘肃省| 五家渠市| 秦皇岛市| 鄂托克前旗| 胶南市| 廉江市| 龙南县| 瑞昌市| 麻城市| 华安县| 灌阳县| 盱眙县| 油尖旺区| 尖扎县| 阿坝县| 福清市| 鄂温| 隆安县| 维西| 黄山市| 谢通门县|