コード例 #1
0
    // 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);
        }
    }
コード例 #2
0
 public PlaneAnchor(ARPlaneAnchor anchor, GameObject planeObject)
 {
     this.anchor        = anchor;
     this.planeObject   = planeObject;
     _planeMeshRenderer = planeObject.GetComponentInChildren <MeshRenderer>();
     UnityARUtility.UpdatePlaneWithAnchorTransform(planeObject, anchor);
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
 public void UpdateAnchor(ARPlaneAnchor anchor)
 {
     this.anchor = anchor;
     UnityARUtility.UpdatePlaneWithAnchorTransform(planeObject, anchor);
 }