// invoked by AnchorUpdated-event private void PlaneAnchorUpdated(ARPlaneAnchor arPlaneAnchor) { string surfId = arPlaneAnchor.identifier; // update plane anchor if (planeAnchorDict.ContainsKey(surfId)) { ARPlaneAnchorGameObject arpag = planeAnchorDict[surfId]; arpag.planeAnchor = arPlaneAnchor; if (arpag.gameObject) { UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor); } planeAnchorDict[surfId] = arpag; trackedPlanesTimestamp = GetLastFrameTimestamp(); } // update overlay surface MultiARInterop.MultiARData arData = arManager.GetARData(); if (arData.dictOverlaySurfaces.ContainsKey(surfId)) { UpdateOverlaySurface(arData.dictOverlaySurfaces[surfId], arPlaneAnchor); } }
public PlaneAnchor(ARPlaneAnchor anchor, GameObject planeObject) { this.anchor = anchor; this.planeObject = planeObject; _planeMeshRenderer = planeObject.GetComponentInChildren <MeshRenderer>(); UnityARUtility.UpdatePlaneWithAnchorTransform(planeObject, anchor); }
public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor) { if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier)) { ARPlaneAnchorGameObject arpag = planeAnchorMap[arPlaneAnchor.identifier]; UnityARUtility.UpdatePlaneWithAnchorTransform(arpag.gameObject, arPlaneAnchor); arpag.planeAnchor = arPlaneAnchor; planeAnchorMap[arPlaneAnchor.identifier] = arpag; } }
public void UpdateAnchor(ARPlaneAnchor anchor) { this.anchor = anchor; UnityARUtility.UpdatePlaneWithAnchorTransform(planeObject, anchor); }