The OculusInput plugin breaks SteamVR when UE4 is launced with hmd=SteamVR

When using the Rift with UE4 and trying to select SteamVR instead of libOVR from the commandline (by passing hmd=SteamVR on the commandline), the OculusInput plugin will make a call to:

		ovrResult initStatus = ovr_Initialize(&initParams);

With a different minor version number than SteamVR itself uses. The symptom is then that the HMD tracks and renders to the mirror view, but nothing shows up inside the headset except an error message that UE4 is unresponsive.

A fix is to add this to FOculusInput::FOculusInput( const TSharedRef& InMessageHandler ) just before the call to ovr_Initialize:

	// Check whether the commandline explicitly doesn't want oculus
	FString ExplicitHMDName;
	bool bUseExplicitHMDName = FParse::Value(FCommandLine::Get(), TEXT("hmd="), ExplicitHMDName);
	if ((bUseExplicitHMDName && (!ExplicitHMDName.Equals(FString(TEXT("OculusRift")), ESearchCase::IgnoreCase))) ||
		(FParse::Param(FCommandLine::Get(), TEXT("nohmd"))))
	{
		UE_LOG(LogOcInput, Log, TEXT("Aborting OculusInput initialization because nohmd or a different hmd was set on the command line."),
			TEXT(OVR_FILE_DESCRIPTION_STRING), TEXT(OVR_VERSION_STRING));
		return;
	}

In the above fix I also added a check for “nohmd” to do the same early return. The touch controllers can’t be tracked without the HMD, but at some point they did start letting you use them untracked just for the joystick, etc., so you may want to leave that bit out if you run into this issue and need that functionality.

The goal here was to select SteamVR from the commandline for use with the Oculus Rift. The only way I got it to work before was to disable the rift plugins entirely, but I still wanted them to be selectable from the commandline too.