重写 onTrackingEvent获取TrackingValues集合,然后通过TrackingValues的state属性的isTrackingState()方法判断是否为追踪状态,或者直接使用state状态来判断。
state状态枚举:
public enum TrackingState { Unknown = 0, NotTracking = 1, Tracking = 2, Lost = 3, Found = 4, Extrapolated = 5, Initialized = 6, Registered = 7, InitializationFailed = 8 }
判断追踪状态代码:
using UnityEngine; using System.Collections; using metaio; using System.Collections.Generic; public class QRCodeReader : metaioCallback { override protected void onTrackingEvent(List<TrackingValues> trackingValues) { foreach (TrackingValues tv in trackingValues) { Debug.Log(tv.state); //istrackingstate trackingvalues if (tv.state.isTrackingState()) {
// } } } }
Metaio制作.3dmap环境识别的点云文件:http://blog.csdn.net/foximage/article/details/9671387