Exemplo n.º 1
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);
    }
Exemplo n.º 2
0
    /// <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);
    }