Beispiel #1
0
 public void AnchorRemoved(ARUserAnchor anchor)
 {
     if (anchor.identifier.Equals(m_AnchorId))
     {
         Destroy(this.gameObject);
     }
 }
 static void _user_anchor_removed(UnityARUserAnchorData anchor)
 {
     if (ARUserAnchorRemovedEvent != null)
     {
         ARUserAnchor arUserAnchor = GetUserAnchorFromAnchorData(anchor);
         ARUserAnchorRemovedEvent(arUserAnchor);
     }
 }
Beispiel #3
0
 public void AnchorRemoved(ARUserAnchor anchor)
 {
     if (anchor.identifier.Equals(m_AnchorId))
     {
         Destroy(this.gameObject);
     }
     Debug.Log("STE ~~~~~~~~~ ARAnchor Destroyed");
 }
Beispiel #4
0
 private static void _user_anchor_removed(UnityARUserAnchorData anchor)
 {
     if (UnityARSessionNativeInterface.ARUserAnchorRemovedEvent != null)
     {
         ARUserAnchor userAnchorFromAnchorData = GetUserAnchorFromAnchorData(anchor);
         UnityARSessionNativeInterface.ARUserAnchorRemovedEvent(userAnchorFromAnchorData);
     }
 }
Beispiel #5
0
        private void GameObjectAnchorUpdated(ARUserAnchor anchor)
        {
            if (anchor.identifier.Equals(m_AnchorId))
            {
                transform.position = UnityARMatrixOps.GetPosition(anchor.transform);
                transform.rotation = UnityARMatrixOps.GetRotation(anchor.transform);

                Debug.Log("Updated: pos = " + transform.position + m_AnchorId);
            }
        }
Beispiel #6
0
        private static ARUserAnchor GetUserAnchorFromAnchorData(UnityARUserAnchorData anchor)
        {
            ARUserAnchor result = default(ARUserAnchor);

            result.identifier = Marshal.PtrToStringAuto(anchor.ptrIdentifier);
            Matrix4x4 transform = default(Matrix4x4);

            transform.SetColumn(0, anchor.transform.column0);
            transform.SetColumn(1, anchor.transform.column1);
            transform.SetColumn(2, anchor.transform.column2);
            transform.SetColumn(3, anchor.transform.column3);
            result.transform = transform;
            return(result);
        }
Beispiel #7
0
        static ARUserAnchor GetUserAnchorFromAnchorData(UnityARUserAnchorData anchor)
        {
            //get the identifier for this anchor from the pointer
            ARUserAnchor arUserAnchor = new ARUserAnchor();

            arUserAnchor.identifier = Marshal.PtrToStringAuto(anchor.ptrIdentifier);
            Matrix4x4 matrix = new Matrix4x4();

            matrix.SetColumn(0, anchor.transform.column0);
            matrix.SetColumn(1, anchor.transform.column1);
            matrix.SetColumn(2, anchor.transform.column2);
            matrix.SetColumn(3, anchor.transform.column3);
            arUserAnchor.transform = matrix;
            return(arUserAnchor);
        }
        static ARUserAnchor GetUserAnchorFromAnchorData(UnityARUserAnchorData anchor)
        {
            #if PLATOFORM_IOS
            //get the identifier for this anchor from the pointer
            ARUserAnchor arUserAnchor = new ARUserAnchor();
            arUserAnchor.identifier = Marshal.PtrToStringAuto(anchor.ptrIdentifier);

            Matrix4x4 matrix = new Matrix4x4();
            matrix.SetColumn(0, anchor.transform.column0);
            matrix.SetColumn(1, anchor.transform.column1);
            matrix.SetColumn(2, anchor.transform.column2);
            matrix.SetColumn(3, anchor.transform.column3);

            arUserAnchor.transform = matrix;
            return(arUserAnchor);
            #else
            Debug.LogError("Not available on non iOS platform");
            return(new ARUserAnchor());
            #endif
        }
Beispiel #9
0
 private void GameObjectAnchorUpdated(ARUserAnchor anchor)
 {
 }
Beispiel #10
0
 public void AnchorAdded(ARUserAnchor anchor)
 {
     Debug.LogFormat("STE ~~~~~~~~~ ARAnchor Added: {0}", anchor.transform.ToString());
 }