/// <summary> /// Handles the MeshReady event, which tracks and assigns the correct mesh renderer materials. /// </summary> /// <param name="meshId">Id of the mesh that got added / upated.</param> private void HandleOnMeshReady(UnityEngine.XR.MeshId meshId) { if (_mlSpatialMapper.meshIdToGameObjectMap.ContainsKey(meshId)) { UpdateRenderer(_mlSpatialMapper.meshIdToGameObjectMap[meshId].GetComponent <MeshRenderer>()); } }
public bool Remove(LegacyMeshId meshId) { // It is relatively rare to remove an existing mesh // (this means it was removed while awaiting generation). // So it most cases we should be able to early out. if (!m_MeshSet.Remove(meshId)) { return(false); } // Otherwise, perform a linear search and remove it. for (int i = 0; i < m_Queue.Count; ++i) { if (m_Queue[i].MeshId.Equals(meshId)) { m_Queue.RemoveAt(i); break; } } return(true); }
private void OnMeshAddedListener(UnityEngine.XR.MeshId obj) { OnMeshAddedOrUpdated(); }
internal static unsafe TrackableId GetTrackableId(LegacyMeshId trackableId) { return(*(TrackableId *)&trackableId); }