bool FOSVRHMD::Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar) { if (FParse::Command(&Cmd, TEXT("STEREO"))) { if (FParse::Command(&Cmd, TEXT("ON"))) { if (!IsHMDEnabled()) { Ar.Logf(TEXT("HMD is disabled. Use 'hmd enable' to re-enable it.")); } EnableStereo(true); return true; } else if (FParse::Command(&Cmd, TEXT("OFF"))) { EnableStereo(false); return true; } } else if (FParse::Command(&Cmd, TEXT("HMD"))) { if (FParse::Command(&Cmd, TEXT("ENABLE"))) { EnableHMD(true); return true; } else if (FParse::Command(&Cmd, TEXT("DISABLE"))) { EnableHMD(false); return true; } } else if (FParse::Command(&Cmd, TEXT("UNCAPFPS"))) { GEngine->bSmoothFrameRate = false; return true; } else if (FParse::Command(&Cmd, TEXT("HEADTRACKING"))) { FString val; if (FParse::Value(Cmd, TEXT("SOURCE="), val)) { EnablePositionalTracking(false); //OSVRInterfaceName = val; EnablePositionalTracking(true); } if (FParse::Command(&Cmd, TEXT("ENABLE"))) { EnablePositionalTracking(true); return true; } else if (FParse::Command(&Cmd, TEXT("DISABLE"))) { EnablePositionalTracking(false); return true; } } return false; }
void FSteamVRHMD::EnableHMD(bool enable) { bHmdEnabled = enable; if (!bHmdEnabled) { EnableStereo(false); } }
void FOSVRHMD::EnableHMD(bool bEnable) { bHmdEnabled = bEnable; if (!bHmdEnabled) { EnableStereo(false); } }
void FOSVRHMD::EnableHMD(bool bEnable) { // Make EnableHMD idempotent so that it and EnableStereo can call each other if (bHmdEnabled == bEnable) { return; } bHmdEnabled = bEnable; EnableStereo(bHmdEnabled); }
void FSteamVRHMD::OnScreenModeChange(EWindowMode::Type WindowMode) { EnableStereo(WindowMode != EWindowMode::Windowed); }
bool FSteamVRHMD::Exec( UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar ) { if (FParse::Command( &Cmd, TEXT("STEREO") )) { if (FParse::Command(&Cmd, TEXT("ON"))) { if (!IsHMDEnabled()) { Ar.Logf(TEXT("HMD is disabled. Use 'hmd enable' to re-enable it.")); } EnableStereo(true); return true; } else if (FParse::Command(&Cmd, TEXT("OFF"))) { EnableStereo(false); return true; } float val; if (FParse::Value(Cmd, TEXT("E="), val)) { IPD = val; } } else if (FParse::Command(&Cmd, TEXT("HMD"))) { if (FParse::Command(&Cmd, TEXT("ENABLE"))) { EnableHMD(true); return true; } else if (FParse::Command(&Cmd, TEXT("DISABLE"))) { EnableHMD(false); return true; } int32 val; if (FParse::Value(Cmd, TEXT("MIRROR"), val)) { if ((val >= 0) && (val <= 2)) { WindowMirrorMode = val; } else { Ar.Logf(TEXT("HMD MIRROR accepts values from 0 though 2")); } return true; } } else if (FParse::Command(&Cmd, TEXT("UNCAPFPS"))) { GEngine->bForceDisableFrameRateSmoothing = true; return true; } return false; }
void VimridViewer::OnControlSelectRelease(Control &control) { // HACK: Comparing text when pointer should be compared. if ((control.GetName() == "loadDicomSet1Button") || (control.GetName() == "loadDicomSet2Button") || (control.GetName() == "loadDicomSet3Button") || (control.GetName() == "loadDicomSet4Button")) { const Button *buttonPtr = dynamic_cast<const Button*>(&control); mDicomClient.DownloadAsync(buttonPtr->GetText()); } // HACK: Comparing text when pointer should be compared. if (control.GetName() == "toggleStatusButton") { EnableRenderStatusText = !EnableRenderStatusText; } // Cancel loading of DICOM data. if (&control == mFilterLoadingScreenCancelButton) { mDicomLoadCancel = true; } // Turns transparency on and off. if (&control == mToggleAlphaButton) { mAlphaEnabled = !mAlphaEnabled; } if (&control == mFilterRestoreButton) { pthread_create(&mFilterRestoreThread, NULL, _filterRestore, NULL); } /* HACK: If any other button pressed, filter mode is reset. This * conveniently does the same thing as what the cancel button does * so it works fine for the time being, but this should only really * be reset on specific scenarios (such as cancel button press). */ mFilterMode = VV_FM_None; if (&control == mSobelXNormalButton) { mFilterMode = VV_FM_SobelXNormal; } else if (&control == mSobelYNormalButton) { mFilterMode = VV_FM_SobelYNormal; } else if (&control == mSobelXYNormalButton) { mFilterMode = VV_FM_SobelXYNormal; } else if (&control == mSobelXYScopedButton) { mFilterMode = VV_FM_SobelXYScoped; } // Once filter mode potentially set, check and if it is, process! if (mFilterMode != VV_FM_None) { pthread_create(&mProcessorThread, NULL, _processImages, NULL); } if (&control == mToggleStereoButton) { if (IsStereoEnabled()) { DisableStereo(); } else { EnableStereo(); } } if (&control == mToggleTrackdButton) { VimridMenu &mainMenu = *mMainMenu; if (GetUtility().IsTrackdEnabled()) { GetUtility().DisableTrackd(); GetUiContainer().ResetCursor(); if (mainMenu.HasToggleMode(UI_MTM_CENTRE_CURSOR)) { mainMenu.RemoveToggleMode(UI_MTM_CENTRE_CURSOR); } } else { GetUtility().EnableTrackd(); GetUiContainer().CentreCursor(*mMainMenu); if (!mainMenu.HasToggleMode(UI_MTM_CENTRE_CURSOR)) { mainMenu.AddToggleMode(UI_MTM_CENTRE_CURSOR); } } } if (&control == mExitVimridButton) { Exit(); } }