public void SetPropertyMode(VarjoCameraPropertyType type, VarjoCameraPropertyMode mode)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.SetCameraPropertyMode(type, mode);
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
 public void SetPropertyValue(VarjoCameraPropertyType type, VarjoCameraPropertyValue value)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.SetCameraPropertyValue(type, value);
     UpdateValues();
     VarjoPluginMR.UnlockCameraConfig();
 }
Ejemplo n.º 3
0
 void UpdateVREyeOffSet()
 {
     if (VREyeOffset != currentVREyeOffset)
     {
         VarjoPluginMR.SetVRViewOffset(VREyeOffset);
         currentVREyeOffset = VREyeOffset;
     }
 }
 public void ResetProperty(VarjoCameraPropertyType type)
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.ResetCameraProperty(type);
     UpdateValues();
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
 public void ResetAll()
 {
     VarjoPluginMR.LockCameraConfig();
     VarjoPluginMR.ResetCameraProperties();
     UpdateValues();
     UpdateModes();
     VarjoPluginMR.UnlockCameraConfig();
 }
    VarjoCameraPropertyValue GetPropertyValue(VarjoCameraPropertyType type)
    {
        VarjoCameraPropertyValue value;

        if (VarjoPluginMR.GetCameraPropertyValue(type, out value))
        {
            return(value);
        }
        return(default(VarjoCameraPropertyValue));
    }
    VarjoCameraPropertyMode GetPropertyMode(VarjoCameraPropertyType type)
    {
        VarjoCameraPropertyMode mode;

        if (VarjoPluginMR.GetCameraPropertyMode(type, out mode))
        {
            return(mode);
        }
        return(VarjoCameraPropertyMode.Off);
    }
    VarjoCameraPropertyMode[] GetPropertyModes(VarjoCameraPropertyType type)
    {
        List <VarjoCameraPropertyMode> list = new List <VarjoCameraPropertyMode>();

        VarjoCameraPropertyMode[] modes = new VarjoCameraPropertyMode[VarjoPluginMR.GetCameraPropertyModeCount(type)];
        if (VarjoPluginMR.GetCameraPropertyModes(type, out list))
        {
            modes = list.ToArray();
        }
        return(modes);
    }
    VarjoCameraPropertyValue[] GetPropertyValues(VarjoCameraPropertyType type)
    {
        List <VarjoCameraPropertyValue> list = new List <VarjoCameraPropertyValue>();

        VarjoCameraPropertyValue[] values = new VarjoCameraPropertyValue[VarjoPluginMR.GetCameraPropertyValueCount(type)];
        if (VarjoPluginMR.GetCameraPropertyValues(type, out list))
        {
            values = list.ToArray();
        }
        return(values);
    }
Ejemplo n.º 10
0
 void UpdateVideoSeeThrough()
 {
     if (videoSeeThrough != videoSeeThroughEnabled)
     {
         if (videoSeeThrough)
         {
             videoSeeThrough = VarjoPluginMR.StartRender();
         }
         else
         {
             VarjoPluginMR.StopRender();
         }
         videoSeeThroughEnabled = videoSeeThrough;
     }
 }
Ejemplo n.º 11
0
        private void OnMRDeviceStatus(bool connected)
        {
            Debug.Log("MR Device status: " + (connected ? "connected" : "disconnected"));

            if (connected)
            {
                VarjoPluginMR.StartRender();
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
                VarjoPluginMR.StopRender();
            }
        }
Ejemplo n.º 12
0
        void Start()
        {
            // Register to receive event notifications.
            VarjoManager.OnDataStreamStartEvent        += OnDataStreamStart;
            VarjoManager.OnDataStreamStopEvent         += OnDataStreamStop;
            VarjoManager.OnMRCameraPropertyChangeEvent += OnCameraPropertyChange;
            VarjoManager.OnMRDeviceStatusEvent         += OnMRDeviceStatus;

            // Try to start rendering. If there is no MR support available, this call fails and we
            // fall back to Skybox as the background.
            if (VarjoPluginMR.StartRender())
            {
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
            }
        }
Ejemplo n.º 13
0
 void UpdateDepthEstimation()
 {
     if (depthEstimation != depthEstimationEnabled)
     {
         if (depthEstimation)
         {
             originalSubmitDepthValue  = varjoManager.submitDepth;
             varjoManager.submitDepth  = true;
             varjoManager.depthTesting = true;
             depthEstimation           = VarjoPluginMR.EnableDepthEstimation();
         }
         else
         {
             varjoManager.submitDepth  = originalSubmitDepthValue;
             varjoManager.depthTesting = false;
             VarjoPluginMR.DisableDepthEstimation();
         }
         depthEstimationEnabled = depthEstimation;
     }
 }