Exemplo n.º 1
0
    //====================================================================================================
    // Functions
    //====================================================================================================

    /// <summary>
    /// Returns device configuration corresponding to a device name.
    /// </summary>
    /// <param name="_device">Device name.</param>
    public static ALPSConfig GetConfig(Device _device)
    {
        ALPSConfig config;

        switch (_device)
        {
        case Device.ALTERGAZE:
            config = new ALPSConfig(Device.ALTERGAZE, true, true, false, 62f, 62f, 85f, -1f, 0.4f, 0.2f, 0, 0);
            break;

        case Device.CARDBOARD:
            config = new ALPSConfig(Device.CARDBOARD, true, true, false, 62f, 62f, 85f, -1.5f, 0.5f, 0.2f, 128, 75);
            break;

        case Device.FREEFLY_VR:
            config = new ALPSConfig(Device.FREEFLY_VR, true, true, false, 62f, 62f, 85f, -2f, 0.7f, 0.2f, 140, 75);
            break;

        case Device.DEFAULT:
        default:
            config = new ALPSConfig(Device.DEFAULT, false, false, false, 62f, 62f, 85f, 0f, 0f, 0f, 0, 0);
            break;
        }
        return(config);
    }
Exemplo n.º 2
0
 //====================================================================================================
 // Functions
 //====================================================================================================
 /// <summary>
 /// Returns device configuration corresponding to a device name.
 /// </summary>
 /// <param name="_device">Device name.</param>
 public static ALPSConfig GetConfig(Device _device)
 {
     /// <param name="_DeviceName">Device name.</param>
     /// <param name="_EnableBarrelDistortion">True if barrel distortion must be enabled, false otherwise.</param>
     /// <param name="_EnableChromaticCorrection">True if chromatic correction must be enabled, false otherwise.</param>
     /// <param name="_FixedSize">True is viewport must be fixed insize, false if viewport must be fullscreen.</param>
     /// <param name="_IPD">Inter pupillary distance in millimeters. Must match the distance between users' eyes</param>
     /// <param name="_ILD">IInter lens distance in millimeters. Should match the IPD but can be tweaked to increase or decrease the stereo effect.</param>
     /// <param name="_FieldOfView">Cameras field of view.</param>
     /// <param name="_ChromaticCorrection">Chromatic Correction factor.</param>
     /// <param name="_k1">Barrel distortion first order factor.</param>
     /// <param name="_k2">Barrel distortion second order factor.</param>
     /// <param name="_Width">Viewport width in millimeters if fixed in size, ignored otherwise.</param>
     /// <param name="_Height">Viewport height in millimeters if fixed in size, ignored otherwise.</param>
     ALPSConfig config;
     switch (_device) {
         case Device.ALTERGAZE:
         config = new ALPSConfig(Device.ALTERGAZE,true,true,false,62f,62f,85f,-1f,0.4f,0.2f,0,0);
             break;
         case Device.CARDBOARD:
         config = new ALPSConfig(Device.CARDBOARD,true,true,false,62f,56f,85f,0.4f,1f,0.2f,128,75);
             break;
         case Device.FREEFLY_VR:
         config = new ALPSConfig(Device.FREEFLY_VR,true,true,false,62f,62f,85f,-2f,0.7f,0.2f,140,75);
             break;
         case Device.VR_ONE:
         config = new ALPSConfig(Device.VR_ONE,true,true,false,62f,62f,85f,-2f,1.0f,10.0f,125,65);
             break;
         case Device.DEFAULT:
         default:
             config = new ALPSConfig(Device.DEFAULT,false,false,false,62f,62f,85f,0f,0f,0f,0,0);
             break;
     }
     return config;
 }
 //====================================================================================================
 // Functions
 //====================================================================================================
 /// <summary>
 /// Returns device configuration corresponding to a device name.
 /// </summary>
 /// <param name="_device">Device name.</param>
 public static ALPSConfig GetConfig(Device _device)
 {
     ALPSConfig config;
     switch (_device) {
         case Device.ALTERGAZE:
         config = new ALPSConfig(Device.ALTERGAZE,true,true,false,62f,62f,85f,-1f,0.4f,0.2f,0,0);
             break;
         case Device.CARDBOARD:
         config = new ALPSConfig(Device.CARDBOARD,true,true,false,62f,62f,85f,-1.5f,0.5f,0.2f,128,75);
             break;
         case Device.FREEFLY_VR:
         config = new ALPSConfig(Device.FREEFLY_VR,true,true,false,62f,62f,85f,-2f,0.7f,0.2f,140,75);
             break;
         case Device.VISR_NANO:
             config = new ALPSConfig(Device.VISR_NANO, true, true, false, 62f, 62f, 85f, -1.5f, 0.5f, 0.2f, 128, 75);
             break;
         case Device.VISR:
             config = new ALPSConfig(Device.VISR, false, true, false, 62f, 62f, 50f, -2f, 0.25f, 0.0f, 140, 75);
             break;
         case Device.DEFAULT:
         default:
             config = new ALPSConfig(Device.DEFAULT,false,false,false,62f,62f,85f,0f,0f,0f,0,0);
             break;
     }
     return config;
 }
