Exemplo n.º 1
0
 void OnTriggerEnter(Collider col)
 {
     Debug.Log("scanning0");
     if (col.gameObject == Camera.main.gameObject)
     {
         menu.callSetText(4);
     }
 }
    /***********Tracking State **************/

    public void callStartUp(int num)
    {
        Debug.Log("debugging startup" + num);
        Debug.Log("00-debug-00 --- UnityARCamManger - 009");
        // yield return new WaitForSeconds(0);

        if (num == 0)
        {
            // Debug.Log("debugging tracking is true");
            // planeDetection = UnityARPlaneDetection.Horizontal;
            Debug.Log("debugging planes are horizontal");

            // GameObject tempconfig = GameObject.Find("ARKitWorldTrackingRemoteConnection");
            // Destroy(GameObject.Find("ARKitWorldTrackingRemoteConnection"), 0);

            // Debug.Log("THING SHOULD HAVE DELETED");

            // var config = sessionConfiguration;
            // m_session.RunWithConfig (config);
        }
        else if (num == 1)
        {
            menu.callSetText(2);
            foundHorizontal = true;
            // planeDetection = UnityARPlaneDetection.Vertical;
            Debug.Log("debugging planes are vertical");

            // var config = sessionConfiguration;
            // m_session.RunWithConfig (config);
        }
        else if (num == 2)
        {
            menu.callSetText(3);
            foundVertical = setUpFinished = true;
            // planeDetection = UnityARPlaneDetection.HorizontalAndVertical;
            Debug.Log("debugging see first painting");
            // } else if (num == 3){
            //     seenFirstImage = true;
            //     menu.callSetText(4);
            //     Debug.Log("debugging see second painting");
        }
        // var config = sessionConfiguration;
        // m_session.RunWithConfig (config);
        // StartCoroutine(startUp(num));
    }
Exemplo n.º 3
0
    // void Start() {
    //  cam = Camera.main;
    //  // scanScript = cam.GetComponent<ScannerEffectDemo>();
    //  // church = GameObject.FindGameObjectWithTag("church").GetComponent<churchScript>();
    //  // painting = GameObject.FindGameObjectWithTag("altarpiece").GetComponent<mainPaintingScript>();
    // }

    // void OnTriggerEnter(Collider col) {
    // Debug.Log("scanning0");
    //     if (col.gameObject == Camera.main.gameObject && !scanning) {
    //  StartCoroutine(scanningEvents());
    //  menu.callSetText(7);
    // }
    // }

    public void startScan()
    {
        if (!scanning)
        {
            scanning = true;
            StartCoroutine(scanningEvents());
            menu.callSetText(7);
        }
    }
Exemplo n.º 4
0
 void UpdateImageAnchor(ARImageAnchor arImageAnchor)
 {
     if (arImageAnchor.referenceImageName == referenceImage.imageName)
     {
         church.transform.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
         church.transform.rotation = UnityARMatrixOps.GetRotation(arImageAnchor.transform);
         if (!seen)
         {
             menu.callSetText(3);
             seen = true;
         }
     }
 }
Exemplo n.º 5
0
 // void UpdateImageAnchor(ARImageAnchor arImageAnchor)
 // {
 //  Debug.LogFormat("image anchor updated[{0}] : tracked => {1}", arImageAnchor.identifier, arImageAnchor.isTracked);
 //  if (arImageAnchor.referenceImageName == referenceImage.imageName) {
 //         if (arImageAnchor.isTracked)
 //         {
 //             if (!imageAnchorGO.activeSelf)
 //             {
 //                 imageAnchorGO.SetActive(true);
 //              dbScript.addToString("main image anchor");
 //             }
 //          // ScannerOrigin.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
 //          church.transform.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
 //          church.transform.rotation = UnityARMatrixOps.GetRotation(arImageAnchor.transform);
 //          dbScript.addToString("objectMoved");
 //          menu.callSetText(4);
 //             // imageAnchorGO.transform.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
 //             // imageAnchorGO.transform.rotation = UnityARMatrixOps.GetRotation(arImageAnchor.transform);
 //          // if(!seen){
 //          //  camScript.callStartUp(3);
 //          //  seen = true;
 //          // }
 //         }
 //     }
 // }
 void UpdateImageAnchor(ARImageAnchor arImageAnchor)
 {
     // Debug.Log ("debugging image anchor updated");
     if (arImageAnchor.referenceImageName == referenceImage.imageName)
     {
         // Debug.Log ("debugging moved church again");
         church.transform.position = UnityARMatrixOps.GetPosition(arImageAnchor.transform);
         church.transform.rotation = UnityARMatrixOps.GetRotation(arImageAnchor.transform);
         if (!seen)
         {
             menu.callSetText(4);
             seen = true;
         }
     }
 }
Exemplo n.º 6
0
    // Update is called once per frame
    void Update()
    {
        float      posX = Screen.width / 2f;
        float      posY = Screen.height / 2f;
        Ray        ray  = Camera.main.ScreenPointToRay(new Vector3(posX, posY, Mathf.Infinity));
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 200))
        {
            if (this.gameObject == hit.collider.gameObject == active)
            {
                Debug.Log("You have selected the " + hit.collider.name);
                menu.callSetText(5);
            }
        }
    }
Exemplo n.º 7
0
    void Start()
    {
        menuScript = GameObject.FindGameObjectWithTag("UIcanvas").GetComponent <IMStartMenu>();
        // dbScript = GameObject.Find("debugText").GetComponent<debugLogTextScript>();
        if (!menuScript.foundPlanes)
        {
            menuScript.callSetText(2);
        }

        // if(this.transform.eulerAngles.x < 45 || this.transform.eulerAngles.x > 315 ){
        //     line.material = HCol;
        //     dbScript.addToString("h " + this.transform.eulerAngles);
        //     if(!menuScript.foundH && !menuScript.foundV){
        //         menuScript.callSetText(2);
        //         Debug.Log("debugging PLANE TRACKER calling start up 0");
        //     }
        // }else{
        //     line.material = VCol;
        //     dbScript.addToString("v " + this.transform.eulerAngles);
        //     if(menuScript.foundH && !menuScript.foundV){
        //         menuScript.callSetText(3);
        //         Debug.Log("debugging PLANE TRACKER calling start up 1");
        //     }
        // }


        // if(!menuScript.foundH && !menuScript.foundV){
        //     if(this.transform.eulerAngles.x < 45 || this.transform.eulerAngles.x > 315 ){
        //         line.material = HCol;
        //         dbScript.addToString("h " + this.transform.eulerAngles);
        //         menuScript.callSetText(2);
        //         Debug.Log("debugging PLANE TRACKER calling start up 0");
        //     }
        // }else
        // if(menuScript.foundH && !menuScript.foundV){
        //     menuScript.callSetText(3);
        //     Debug.Log("debugging PLANE TRACKER calling start up 1");
        // }
    }