• m trying to attach a GVRMeshCollider to a GVRSceneObject, but the collider is no where near the actual mesh. Below are some things I have tried so far. <code>obj.attachCollider(new GVRMeshCollider...
• <p>I also made a small adjustment to mesh_collider.cpp, which removes an unnecessary matrix operation, as no accuracy is gained from calculating the hit distance in world coordinates - a matrix and ...
• 如果直接在模型身上添加mesh collider的话 collider是不会跟随骨骼运动的，所以要想跟随就必须将mesh collider放到模型的根骨骼上面
如果直接在模型身上添加mesh collider的话  collider是不会跟随骨骼运动的，所以要想跟随就必须将mesh collider放到模型的根骨骼上面


展开全文
• After I run <code>go test collider,there is some log below: <pre><code> collider ../../go/src/collider/dashboard_test.go:35: Errorf format %d has arg expected of wrong type string ../../go/src/...
• Unity中使用该插件对不规则物体制作Collider，导入工具包后给要添加碰撞器的物体添加Concave Collider基本，点击计算即可
• <div><p>A month or two ago I tried to attach boat collider object to a character so he could create waves while running in shallow water but that collider is visible during movement. I understand ...
• ## wheelCollider

千次阅读 2019-02-28 09:56:10
mass 质量 质量越大摩擦力会越大 Suspension Distance 车轮悬架距离 wheelcollider.morotTorque 驱动力 brakeTorque 这个是刹车的动力 steerAngle 这个是控制车子的转向

mass 质量  质量越大摩擦力会越大
Suspension Distance 车轮悬架距离
wheelcollider.morotTorque 驱动力
brakeTorque 这个是刹车的动力
steerAngle 这个是控制车子的转向
wheelcollider.rpm 这个可以获取车轮的转速
float speed = (wc.rpm ) * (wc.radius * 2 * Mathf.PI) * 60 / 1000;//这个可以得到千米每小时 的速度(wc.rpm这个得到车轮每分钟转了多少圈(wc.radius2Mathf.PI)车轮的周长   (wc.rpm*(wc.radius2Mathf.PI)每分钟走了多长距离 乘60得到每小时的距离 再除以1000 就是km/h
控制车轮模型的前进转动，实际就是控制模型的旋转 可以使用
车轮模型.Rotate()进行控制，其实就是要算出每秒转动的度数
wheelcollider.rpm360得到每分钟转的度数
wheelcollider.rpm360/60得到每秒转动的度数
车轮模型.Rotate(wheelcollider.rpm360/60Time.deltaTime*Vector.right)即可
控制车轮模型的转向转动，实际是控制模型在竖直向上方向的转动，也就是Y轴方向  可以通过wheelcollider.steerAngle
代码
Vector localeuler = 轮子模型.localEulerAngle
localeuler.y = wheelcollider.steerAngle
再把localeuler赋值给  轮子模型.localEulerAngle就行了
如果都用同一个轮子的层级去控制旋转有可能会有问题，那么可以让父辈去控制轮子的转弯转动，子辈控制轮子的前进转动。 只有前轮会左右转和向前转
控制车子的刹车刹车有两种情况表示用户是要刹车，一种是车子速度大于0，用户输入后退，另一种是倒车，用户输入前进
当刹车时，需要将驱动力设为0 wheelcollider.mortorTorque = 0
wheelcollider.brakeTorque = 1000  表示刹车动力为1000
wheelcollider有个属性判断轮子是否着地
通过wheelcollider.GetGroundHit(out hit)  其中out hit 变量类型是  WheelHit  hit


展开全文
• d be better to let any collider be able to utilize this extension. <h2>Target of the change: <p>Is this enhancement for: <ul><li>Extensions</li></ul> <h2>Changes: <p>Makes any collider be able to ...
• <p>For example a map like Outset Island from Legend of Zelda: Wind Waker HD would be impossible to accurately map collision to its geometry using any of the the provided collider shapes as there isn&#...
• Easy collider editor is designed to facilitate the creation of 3D primitive colliders. By using primitive colliders instead of mesh colliders, rigidbodies can be added to gameobjects to allow for ...
• <p>When this prefab is loaded, the collider that was generated will be one of two paths under the same game object. <strong>What I would like to see is an option to export each of these two to ...
• ## Collider 详解

万次阅读 2016-11-23 13:37:45
网格碰撞器利用 网格资源 并在其上构建碰撞器。对于复杂网状模型上的碰撞检测，它要比 基元碰撞器(boxCollider、capsuleCollider等)精确的多。标记为 Convex 的网格碰撞器才能够和其他网格碰撞器发生碰撞。

一Mesh Collider1 属性
2 触发器 Trigger
3 摩擦力和弹力
4 Hints

二Box Collider1 属性

三Capsule Collider1 属性

四Wheel Collider
五高级1 碰撞体组合
2 碰撞动作矩阵

参考

一、Mesh Collider

网格碰撞器利用 网格资源 并在其上构建碰撞器。对于复杂网状模型上的碰撞检测，它要比 基元碰撞器(boxCollider、capsuleCollider等)精确的多。标记为 Convex 的网格碰撞器才能够和其他网格碰撞器发生碰撞。

1.1 属性

Material 材质
引用何种物理材质,决定了他和其他对象如何作用。
Is Trigger 是否触发器
如激活，此碰撞器用于触发事件，并且被物理引擎忽略。
Mesh 网格
用于碰撞所引用的网格。
Smooth Sphere Collisions  平滑性状碰撞
当被激活，碰撞网格法线是平滑的。用于平滑表面比如由没有棱角的平滑起伏组成的起伏地标时应该激活。
Convex 凸起的
如激活，该网格碰撞器将会和其他网格碰撞器碰撞。凸起的网格碰撞器限制在 255 个三角形面内。

网格碰撞器通过附加在游戏对象上的 网格 构建碰撞效果，并严格按照所附加对象的 Transform 属性来设定碰撞器位置和大小比例。

使用 Mesh Collider 时有一些限制。通常，两个 Mesh Collider 不能相互碰撞，所有 Mesh Collider 都可以与任何基元 Collider 碰撞。如果某个 Mesh Collider 标记为凸体 (Convex)，则它可以与其他 Mesh Collider 碰撞，即两个网格碰撞体中只有一个标记了 Convex 时。

碰撞体 (Collider) 与刚体 (Rigidbody) 结合使用可使 Unity 中的物理变得生动。刚体 (Rigidbody) 使对象可以受物理控制，而碰撞体 (Collider) 使对象可以相互碰撞。碰撞体 (Collider) 必须独立于刚体 (Rigidbody) 添加到对象。碰撞体 (Collider) 并不一定需要附加刚体 (Rigidbody)，但是必须添加刚体 (Rigidbody) 才能使对象由于碰撞而移动。

当两个碰撞体 (Collider) 之间发生碰撞时，并且如果其中至少一个附加了刚体 (Rigidbody)，会将三条碰撞消息(OnCollisionEnter、OnCollisionEnter、OnCollisionStay)向外发送给附加到它们的对象。这些事件可以在脚本中进行处理，使您可以在使用或不使用内置 NVIDIA PhysX 引擎的情况下创建独特行为。

1.2 触发器 (Trigger)

碰撞体还可以作为触发器 (Trigger)，只需在检视视图 (Inspector) 中选中“为触发器”(IsTrigger) 属性复选框即可。触发器 (Trigger) 实际上会被物理引擎忽略，并具有一组独有的三条触发器消息(OnTriggerEnter、OnTriggerExit、OnTriggerStay)，这些消息会在与触发器 (Trigger) 发生碰撞时向外发送。触发器 (Trigger) 可用于触发游戏中的其他事件，如剧情画面、自动门打开、显示辅导消息等。请充分发挥您的想象力！

请注意，要使两个触发器 (Trigger) 在碰撞时向外发送触发器 (Trigger) 事件，其中之一必须还包括刚体 (Rigidbody)。要使触发器 (Trigger) 与普通碰撞体 (Collider) 碰撞，则其中之一必须附加刚体 (Rigidbody)。有关不同类型碰撞的详细图表，请参阅下面“高级”部分中的碰撞动作矩阵。

1.3 摩擦力和弹力

摩擦力、弹力和柔软度在物理材质 (Physisc Material) 中定义。

1.4 Hints

Mesh Collider 不能相互碰撞，除非而且两者之一标记为凸体 (Convex)。因此，它们对背景对象（如环境几何结构）最有用。
标记为 Convex 的 Mesh Collider 必须少于 255 个三角形。
对于处于物理控制下的对象，基元碰撞体 (Collider)成本较低。
要为对象添加多个碰撞体(Collider)，可创建子游戏对象 (GameObject) 并向每个子游戏对象 (GameObject) 附加碰撞体(Collider)。这样便可以独立处理每个碰撞体(Collider)。
可以在场景视图 (Scene View) 中查看小图示以了解在对象上计算碰撞体(Collider) 的方式。
碰撞体(Collider) 会尽量匹配对象的缩放。如果您具有不均匀缩放（在各个方向上不同的缩放），则只有网格碰撞体(Mesh Collider) 才能完全匹配。
如果需要通过 Transform 移动某个对象，但是希望接收碰撞体(Collider)/触发器 (Trigger) 消息，则必须将刚体 (Rigidbody) 附加到移动的对象。

二、Box Collider

盒碰撞器是一个基本的方形碰撞原型。

2.1 属性

Size 大小
在X、Y、Z三维上的碰撞器尺寸。
Center 中心
碰撞器在对象本地坐标中的位置

可以将箱体碰撞体 (Box Collider) 大小调整为不同形状的矩形棱镜。它十分适用于门、墙壁、平台等。它还可有效地作为布娃娃中的人体躯干或车辆中的车体。

三、Capsule Collider

胶囊碰撞体 (Capsule Collider) 由两个半球体与一个圆柱体相连接而构成。它与胶囊 (Capsule) 基元形状相同。

3.1 属性

Center
碰撞体 (Collider) 在对象局部坐标空间中的位置。
碰撞体 (Collider) 局部坐标宽度的半径。
Height
碰撞体 (Collider) 的总高度。
Direction
对象局部坐标空间中胶囊纵向方向的轴。

可以相互独立地调整胶囊碰撞器 (Capsule Collider) 的半径 (Radius) 和高度 (Height) 。它在角色控制器 (Character Controller) 中使用，适用于柱状物，也可以与其他碰撞器 (Collider) 结合用于异常形状。

四、Wheel Collider

http://docs.manew.com/Components/index.htm

五、高级

5.1 碰撞体组合

在 Unity 中可以进行不同的 Collider 组合。每个游戏都是独一无二的，不同组合可能更适合于不同类型的游戏。

静态碰撞体 (Static Collider)
附加了 Collider，但没有添加 Rigidbody 的 GameObject。这些对象应保持静态，或很少移动。这些十分适用于环境几何结构。它们在与 Rigidbody 碰撞时不会移动。
刚体碰撞体 (Rigidbody Collider)
同时包含 Rigidbody 和 Collider 的 GameObject。完全受物理引擎影响，可以与仅包含 Collider 的 GameObject 碰撞。
运动学刚体碰撞体 (Kinematic Rigidbody Collider)

包含 Collider 、Rigidbody 且标记有“为运动学”(IsKinematic) 的 GameObject。要移动此游戏对象 (GameObject)，请修改其 Transform ，而不是应用力。它们类似于静态碰撞体 (Static Collider)，但是更适合于要经常四处移动碰撞体 (Collider) 的情况。

此对象可以用于通常希望静态碰撞体 (Static Collider) 发送触发器 (Trigger) 事件的情况。因为触发器 (Trigger) 必须附加刚体 (Rigidbody)，所以应添加刚体 (Rigidbody)，然后启用“为运动学”(IsKinematic)。这可防止对象脱离物理影响，并使您可以在需要时接收触发器 (Trigger) 事件。

运动学刚体 (Kinematic Rigidbody) 可以方便地打开和关闭。这适合于在以下情况中创建布娃娃：通常希望角色跟随在动画之后，然后在发生碰撞时（通过爆炸或所选的任何其他事物进行提示）变为布娃娃。发生这种情况时，只需通过脚本将所有运动学刚体 (Kinematic Rigidbody) 转变为普通刚体 (Rigidbody)。

如果让刚体 (Rigidbody) 静止下来以便在一段时间内不移动，它们会“入睡”。即，它们在物理更新过程中不会进行计算，因为它们不会前往任何位置。如果将运动学刚体 (Kinematic Rigidbody) 从休眠的普通刚体 (Rigidbody) 下边移走，则休眠的刚体 (Rigidbody) 将被唤醒并在物理更新中重新准确计算。因此如果您具有许多要四处移动的静态碰撞体 (Static Collider) 并且让不同对象正确落到其上，请使用运动学刚体碰撞体 (Kinematic Rigidbody Collider)。

5.2 碰撞动作矩阵

根据两个碰撞对象的配置，可能发生一些不同动作。下图概述了可以基于附加到其的组件 (Component) 对两个碰撞对象进行的预计。一些组合仅导致两个对象之一受碰撞影响，因此请记住标准规则 - 物理不会应用于未附加刚体 (Rigidbody) 的对象。

参考:

[1].http://docs.manew.com/Components/class-MeshCollider.html
展开全文
• <div><p>Collider is an alternative kind of hull in barotrauma, that is to be put outside submarine in order to prevent some of it's exterior elements from going through rocks and other structures....
• <div><p>I have certain animations that require the collider on an entity to change with each frame. There doesn't seem to be any obvious way to modify an existing collider, as all of my ...
• ## Mesh Collider

千次阅读 2013-09-02 15:15:55
Mesh Collider The Mesh Collider takes a Mesh Asset and builds its Collider based on that mesh. It is far more accurate for collision detection than using primitives for complicated meshes. Mesh Col
Mesh Collider
The Mesh Collider takes a
Mesh Asset and builds its Collider based on that mesh. It is far more accurate for collision detection than using primitives for complicated meshes. Mesh Colliders that are marked as
Convex can collide with other Mesh Colliders.
A Mesh Collider used on level geometry
Properties

Is Trigger
If enabled, this Collider is used for triggering events, and is ignored by the physics engine.
Material
Reference to the
Physics Material that determines how this Collider interacts with others.
Mesh
Reference to the Mesh to use for collisions.
Smooth Sphere Collisions
When this is enabled, collision mesh normals are smoothed. You should enable this on smooth surfaces eg. rolling terrain without hard edges to make sphere rolling smoother.
Convex
If enabled, this Mesh Collider will collide with other Mesh Colliders. Convex Mesh Colliders are limited to 255 triangles.
Details
The Mesh Collider builds its collision representation from the
Mesh attached to the GameObject, and reads the properties of the attached
Transform to set its position and scale correctly.
Collision meshes use backface culling. If an object collides with a mesh that will be backface culled graphically it will also not collide with it physically.
There are some limitations when using the Mesh Collider. Usually, two Mesh Colliders cannot collide with each other. All Mesh Colliders can collide with any primitive Collider. If your mesh is marked as
Convex, then it can collide with other Mesh Colliders.
Colliders work with Rigidbodies to bring physics in Unity to life. Whereas Rigidbodies allow objects to be controlled by physics, Colliders allow objects to collide with each other. Colliders must be added to objects independently of Rigidbodies.
A Collider does not necessarily need a Rigidbody attached, but a Rigidbody
must be attached in order for the object to move as a result of collisions.
When a collision between two Colliders occurs and if at least one of them has a Rigidbody attached,

three
collision
messages are sent out to the objects attached to them. These events can be handled in scripting, and allow you to create unique behaviors with or without making use of the built-in NVIDIA PhysX engine.
Triggers
An alternative way of using Colliders is to mark them as a
Trigger, just check the IsTrigger property checkbox in the Inspector. Triggers are effectively ignored by the physics engine, and have a unique set of

three
trigger
messages that are sent out when a collision with a Trigger occurs. Triggers are useful for triggering other events in your game, like cutscenes, automatic door opening, displaying tutorial messages, etc. Use your imagination!
Be aware that in order for two Triggers to send out trigger events when they collide, one of them must include a Rigidbody as well. For a Trigger to collide with a normal Collider, one of them must have a Rigidbody attached. For a detailed
chart of different types of collisions, see the collision action matrix in the Advanced section below.
Friction and bounciness
Friction, bounciness and softness are defined in the
Physisc Material. The
Standard Assets contain the most common physics materials. To use one of them click on the Physics Material drop-down and select one, eg. Ice. You can also

create your own physics materials and tweak all friction values.
Hints
Mesh Colliders cannot collide with each other unless they are marked as
Convex. Therefore, they are most useful for background objects like environment geometry.Convex Mesh Colliders must be fewer than 255 triangles.
Primitive Colliders are less costly for objects under physics control.When you attach a Mesh Collider to a GameObject, its Mesh property will default to the mesh being rendered. You can change that by assigning a different Mesh.To add multiple Colliders for an object, create child GameObjects and attach a Collider to each one. This allows each Collider to be manipulated independently.You can look at the gizmos in the Scene View to see how the Collider is being calculated on your object.Colliders do their best to match the scale of an object. If you have a non-uniform scale (a scale which is different in each direction), only the Mesh Collider can match completely.If you are moving an object through its Transform component but you want to receive Collision/Trigger messages, you must attach a Rigidbody to the object that is moving.Advanced
Collider combinations
There are numerous different combinations of collisions that can happen in Unity. Each game is unique, and different combinations may work better for different types of games. If you're using physics in your game, it will be very helpful to understand the
different basic Collider types, their common uses, and how they interact with other types of objects.
Static Collider
These are GameObjects that do not have a Rigidbody attached, but
do have a Collider attached. These objects should remain still, or move very little. These work great for your environment geometry. They will not move if a Rigidbody collides with them.
Rigidbody Collider
These GameObjects contain both a Rigidbody and a Collider. They are completely affected by the physics engine through scripted forces and collisions. They might collide with a GameObject that only contains a Collider. These will likely be your primary type
of Collider in games that use physics.
Kinematic Rigidbody Collider
This GameObject contains a Collider and a Rigidbody which is marked
IsKinematic. To move this GameObject, you modify its
Transform Component, rather than applying forces. They're similar to Static Colliders but will work better when you want to move the Collider around frequently. There are some other specialized scenarios for using this GameObject.
This object can be used for circumstances in which you would normally want a Static Collider to send a trigger event. Since a Trigger must have a Rigidbody attached, you should add a Rigidbody, then enable
IsKinematic. This will prevent your Object from moving from physics influence, and allow you to receive trigger events when you want to.
Kinematic Rigidbodies can easily be turned on and off. This is great for creating ragdolls, when you normally want a character to follow an animation, then turn into a ragdoll when a collision occurs, prompted by an explosion or anything else
you choose. When this happens, simply turn all your Kinematic Rigidbodies into normal Rigidbodies through scripting.
If you have Rigidbodies come to rest so they are not moving for some time, they will "fall asleep". That is, they will not be calculated during the physics update since they are not going anywhere. If you move a Kinematic Rigidbody out from
underneath normal Rigidbodies that are at rest on top of it, the sleeping Rigidbodies will "wake up" and be correctly calculated again in the physics update. So if you have a lot of Static Colliders that you want to move around and have different object fall
on them correctly, use Kinematic Rigidbody Colliders.
Collision action matrix
Depending on the configurations of the two colliding Objects, a number of different actions can occur. The chart below outlines what you can expect from two colliding Objects, based on the components that are attached to them. Some of the combinations only
cause one of the two Objects to be affected by the collision, so keep the standard rule in mind - physics will not be applied to objects that do not have Rigidbodies attached.
Collision detection occurs and messages are sent upon collision

Static Collider
Rigidbody Collider
Kinematic
Rigidbody Collider
Static
Trigger Collider
Rigidbody
Trigger Collider
Kinematic Rigidbody
Trigger Collider
Static Collider

Y

Rigidbody Collider
Y
Y
Y

Kinematic Rigidbody Collider

Y

Static Trigger Collider

Rigidbody Trigger Collider

Kinematic Rigidbody Trigger Collider

Trigger messages are sent upon collision

Static Collider
Rigidbody Collider
Kinematic
Rigidbody Collider
Static
Trigger Collider
Rigidbody
Trigger Collider
Kinematic Rigidbody
Trigger Collider
Static Collider

Y
Y
Rigidbody Collider

Y
Y
Y
Kinematic Rigidbody Collider

Y
Y
Y
Static Trigger Collider

Y
Y

Y
Y
Rigidbody Trigger Collider
Y
Y
Y
Y
Y
Y
Kinematic Rigidbody Trigger Collider
Y
Y
Y
Y
Y
Y
Layer-Based Collision Detection
In Unity 3.x we introduce something called Layer-Based Collision Detection, and you can now selectively tell Unity GameObjects to collide with specific layers they are attached to. For more information click

here

展开全文
• Collider组件的主要功能是来进行碰撞检测; Rigibody: 刚体; Collider: 碰撞器; 对于同一个物体,要么通过刚体来操纵,那么通过变换(transform)操纵,不能同时使用刚体和变换来操纵! 碰撞发生的条件: ①.发生碰撞...
• <p>The problem is, as stated in the title, that i fall through my mesh using a mesh collider and having the bsp tree script attached. The TempCast layer is there as well. If i drop a sphere collider ...
• Unity3D中使用mesh collider和box collider的区别 踩坑过程记录。 设备是HTC的VIVE 和 Unity 5.x CPU: Intel Xeon Silver 4116 * 2 GPU: NVIDIA Quadro P6000 RAM: 64GB 这个问题是在解决项目卡顿问题的...
• unity自带组件TrailRenderer不带Collider，如果想实现碰撞触发功能怎么实现呢 在拖尾移动时生成小球，用小球colliderr当做触发器，动态计算小球的存在时间，超时后销毁 记录小球生成时间 Point.cs记录小球生成...
• The Technie Collider Creator lets you quickly create accurate colliders for the most awkwardly shaped objects. Simple, Intuitive Workflow Just select your object and start painting what you want ...
• I am facing issue to install collider on ubuntu, <p>root:~# go get collidermain package collidermain: unrecognized import path "collidermain" (import path does not begin with hostname) <p>It ...
• ## WheelCollider笔记

千次阅读 2019-01-30 11:49:02
The Wheel Collider is a special collider for grounded vehicles. It has built-in collision detection, wheel physics, and a slip-based tire friction model. It can be used for objects other than wheels,....
• <div><p>I use GetComponentInParent so composed collider will work with colliders in child GameObjects.</p><p>该提问来源于开源项目：JScott/ViveGrip</p></div>
• <div><p>Bug happens when I add a new blocker at ExampleScene.... It seems circle collider doesnt work correct. Unity 2018.1.3.</p><p>该提问来源于开源项目：SnpM/LockstepFramework</p></div>
• 在做项目的时候碰到了要给ugui相关组件添加collider的情况（别问我为什么这样，岛国级别的机密），在以前使用ngui的时候我们知道，ui都有相应的boxcollider2d,而且能实现自适应，那么我们在给ugui相关添加collider的...
• 被拖动物体mesh 设为convex，is trigger为...void OnTriggerEnter(Collider collider){ if(collider.gameObject.layer==LayerMask.NameToLayer("Obstacles")) Debug.Log("Error,a obstacle!"); Renderer rd= gameObject
• 碰撞体勾选了Is Trigger 使用contactFilter2D的默认初始化字段，无效 var contactFilter2D = ...PolygonCollider2D attackBox = GetComponentInChildren<PolygonCollider2D>(); Collider2D[] polygonCollide...
• Launch of Collidertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere will be a launch of a new, powerful and unusual collider very soon, whi.....
• I have a weird behavior with the collider generated by unity. It seems that my character's rigidbody is going through some of the polygons. I've noticed that the composite collider generated ...
• NGUI的BoxCollider与PolygonCollider2D共存的修改

...