生成飞机上的ARCore对撞机 [英] ARCore collider on generated planes

查看:126
本文介绍了生成飞机上的ARCore对撞机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在玩AR核心,想让一个物体在房间里飞来飞去并能够着陆.我不确定如何根据房间的视觉效果将碰撞器添加到ARcore生成的飞机上.这会涉及以某种方式实例化飞机上的撞机盒吗?

I'm just playing around with AR core and want to have an object flying around the room and able to land. I'm unsure about how to add colliders to the planes that ARcore is generating based on the visuals on the room. Would this involve instantiating box colliders on the planes somehow?

推荐答案

ARCore SDK的可跟踪平面实质上是标识为平坦的表面,例如地面或桌面.

The ARCore SDK's trackable planes are essentially identified flat surfaces such as the ground or a tabletop.

您可以向SDK请求每个可跟踪平面的边界多边形的点列表(按顺时针顺序进行检索),然后通过三角测量从这些点创建网格.准备好网格物体后,创建一个GameObject并添加引用它的MeshCollider组件.

You can ask the SDK for a list of points for each trackable plane's boundary polygon (retrieved in clockwise order) and create a mesh from those points via triangulation. With the mesh ready, create a GameObject and add a MeshCollider component that references it.

我已经创建了一个免费的Unity插件来执行此操作.随时使用它: https://github.com/jonas-johansson/ARCoreUtils .

I've created a free Unity plugin that does exactly this. Feel free to use it: https://github.com/jonas-johansson/ARCoreUtils.

希望对您有帮助!

这篇关于生成飞机上的ARCore对撞机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