/// <summary>
 /// Unity Monobehavior function. ARUWPController, holoLensCamera are set here. Magic function
 /// is initialized. [internal use]
 /// </summary>
 private void Start()
 {
     controller = GetComponent <ARUWPController>();
     if (controller == null)
     {
         Debug.Log(TAG + ": not able to find ARUWPController");
         Application.Quit();
     }
     holoLensCamera = GameObject.Find("Main Camera");
     if (holoLensCamera == null)
     {
         Debug.Log(TAG + ": Main Camera does not exist in the scene");
         Application.Quit();
     }
     else
     {
         if (!anchoredToWorld)
         {
             target.transform.SetParent(holoLensCamera.transform);
         }
         else
         {
             dummyGameObject = new GameObject("Dummy");
             dummyGameObject.transform.SetParent(holoLensCamera.transform);
         }
     }
     // magic function initialization
     InitMagicFunction();
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     appStatus     = AppState.instance;
     markerTracker = GameObject.Find("ARToolKit").GetComponent <ARUWPController>();
     isTracking    = false;
     EventManager.OnStateChange += OnStateChange;
 }
示例#3
0
    /// <summary>
    /// Unity Monobehavior function. ARUWPController, holoLensCamera are set here. Magic function
    /// is initialized. [internal use]
    /// </summary>
    private void Start()
    {
        controller = GetComponent <ARUWPController>();
        if (controller == null)
        {
            Debug.Log(TAG + ": not able to find ARUWPController");
            Application.Quit();
        }
        holoLensCamera = GameObject.FindWithTag("MainCamera");
        if (holoLensCamera == null)
        {
            Debug.Log(TAG + ": Main Camera does not exist in the scene");
            Application.Quit();
        }

        else
        {
            if (!anchoredToWorld)
            {
                target.transform.SetParent(holoLensCamera.transform);
            }
            else
            {
                // Create dummy object with unique object ID for different markers
                dummyGameObject = new GameObject("Dummy" + GetInstanceID());
                dummyGameObject.transform.SetParent(controller.LocatableCameraRoot.transform);
            }
        }
        // magic function initialization
        InitMagicFunction();
    }
示例#4
0
        private void Start()
        {
            TopLeft      = transform.Find("TopLeft");
            TopLeftText  = TopLeft.GetComponentInChildren <Text>();
            TopLeftOther = TopLeft.Find("Other");

            TopRight      = transform.Find("TopRight");
            TopRightText  = TopRight.GetComponentInChildren <Text>();
            TopRightOther = TopRight.Find("Other");

            BottomLeft      = transform.Find("BottomLeft");
            BottomLeftText  = BottomLeft.GetComponentInChildren <Text>();
            BottomLeftOther = BottomLeft.Find("Other");

            BottomRight      = transform.Find("BottomRight");
            BottomRightText  = BottomRight.GetComponentInChildren <Text>();
            BottomRightOther = BottomRight.Find("Other");

            WebRTCConn           = ConnectionManager.Instance["WebRTC"] as WebRTCConnection;
            UltrasoundController = GameObject.Find("UltrasoundTracker").GetComponentInChildren <ARUWPController>();

            Configurations.Instance.SetAndAddCallback("Billboard_StatusDebugMode", true, v =>
            {
                Mode = v ? Modes.DEBUG : Mode = Modes.RUN;
                Clear();
            }, Configurations.CallNow.YES, Configurations.RunOnMainThead.YES);
            Configurations.Instance.AddCallback("*_PrepareUI", () => Configurations.Instance.Set("Billboard_StatusDebugMode", false));
        }
示例#5
0
 /// <summary>
 /// Unity Monobehavior function. ARUWPController is set here. Video preview is
 /// initialized depending on the initial value. [internal use]
 /// </summary>
 private void Start()
 {
     controller = GetComponent <ARUWPController>();
     if (controller == null)
     {
         Debug.Log(TAG + ": not able to find ARUWPController");
         Application.Quit();
     }
     mediaMaterial = previewPlane.GetComponent <MeshRenderer>().material;
     if (videoPreview)
     {
         EnablePreview();
     }
 }
 /// <summary>
 /// Unity Monobehavior function. ARUWPController, holoLensCamera are set here. Magic function
 /// is initialized. [internal use]
 /// </summary>
 private void Start()
 {
     controller = GetComponent <ARUWPController>();
     if (controller == null)
     {
         Debug.Log(TAG + ": not able to find ARUWPController");
         Application.Quit();
     }
     holoLensCamera = GameObject.Find("Main Camera");
     if (holoLensCamera == null)
     {
         Debug.Log(TAG + ": Main Camera does not exist in the scene");
         Application.Quit();
     }
 }