Exemplo n.º 4
0
 //=====================================================================================================
 // Functions
 //=====================================================================================================
 public void OnEnable()
 {
     controller = (ALPSController)target;
     deviceConfig = (controller.deviceConfig == null)? ALPSDevice.GetConfig(Device.DEFAULT):controller.deviceConfig;
     controller.deviceConfig = deviceConfig;
     ALPSCamera.deviceConfig = deviceConfig;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets a new device configuration.
 /// </summary>
 // <param name="_device">Name of the device.</param>
 public void SetDevice(Device _device)
 {
     deviceConfig                = ALPSDevice.GetConfig(_device);
     ALPSCamera.deviceConfig     = deviceConfig;
     ALPSBarrelMesh.deviceConfig = deviceConfig;
     ALPSCrosshairs.deviceConfig = deviceConfig;
     ClearDirty();
 }
    //=====================================================================================================
    // Functions
    //=====================================================================================================

    public void OnEnable()
    {
        controller                  = (ALPSController)target;
        deviceConfig                = (controller.deviceConfig == null)? ALPSDevice.GetConfig(Device.DEFAULT):controller.deviceConfig;
        controller.deviceConfig     = deviceConfig;
        ALPSCamera.deviceConfig     = deviceConfig;
        ALPSBarrelMesh.deviceConfig = deviceConfig;
        ALPSCrosshairs.deviceConfig = deviceConfig;
        screenSize                  = deviceConfig.GetScreenOption();
    }
 //=====================================================================================================
 // Functions
 //=====================================================================================================
 public void OnEnable()
 {
     controller = (ALPSController)target;
     deviceConfig = (controller.deviceConfig == null)? ALPSDevice.GetConfig(Device.DEFAULT):controller.deviceConfig;
     controller.deviceConfig = deviceConfig;
     ALPSCamera.deviceConfig = deviceConfig;
     ALPSBarrelMesh.deviceConfig = deviceConfig;
     ALPSCrosshairs.deviceConfig = deviceConfig;
     screenSize = deviceConfig.GetScreenOption ();
 }
Exemplo n.º 8
0
    public override void OnInspectorGUI()
    {
        deviceConfig = controller.deviceConfig;

        //Device
        Device = (Device)EditorGUILayout.EnumPopup("Device:",Device);

        //IPD
        deviceConfig.IPD = EditorGUILayout.FloatField (new GUIContent("IPD", "Inter Pupilary Distance in millimeter. This must match the distance between the user's eyes"),deviceConfig.IPD);

        //ILD
        deviceConfig.ILD = EditorGUILayout.FloatField (new GUIContent("ILD","Inter Lens Distance in millimeter. This is the distance between the lenses of the headset."),deviceConfig.ILD);

        //Stereo distance
        deviceConfig.stereoDistance = EditorGUILayout.FloatField (new GUIContent("Stereo distance", "Distance between both cameras in millimeter (default is IPD). This can be tweaked to change the stereo strength."),deviceConfig.stereoDistance);

        //Field Of View
        deviceConfig.fieldOfView = EditorGUILayout.Slider ("Vertical FOV",deviceConfig.fieldOfView, 1, 180);

        //Screen size
        deviceConfig.width = EditorGUILayout.IntField (new GUIContent("Headset width", "Width of the viewport in millimeter"), deviceConfig.width);
        deviceConfig.height = EditorGUILayout.IntField (new GUIContent("Headset height", "Height of the viewport in millimeter"), deviceConfig.height);

        //Barrel distortion
        deviceConfig.barrelDistortionActive = EditorGUILayout.Toggle ("Barrel distortion", deviceConfig.barrelDistortionActive);
        if (deviceConfig.barrelDistortionActive) {
            deviceConfig.K1 = EditorGUILayout.FloatField ("\tk1", deviceConfig.K1);
            deviceConfig.K2 = EditorGUILayout.FloatField ("\tk2", deviceConfig.K2);
        }

        //Chromatic correction
        deviceConfig.chromaticCorrectionActive = EditorGUILayout.Toggle ("Chromatic correction",deviceConfig.chromaticCorrectionActive);
        if (deviceConfig.chromaticCorrectionActive) {
            deviceConfig.CC = EditorGUILayout.FloatField ("\tCorrection intensity", deviceConfig.CC);
        }

        //Crosshairs
        controller.crosshairsEnabled = EditorGUILayout.Toggle("Crosshair", controller.crosshairsEnabled);

        if (GUI.changed) {
            controller.ClearDirty();
            EditorUtility.SetDirty(target);
        }
    }
 /// <summary>
 /// Sets a new device configuration.
 /// </summary>
 // <param name="_device">Name of the device.</param>
 public void SetDevice(Device _device)
 {
     deviceConfig = ALPSDevice.GetConfig (_device);
     PropagateConfig ();
     ClearDirty ();
 }
Exemplo n.º 10
0
 /// <summary>
 /// Sets a new device configuration.
 /// </summary>
 // <param name="_device">Name of the device.</param>
 public void SetDevice(Device _device)
 {
     deviceConfig = ALPSDevice.GetConfig (_device);
     ALPSCamera.deviceConfig = deviceConfig;
     ALPSBarrelMesh.deviceConfig = deviceConfig;
     ALPSCrosshairs.deviceConfig = deviceConfig;
     ClearDirty ();
 }
    //=====================================================================================================
    // Functions
    //=====================================================================================================

    public void OnEnable()
    {
        controller              = (ALPSControllerLight)target;
        deviceConfig            = (controller.deviceConfig == null)? ALPSDevice.GetConfig(Device.DEFAULT):controller.deviceConfig;
        controller.deviceConfig = deviceConfig;
    }
Exemplo n.º 12
0
 /// <summary>
 /// Sets a new device configuration.
 /// </summary>
 // <param name="_device">Name of the device.</param>
 public void SetDevice(Device _device)
 {
     deviceConfig = ALPSDevice.GetConfig(_device);
     ClearDirty();
 }