Ejemplo n.º 1
0
    public void Start()
    {
        scaleMultiplier  = 1 / MiraArController.scaleMultiplier;
        rotationalOffset = Quaternion.Euler(-30, 0, 0);
        // positionalOffset = new Vector3(-5.2f, -0.93599f, -5.0f) * scaleMultiplier;
        positionalOffset = new Vector3(-6.006f, -2.846f, -3.689f) * scaleMultiplier;

        if (MiraArController.Instance.isSpectator == false)
        {
            Debug.Log("Using front facing camera");
            Vector2 exposurepoint = new Vector2(0.15f, 0.2f);
            ArCam.ExposeAtPointOfInterest(exposurepoint, CaptureExposureMode.ContinuousAutoExpose);
            ArCam.DevicePosition = CaptureDevicePosition.Front;
        }
        else
        {
            Camera specCam = gameObject.AddComponent <Camera> ();
            specCam.nearClipPlane = MiraArController.Instance.nearClipPlane * (1 / MiraArController.Instance.setScaleMultiplier);
            ArCam.DevicePosition  = CaptureDevicePosition.Back;
            //ArCam.EnableCameraRendering = true;
            positionalOffset = Vector3.zero;
            rotationalOffset = Quaternion.identity;
            ArCam.enabled    = true;

            imageTracker.AutoToggleVisibility = true;
        }

        SanityCheck();
    }
Ejemplo n.º 2
0
 private void Update()
 {
     if (Input.GetMouseButtonUp(0))
     {
         // This works for landscape right orientation
         // See exposurePointOfInterest documentation for more information
         Vector2 exposePosition = new Vector2(Input.mousePosition.x / Screen.width, Input.mousePosition.y / Screen.height);
         WikiCamera.ExposeAtPointOfInterest(exposePosition, CaptureExposureMode.ContinuousAutoExpose);
     }
 }
    public void OnBackgroundClicked()
    {
        var position = Input.mousePosition;

        FocusPoint.SetActive(true);
        FocusPoint.GetComponent <RectTransform>().position = position;

        Camera.ExposeAtPointOfInterest(position, CaptureExposureMode.ContinuousAutoExpose);
        Camera.FocusAtPointOfInterest(position);
    }
    void Awake()
    {
        // Initialize Wikitude Camera as Front Facing
        ArCam = GetComponent <WikitudeCamera>();
        ArCam.DevicePosition = CaptureDevicePosition.Front;
        Debug.Log("Using front facing camera");
        Vector2 exposurepoint = new Vector2(0.15f, 0.2f);

        ArCam.ExposeAtPointOfInterest(exposurepoint, CaptureExposureMode.ContinuousAutoExpose);
                #if UNITY_IOS
        MiraiOSBridge.ForceBrightness();
                #endif

        Screen.orientation = ScreenOrientation.LandscapeLeft;
    }
Ejemplo n.º 5
0
    public void OnBackgroundClicked()
    {
        /* The background is a UI component that covers the entire screen and is triggered when no other control was pressed.
         * It is used to trigger focus and expose at point of interest commands.
         */

        /* When checking if a certain camera feature is supported, the SDK will report an error if it is not, indicating the reason.
         * Since we are not interested in the reason, we temporarily suppress error handling until the end of the method.
         */
        _suppressErrors = true;
        bool isFocusAtPointOfInterestSupported  = Camera.IsFocusAtPointOfInterestSupported;
        bool isExposeAtPointOfInterestSupported = Camera.IsExposeAtPointOfInterstSupported;

        if (isFocusAtPointOfInterestSupported || isExposeAtPointOfInterestSupported)
        {
            var position = Input.mousePosition;
            FocusPoint.SetActive(true);
            FocusPoint.GetComponent <RectTransform>().position = position;

            if (Camera.IsFocusAtPointOfInterestSupported)
            {
                Camera.FocusAtPointOfInterest(position);
            }

            if (isExposeAtPointOfInterestSupported)
            {
                Camera.ExposeAtPointOfInterest(position, CaptureExposureMode.ContinuousAutoExpose);
            }
        }
        else
        {
            FocusPoint.SetActive(false);
        }

        StartCoroutine(EnableErrors());
    }