示例#1
0
    private void OnRequestScreenshot(VREvent_t vrEvent)
    {
        var screenshotHandle = vrEvent.data.screenshot.handle;
        var screenshotType   = (EVRScreenshotType)vrEvent.data.screenshot.type;

        if (screenshotType == EVRScreenshotType.StereoPanorama)
        {
            string previewFilename = GetScreenshotFilename(screenshotHandle, EVRScreenshotPropertyFilenames.Preview);
            string VRFilename      = GetScreenshotFilename(screenshotHandle, EVRScreenshotPropertyFilenames.VR);

            if (previewFilename == null || VRFilename == null)
            {
                return;
            }

            // Do the stereo panorama screenshot
            // Figure out where the view is
            GameObject screenshotPosition = new GameObject("screenshotPosition");
            screenshotPosition.transform.position   = Top().transform.position;
            screenshotPosition.transform.rotation   = Top().transform.rotation;
            screenshotPosition.transform.localScale = Top().transform.lossyScale;
            SteamVR_Utils.TakeStereoScreenshot(screenshotHandle, screenshotPosition, 32, 0.064f, ref previewFilename,
                                               ref VRFilename);

            // and submit it
            OpenVR.Screenshots.SubmitScreenshot(screenshotHandle, screenshotType, previewFilename, VRFilename);
        }
    }
示例#2
0
    // Token: 0x06005F5F RID: 24415 RVA: 0x00217E4C File Offset: 0x0021624C
    private void OnRequestScreenshot(VREvent_t vrEvent)
    {
        uint handle            = vrEvent.data.screenshot.handle;
        EVRScreenshotType type = (EVRScreenshotType)vrEvent.data.screenshot.type;

        if (type == EVRScreenshotType.StereoPanorama)
        {
            string screenshotFilename  = this.GetScreenshotFilename(handle, EVRScreenshotPropertyFilenames.Preview);
            string screenshotFilename2 = this.GetScreenshotFilename(handle, EVRScreenshotPropertyFilenames.VR);
            if (screenshotFilename == null || screenshotFilename2 == null)
            {
                return;
            }
            SteamVR_Utils.TakeStereoScreenshot(handle, new GameObject("screenshotPosition")
            {
                transform =
                {
                    position   = SteamVR_Render.Top().transform.position,
                    rotation   = SteamVR_Render.Top().transform.rotation,
                    localScale = SteamVR_Render.Top().transform.lossyScale
                }
            }, 32, 0.064f, ref screenshotFilename, ref screenshotFilename2);
            OpenVR.Screenshots.SubmitScreenshot(handle, type, screenshotFilename, screenshotFilename2);
        }
    }
示例#3
0
        public void CaptureStart()
        {
            var screenshotHandle = ssHandle + 1;
            var screenshotType   = EVRScreenshotType.StereoPanorama;

            VRLog.Info($"Capturing Screenshot {screenshotHandle} {screenshotType}");

            if (screenshotType == EVRScreenshotType.StereoPanorama)
            {
                string timestamp       = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                string previewFilename = Application.dataPath + $"\\..\\UserData\\cap\\HS2_{timestamp}_Preview.png";
                VRLog.Info($"Using Preview File Name {previewFilename}");
                string VRFilename = Application.dataPath + $"\\..\\UserData\\cap\\HS2_{timestamp}_Stereo.png";
                VRLog.Info($"Using VR File Name {VRFilename}");

                if (previewFilename == null || VRFilename == null)
                {
                    return;
                }

                // Do the stereo panorama screenshot
                // Figure out where the view is
                GameObject screenshotPosition = VRCamera.Instance.SteamCam.camera.gameObject;
                SteamVR_Utils.TakeStereoScreenshot(screenshotHandle, screenshotPosition, 32, 0.064f, ref previewFilename, ref VRFilename);

                // and submit it
                //     OpenVR.Screenshots.SubmitScreenshot(screenshotHandle, screenshotType, previewFilename, VRFilename);
            }
        }
        private void OnRequestScreenshot(VREvent_t vrEvent)
        {
            uint handle            = vrEvent.data.screenshot.handle;
            EVRScreenshotType type = (EVRScreenshotType)vrEvent.data.screenshot.type;

            if (type == EVRScreenshotType.StereoPanorama)
            {
                string previewFilename = GetScreenshotFilename(handle, EVRScreenshotPropertyFilenames.Preview);
                string VRFilename      = GetScreenshotFilename(handle, EVRScreenshotPropertyFilenames.VR);
                if (previewFilename != null && VRFilename != null)
                {
                    GameObject gameObject = new GameObject("screenshotPosition");



                    gameObject.transform.position   = Top().transform.position;
                    gameObject.transform.rotation   = Top().transform.rotation;
                    gameObject.transform.localScale = Top().transform.lossyScale;
                    SteamVR_Utils.TakeStereoScreenshot(handle, gameObject, 32, 0.064f, ref previewFilename, ref VRFilename);
                    OpenVR.Screenshots.SubmitScreenshot(handle, type, previewFilename, VRFilename);
                }
            }
        }