Exemplo n.º 1
0
 void EnvironmentProbeAnchorUpdated(AREnvironmentProbeAnchor anchorData)
 {
     if (probeAnchorMap.ContainsKey(anchorData.identifier))
     {
         probeAnchorMap [anchorData.identifier].UpdateEnvironmentProbe(anchorData);
     }
 }
Exemplo n.º 2
0
		public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
		{
			if (planeAnchorMap.ContainsKey (arPlaneAnchor.identifier)) {
				ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
				GameObject.Destroy (arpag.gameObject);
				planeAnchorMap.Remove (arPlaneAnchor.identifier);
			}
		}
Exemplo n.º 3
0
 public Transform GetGroundPlane(string groundPlaneIdentifier)
 {
     if (planeAnchorMap.ContainsKey(groundPlaneIdentifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap[groundPlaneIdentifier];
         return(arpag.gameObject.transform);
     }
     return(null);
 }
Exemplo n.º 4
0
 void ObjectAnchorUpdated(ARObjectAnchor anchorData)
 {
     Debug.Log("ObjectAnchorUpdated");
     if (objectAnchorMap.ContainsKey(anchorData.referenceObjectName))
     {
         GameObject go = objectAnchorMap [anchorData.referenceObjectName];
         //do coordinate conversion from ARKit to Unity
         go.transform.position = UnityARMatrixOps.GetPosition(anchorData.transform);
         go.transform.rotation = UnityARMatrixOps.GetRotation(anchorData.transform);
     }
 }
Exemplo n.º 5
0
 public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     if (!planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         GameObject go = UnityARUtility.CreatePlaneInScene(arPlaneAnchor);
         go.AddComponent <DontDestroyOnLoad>();  //this is so these GOs persist across scene loads
         ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();
         arpag.planeAnchor = arPlaneAnchor;
         arpag.gameObject  = go;
         planeAnchorMap.Add(arPlaneAnchor.identifier, arpag);
     }
 }