惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Last Watchdog
The Last Watchdog
AI
AI
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
J
Java Code Geeks
TaoSecurity Blog
TaoSecurity Blog
L
LangChain Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Microsoft Security Blog
Microsoft Security Blog
量子位
T
Threatpost
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - Franky
博客园 - 聂微东
L
LINUX DO - 最新话题
Security Archives - TechRepublic
Security Archives - TechRepublic
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
C
Check Point Blog
宝玉的分享
宝玉的分享
G
Google Developers Blog
Spread Privacy
Spread Privacy
Cloudbric
Cloudbric
SecWiki News
SecWiki News
有赞技术团队
有赞技术团队
www.infosecurity-magazine.com
www.infosecurity-magazine.com
W
WeLiveSecurity
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
V
Vulnerabilities – Threatpost
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
P
Privacy & Cybersecurity Law Blog
P
Palo Alto Networks Blog
H
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
About on SuperTechFans
N
Netflix TechBlog - Medium
罗磊的独立博客
月光博客
月光博客

博客园 - Stanley.Luo

CentOS 7+nginx+PHP+php-fpm Linux 的系统目录介绍 C++与Java,C#的异同(一):值,地址,引用 Loom工具类:Unity3D巧妙处理多线程 3Dmax 创建物体 3DMax 物体选择方法 3DMax 常用快捷键 HTC Vive 与Leap Motion 出现位置错误的问题 Groovy与Gradle在Android中的应用 VR的UI、UX设计原则 Mecanim动画模型规范 Mecanim动画系统 制作流程 HTC Vive 体验的折腾经历 OpenGLES 2.0 可编程渲染管线 【VR视频播放】解决Unity模型贴图反转的问题 Lua语言的特别之处 Unity3D 的摄像机 iptables 的使用 CentOS安装Nginx
为什么带网格(mesh)的模型添加了刚体Rigidbody和MeshCollider,还是会从地板穿过去?
Stanley.Luo · 2016-07-17 · via 博客园 - Stanley.Luo

 两个Gameobject 放置在空中, 一个是Cube,一个是茄子模型

Cube的Collider 是Box Collider , 茄汁的Collider 是mesh collider, 他们都添加了刚体(RigidBody)组件, 勾选了重力Gravity

但是, 运行的结果是:

正方块Cube下落, 掉到地面上停了下来

茄子下落,没有停下来, 穿透了地面,一直往下掉。

百事不得其解。。。

终于还是在官方文档中看到这段话:

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.

使用网格碰撞器有一些限制条件。通常,两个网格碰撞器之间不会发生碰撞。所有的网格碰撞器可以和任何原型碰撞器碰撞。如果网格标记为凸起的(Convex),那么就可以和其他网格碰撞器碰撞。

试了一下, 把茄子Mesh Collider的Convex 勾上,

 

OK了, 停下来了!

还有一下注意事项:

http://www.ceeger.com/Components/class-MeshCollider.html

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),否则网格碰撞器间不会发生碰撞。因此,它们最常被用于背景对象比如环境布景。
    • Convex Mesh Colliders must be fewer than 255 triangles. 
      凸起的网格碰撞器含有的三角形面不能多于255个。
    • 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. 
      可以通过场景视图(Scene View )中的线框(gizmos)来查看碰撞器在你的对象上的预期效果。
    • 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. 
      如果你想接收通过Transform组件移动的对象的碰撞/触发信息,你必须给移动对象附件刚体。