/// <summary>
    /// Stores the snapshot.
    /// </summary>
    /// <returns><c>true</c>, if snapshot was stored, <c>false</c> otherwise.</returns>
    /// <param name="snapshotName">Snapshot name.</param>
    bool StoreSnapshot(string snapshotName)
    {
        float f = 0;

        PresetManager.SetCurrentPreset(snapshotName);

        if (CameraController != null)
        {
            CameraController.GetIPD(ref f);
            PresetManager.SetPropertyFloat("IPD", ref f);

            f = OVRDevice.GetPredictionTime();
            PresetManager.SetPropertyFloat("PREDICTION", ref f);

            CameraController.GetVerticalFOV(ref f);
            PresetManager.SetPropertyFloat("FOV", ref f);

            Vector3 neckPosition = Vector3.zero;
            CameraController.GetNeckPosition(ref neckPosition);
            PresetManager.SetPropertyFloat("HEIGHT", ref neckPosition.y);
        }

        if (PlayerController != null)
        {
            PlayerController.GetMoveScaleMultiplier(ref f);
            PresetManager.SetPropertyFloat("SPEEDMULT", ref f);

            PlayerController.GetRotationScaleMultiplier(ref f);
            PresetManager.SetPropertyFloat("ROTMULT", ref f);
        }

        return(true);
    }
示例#2
0
    // StoreSnapshot
    bool StoreSnapshot(string snapshotName)
    {
        float f = 0;

        PresetManager.SetCurrentPreset(snapshotName);

        if (CameraController != null)
        {
            CameraController.GetIPD(ref f);
            PresetManager.SetPropertyFloat("IPD", ref f);

            f = OVRDevice.GetPredictionTime(0);
            PresetManager.SetPropertyFloat("PREDICTION", ref f);

            CameraController.GetVerticalFOV(ref f);
            PresetManager.SetPropertyFloat("FOV", ref f);

            Vector3 neckPosition = Vector3.zero;
            CameraController.GetNeckPosition(ref neckPosition);
            PresetManager.SetPropertyFloat("HEIGHT", ref neckPosition.y);

            float Dk0 = 0.0f;
            float Dk1 = 0.0f;
            float Dk2 = 0.0f;
            float Dk3 = 0.0f;
            CameraController.GetDistortionCoefs(ref Dk0, ref Dk1, ref Dk2, ref Dk3);

            PresetManager.SetPropertyFloat("DISTORTIONK0", ref Dk0);
            PresetManager.SetPropertyFloat("DISTORTIONK1", ref Dk1);
            PresetManager.SetPropertyFloat("DISTORTIONK2", ref Dk2);
            PresetManager.SetPropertyFloat("DISTORTIONK3", ref Dk3);
        }

        if (PlayerController != null)
        {
            PlayerController.GetMoveScaleMultiplier(ref f);
            PresetManager.SetPropertyFloat("SPEEDMULT", ref f);

            PlayerController.GetRotationScaleMultiplier(ref f);
            PresetManager.SetPropertyFloat("ROTMULT", ref f);
        }

        return(true);
    }
示例#3
0
    // LoadSnapshot
    bool LoadSnapshot(string snapshotName)
    {
        float f = 0;

        OVRPresetManager.SetCurrentPreset(snapshotName);

        if (CameraController != null)
        {
            if (OVRPresetManager.GetPropertyFloat("IPD", ref f) == true)
            {
                CameraController.SetIPD(f);
            }

            if (OVRPresetManager.GetPropertyFloat("PREDICTION", ref f) == true)
            {
                OVRDevice.SetPredictionTime(0, f);
            }

            if (OVRPresetManager.GetPropertyFloat("FOV", ref f) == true)
            {
                CameraController.SetVerticalFOV(f);
            }

            if (OVRPresetManager.GetPropertyFloat("HEIGHT", ref f) == true)
            {
                Vector3 neckPosition = Vector3.zero;
                CameraController.GetNeckPosition(ref neckPosition);
                neckPosition.y = f;
                CameraController.SetNeckPosition(neckPosition);
            }

            float Dk0 = 0.0f;
            float Dk1 = 0.0f;
            float Dk2 = 0.0f;
            float Dk3 = 0.0f;
            CameraController.GetDistortionCoefs(ref Dk0, ref Dk1, ref Dk2, ref Dk3);

            if (OVRPresetManager.GetPropertyFloat("DISTORTIONK0", ref f) == true)
            {
                Dk0 = f;
            }
            if (OVRPresetManager.GetPropertyFloat("DISTORTIONK1", ref f) == true)
            {
                Dk1 = f;
            }
            if (OVRPresetManager.GetPropertyFloat("DISTORTIONK2", ref f) == true)
            {
                Dk2 = f;
            }
            if (OVRPresetManager.GetPropertyFloat("DISTORTIONK3", ref f) == true)
            {
                Dk3 = f;
            }

            CameraController.SetDistortionCoefs(Dk0, Dk1, Dk2, Dk3);
        }

        if (PlayerController != null)
        {
            if (OVRPresetManager.GetPropertyFloat("SPEEDMULT", ref f) == true)
            {
                PlayerController.SetMoveScaleMultiplier(f);
            }

            if (OVRPresetManager.GetPropertyFloat("ROTMULT", ref f) == true)
            {
                PlayerController.SetRotationScaleMultiplier(f);
            }
        }

        return(true);
    }