ARCore collider on generated planes

后端 未结 3 1822
醉酒成梦
醉酒成梦 2020-12-18 08:07

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

3条回答
  •  余生分开走
    2020-12-18 08:42

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

    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.

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

    I hope that helps!

提交回复
热议问题