基于层的碰撞检测 Layer-Based Collision Detection
2014-10-22 14:20
309 查看
原文链接:http://game.ceeger.com/Components/LayerBasedCollision.html
In Unity 3.x we introduce Layer-Based collision detection, which is a way to make Game Objects collide with another specific Game Objects that are tied up to specific layers.
在Unity3.x中我们引入了基于层的碰撞检测,即在GameObject和绑定在指定层中的特定的GameObject之间进行碰撞检测。
Objects Colliding with their own layer.
In the image above you can see 6 GameObjects, (3 planes, 3 cubes) and the "Collision Matrix" to the right that states which Objects can collide with which layer. In the example, we have set the Collision Matrix in a way that only GameObjects that belong
to same layers can collide.
在上图中,你能看到6个游戏对象(3个平面,3个立方体),以及右边的"碰撞矩阵"。该矩阵描述了哪一个对象能和哪一层产生碰撞作用。例如图中的碰撞矩阵设置,使得只有属同层的游戏对象能相互碰撞。
Setting GameObjects to detect Collisions Based on Layers.
Select a layer your Game Objects will belong to
选择选定游戏对象的层
Repeat 1 for each Game Object until you have finished assigning your Game Objects to the layers.
重复第1步,直到你完成对该层的关联操作
Open the Physics Preference Panel by clicking on Edit->Project Settings->Physics.
项目设置->物理,打开物理引用界面
Select which layers on the Collision Matrix will interact with the other layers by checking them.
在碰撞矩阵中选择要与其他层相互作用的层,勾选即可
In Unity 3.x we introduce Layer-Based collision detection, which is a way to make Game Objects collide with another specific Game Objects that are tied up to specific layers.
在Unity3.x中我们引入了基于层的碰撞检测,即在GameObject和绑定在指定层中的特定的GameObject之间进行碰撞检测。
Objects Colliding with their own layer.
In the image above you can see 6 GameObjects, (3 planes, 3 cubes) and the "Collision Matrix" to the right that states which Objects can collide with which layer. In the example, we have set the Collision Matrix in a way that only GameObjects that belong
to same layers can collide.
在上图中,你能看到6个游戏对象(3个平面,3个立方体),以及右边的"碰撞矩阵"。该矩阵描述了哪一个对象能和哪一层产生碰撞作用。例如图中的碰撞矩阵设置,使得只有属同层的游戏对象能相互碰撞。
Setting GameObjects to detect Collisions Based on Layers.
设置游戏对象来进行基于层的碰撞检测
Select a layer your Game Objects will belong to选择选定游戏对象的层
Repeat 1 for each Game Object until you have finished assigning your Game Objects to the layers.
重复第1步,直到你完成对该层的关联操作
Open the Physics Preference Panel by clicking on Edit->Project Settings->Physics.
项目设置->物理,打开物理引用界面
Select which layers on the Collision Matrix will interact with the other layers by checking them.
在碰撞矩阵中选择要与其他层相互作用的层,勾选即可
相关文章推荐
- 基于对比度滤波的显著区域检测-SF(Saliency Filters: Contrast Based Filtering for Salient Region Detection)
- AndEngine学习:CollisionDetectionExample(碰撞检测)
- 基于马尔科夫吸收概率的显着区域检测_MAP(Saliency Region Detection Based on Markov Absorption Probabilities)
- 11. 碰撞检测和收集物品:如何使用cocos2d制作基于tiled地图的游戏:第二部分
- 使用判别训练的部件模型进行目标检测 Object Detection with Discriminatively Trained Part Based Models
- 显著性检测论文解析2——Visual Saliency Detection Based on Bayesian Model, Yulin Xie, ICIP2011
- 基于2D多边形的碰撞检测和响应(七)
- 基于cocos2d-x对俯视角游戏碰撞检测及碰撞处理的探究
- 基于 HTML5 Canvas 的 3D 碰撞检测
- Rigidbody.detectCollisions 碰撞检测
- 碰撞测试 (Real Time Collision Detection Chapter 7)
- Cocos2d-x中Physics物理引擎碰撞检测,setCategoryBitmask,setContactTestBitmask,setCollisionBitmask
- 【论文笔记】物体检测系列 R-FCN: Object Detection via Region-based Fully Convolutional Networks
- Deep Neural Networks for Object Detection(基于DNN的对象检测)
- 从零开始做一个基于pygame引擎的躲闪小游戏(一)-画矩形、画圆、简单的碰撞检测
- Unity碰撞检测中OnTriggerXXX和OnCollisionXXX的功能注解
- [Unity3D]射线碰撞检测+LayerMask的使用
- 基于投影方法的碰撞检测以及一个测试DEMO【C + SDL】
- [Unity3D]射线碰撞检测+LayerMask的使用
- 基于分离轴定理的碰撞检测