示例#1
0
        public float GetYaw()
        {
            string property_name = "get_yaw";
            IntPtr tempPtr       = Marshal.StringToHGlobalAnsi(property_name);

            return(Composer.DpnuGetFloatValue(tempPtr, 0.0f));
        }
示例#2
0
        //static ConfigEngine
        //{
        //}

        static public void Init()
        {
            // log the unity version
            Debug.Log("Unity Version: " + Application.unityVersion);
            Debug.Log("Unity Plugin Version: " + DpnManager.DpvrUnityVersion);                // change when and only when unity is released. Unity plugin version.

                        #if UNITY_ANDROID && !UNITY_EDITOR
            // don't allow the application to run if orientation is not landscape left.
            // set screen orientation at runtime to override PlayerSettings.defaultInterfaceOrientation;
            Screen.orientation = ScreenOrientation.LandscapeLeft;
            if (Screen.orientation != ScreenOrientation.LandscapeLeft)
            {
                Debug.LogError("********************************************************************************\n");
                Debug.LogError("***** Default screen orientation must be set to landscape left for VR.\n" +
                               "***** Stopping application.\n");
                Debug.LogError("********************************************************************************\n");

                Debug.Break();
                Application.Quit();
            }

            // don't enable gyro, it is not used and triggers expensive display calls
            if (Input.gyro.enabled)
            {
                Debug.LogError("*** Auto-disabling Gyroscope ***");
                Input.gyro.enabled = false;
            }

            // NOTE: On Adreno Lollipop, it is an error to have antiAliasing set on the
            // main window surface with front buffer rendering enabled. The view will
            // render black.
            // On Adreno KitKat, some tiling control modes will cause the view to render
            // black.
            // As VR9 render to fb directly, need enable aa
            if (DpnDevice.bVR9)
            {
                QualitySettings.antiAliasing = 4;
                Debug.Log("VR9 platform AA should be enabled to " + QualitySettings.antiAliasing);
            }
            else
            {
                if (QualitySettings.antiAliasing > 1)
                {
                    Debug.LogWarning("*** Antialiasing should be disabled for better performance and no quality losing ***");
                }
            }
            // Disable screen dimming
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
                        #endif
            // try to render at 70fps
            string PROPERTY_REFRESH_RATE = "refresh_rate";
            IntPtr tempPtr = Marshal.StringToHGlobalAnsi(PROPERTY_REFRESH_RATE);
            Application.targetFrameRate = (int)Composer.DpnuGetFloatValue(tempPtr, 70) / DpnManager.minimumVsync;
            Debug.Log("minimumVsync " + DpnManager.minimumVsync + " targetFrameRate " + Application.targetFrameRate);
        }