有没有一种方法可以找到两个盒子对撞机之间的相交体积?

时间:2019-01-16 17:44:03

标签: c# unity3d

我正在使用统一3d进行项目,需要计算场景中对象的盒子碰撞器之间的交点量。盒子对撞机类似乎没有任何功能可以做到这一点。 有什么帮助吗?

1 个答案:

答案 0 :(得分:0)

您要使用d:\100-Blog\xiang>hexo deploy g INFO Start processing INFO Files loaded in 725 ms INFO Generated: index.html INFO Generated: archives/index.html INFO Generated: fancybox/blank.gif INFO Generated: fancybox/jquery.fancybox.css INFO Generated: fancybox/fancybox_loading.gif INFO Generated: fancybox/fancybox_loading@2x.gif INFO Generated: fancybox/fancybox_overlay.png INFO Generated: fancybox/fancybox_sprite@2x.png INFO Generated: archives/2019/01/index.html INFO Generated: fancybox/fancybox_sprite.png INFO Generated: archives/2019/index.html INFO Generated: css/fonts/FontAwesome.otf INFO Generated: js/script.js INFO Generated: fancybox/helpers/jquery.fancybox-buttons.css INFO Generated: fancybox/jquery.fancybox.pack.js INFO Generated: fancybox/helpers/jquery.fancybox-media.js INFO Generated: css/style.css INFO Generated: fancybox/helpers/jquery.fancybox-buttons.js INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.css INFO Generated: css/fonts/fontawesome-webfont.eot INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.js INFO Generated: fancybox/helpers/fancybox_buttons.png INFO Generated: css/fonts/fontawesome-webfont.woff INFO Generated: css/fonts/fontawesome-webfont.ttf INFO Generated: css/fonts/fontawesome-webfont.svg INFO Generated: 2019/01/16/hello-world/index.html INFO Generated: css/images/banner.jpg INFO Generated: fancybox/jquery.fancybox.js INFO 28 files generated in 1.96 s 除了它们只是相交之外,它还可以用来确定更多的东西,但是如果仅此而已,它就可以很好地完成工作。

https://docs.unity3d.com/ScriptReference/Physics.ComputePenetration.html

为其提供正确的参数,如果对撞机重叠,它将返回true。

示例:

Physics.ComputePenetration()