コード例 #1
0
    // StoreSnapshot
    bool StoreSnapshot(string snapshotName)
    {
        float f = 0;

        OVRPresetManager.SetCurrentPreset(snapshotName);

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

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

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

            Vector3 neckPosition = Vector3.zero;
            CameraController.GetNeckPosition(ref neckPosition);
            OVRPresetManager.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);

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

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

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

        return(true);
    }
コード例 #2
0
    // LoadSnapshot
    bool LoadSnapshot(string snapshotName)
    {
        float f = 0;

        OVRPresetManager.SetCurrentPreset(snapshotName);

        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);
        }

        if (OVRPresetManager.GetPropertyFloat("SPEEDMULT", ref f) == true)
        {
            OVRPlayerController.MoveScaleMultiplier = f;
        }

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

        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);

        return(true);
    }