private void UpdateProfile()
    {
        GetProfile(profileData);
        CardboardProfile.Device device = new CardboardProfile.Device();
        CardboardProfile.Screen screen = new CardboardProfile.Screen();
        device.maxFOV.outer          = profileData[0];
        device.maxFOV.upper          = profileData[1];
        device.maxFOV.inner          = profileData[2];
        device.maxFOV.lower          = profileData[3];
        screen.width                 = profileData[4];
        screen.height                = profileData[5];
        screen.border                = profileData[6];
        device.lenses.separation     = profileData[7];
        device.lenses.offset         = profileData[8];
        device.lenses.screenDistance = profileData[9];
        device.lenses.alignment      = (int)profileData[10];
        device.distortion.Coef       = new [] { profileData[11], profileData[12] };
        Profile.screen               = screen;
        Profile.device               = device;

        float[] rect = new float[4];
        Profile.GetLeftEyeNoLensTanAngles(rect);
        float maxRadius = CardboardProfile.GetMaxRadius(rect);

        Profile.device.inverse = CardboardProfile.ApproximateInverse(
            Profile.device.distortion, maxRadius);
    }
Beispiel #2
0
 private void UpdateProfile()
 {
     GetProfile(profileData);
     CardboardProfile.Device device = new CardboardProfile.Device();
     CardboardProfile.Screen screen = new CardboardProfile.Screen();
     device.maxFOV.outer          = profileData[0];
     device.maxFOV.upper          = profileData[1];
     device.maxFOV.inner          = profileData[2];
     device.maxFOV.lower          = profileData[3];
     screen.width                 = profileData[4];
     screen.height                = profileData[5];
     screen.border                = profileData[6];
     device.lenses.separation     = profileData[7];
     device.lenses.offset         = profileData[8];
     device.lenses.screenDistance = profileData[9];
     device.lenses.alignment      = (int)profileData[10];
     device.distortion.k1         = profileData[11];
     device.distortion.k2         = profileData[12];
     device.inverse               = CardboardProfile.ApproximateInverse(device.distortion);
     Profile.screen               = screen;
     Profile.device               = device;
 }