示例#7
0
 /// <summary>
 /// Unity Monobehavior function. ARUWPController is set here. Video preview is
 /// initialized depending on the initial value. [internal use]
 /// </summary>
 private void Start()
 {
     controller = GetComponent <ARUWPController>();
     if (controller == null)
     {
         Debug.Log(TAG + ": not able to find ARUWPController");
         Application.Quit();
     }
     Debug.Log("arcontroller init!");
     Debug.Log("cannot find previewPlane?");
     // mediaMaterial = previewPlane.GetComponent<MeshRenderer>().material;
     if (videoPreview)
     {
         videoPreview = false;
         // EnablePreview();
     }
 }
示例#8
0
    // Use this for initialization
    void Start()
    {
        // General attributes.
        _controller = GameObject.Find("ARUWP Controller").GetComponent <ARUWPController>();
        if (_controller == null)
        {
            Debug.LogError("Page Organizer: not able to find ARUWPController");
            Application.Quit();
        }

        TitlePage = TitleRootObj.GetComponent <TitlePageHelper>();
        RefPage   = RefRootObj.GetComponent <RefPageHelper>();
        NotePage  = NoteRootObj.GetComponent <NoteboardPageHelper>();

        //RefPage.Init();

        LoadDocuments();
    }
示例#9
0
    /// <summary>
    /// Unity Monobehavior function. ARUWPController, holoLensCamera are set here. Magic function
    /// is initialized. [internal use]
    /// </summary>
    private void Start()
    {
        controller = GetComponent <ARUWPController>();
        if (controller == null)
        {
            Debug.Log(TAG + ": not able to find ARUWPController");
            Application.Quit();
        }
        holoLensCamera = GameObject.Find("Main Camera");
        if (holoLensCamera == null)
        {
            Debug.Log(TAG + ": Main Camera does not exist in the scene");
            Application.Quit();
        }
        else
        {
            if (!anchoredToWorld)
            {
                target.transform.SetParent(holoLensCamera.transform);
            }
            else
            {
                dummyGameObject = new GameObject("Dummy");
                dummyGameObject.transform.SetParent(holoLensCamera.transform);
            }
        }
        // magic function initialization
        InitMagicFunction();

        newMagic = new Matrix4x4();
        //newMagic.SetRow(0, new Vector4(0.999972879f, 0.000176912139f, -0.00736267928f, 0.00658362f));
        //newMagic.SetRow(1, new Vector4(-0.000439020097f, 0.999365554f, -0.0356131623f, 0.00799979f));
        //newMagic.SetRow(2, new Vector4(0.00735170766f, 0.0356154288f, 0.999338528f, 0.08833091f));
        //newMagic.SetRow(0, new Vector4(0.99974642f, 0.02218566f, 0.00385788f, -0.00139779f));
        //newMagic.SetRow(1, new Vector4(-0.02217924f, 0.99975257f, -0.00169947f, -0.06953911f));
        //newMagic.SetRow(2, new Vector4(-0.00389463f, 0.00161348f, 0.99999111f, 0.09567877f));
        //newMagic.SetRow(0, new Vector4(0.99872606f, 0.04763961f, -0.01663533f, 0.01976294f));
        //newMagic.SetRow(1, new Vector4(-0.04734586f, 0.99872302f, 0.01762694f, -0.05851201f));
        //newMagic.SetRow(2, new Vector4(0.01745383f, -0.01681687f, 0.99970624f, 0.07213841f));
        newMagic.SetRow(0, new Vector4(0.9961701432885934f, 0.006203455949148472f, -0.08721561072807232f, 0.03310584377482318f));
        newMagic.SetRow(1, new Vector4(-0.004820931280959215f, 0.9998595118592803f, 0.016053509463849563f, 0.029540706678990523f));
        newMagic.SetRow(2, new Vector4(0.08730294520786765f, -0.015571566356940875f, 0.9960600996321575f, 0.09160812771880955f));
        newMagic.SetRow(3, new Vector4(0, 0, 0, 0));
    }
示例#10
0
    /// <summary>
    /// Unity Monobehavior function. ARUWPController is set here. Video preview is
    /// initialized depending on the initial value. [internal use]
    /// </summary>
    private void Start()
    {
        // Fetch a pointer to Unity's spatial coordinate system
        WorldOriginPtr = WorldManager.GetNativeISpatialCoordinateSystemPtr();

        controller = GetComponent <ARUWPController>();
        if (controller == null)
        {
            Debug.Log(TAG + ": not able to find ARUWPController");
            Application.Quit();
        }
        if (videoPreview)
        {
            if (previewPlane != null)
            {
                mediaMaterial = previewPlane.GetComponent <MeshRenderer>().material;
                EnablePreview();
            }
            else
            {
                videoPreview = false;
            }
        }
    }