//VR setup functions void ACPP_VRPawn::SetupVROptions() { IHeadMountedDisplay* HMD = (IHeadMountedDisplay*)(GEngine->HMDDevice.Get()); if (HMD && HMD->IsStereoEnabled()) { HMD->EnablePositionalTracking(bPositionalHeadTracking); if (!bPositionalHeadTracking) { Camera->SetRelativeLocation(FVector(0, 0, 0)); } } }
void AVRCharacter::SetupVROptions() { IHeadMountedDisplay* HMD = (IHeadMountedDisplay*)(GEngine->HMDDevice.Get()); if (HMD && HMD->IsStereoEnabled()) { /* Disable/Enable positional movement to pin camera translation */ HMD->EnablePositionalTracking(bPositionalHeadTracking); /* Remove any translation when disabling positional head tracking */ if (!bPositionalHeadTracking) { CameraComp->SetRelativeLocation(FVector(0, 0, 0)); } } }