Skip to content

Commit

Permalink
Merge pull request #32 from charles-river-analytics/bugfix/oculus_plu…
Browse files Browse the repository at this point in the history
…gin_update_2021

Bugfix/oculus plugin update 2021
  • Loading branch information
ddugganCRA committed Jul 7, 2021
2 parents 50f68a1 + bce6ccf commit aea6021
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 142 deletions.
28 changes: 0 additions & 28 deletions Assets/VIRTUOSO/VRTK/Source/Editor/VRTK_SupportInfoWindow.cs
Expand Up @@ -106,34 +106,6 @@ private void RefreshData()
}
);

Append(
"VR Settings",
() =>
{
foreach (BuildTargetGroup targetGroup in VRTK_SharedMethods.GetValidBuildTargetGroups())
{
bool isVREnabled;
#if UNITY_5_5_OR_NEWER
isVREnabled = VREditor.GetVREnabledOnTargetGroup(targetGroup);
#else
isVREnabled = VREditor.GetVREnabled(targetGroup);
#endif
if (!isVREnabled)
{
continue;
}
string[] vrEnabledDevices;
#if UNITY_5_5_OR_NEWER
vrEnabledDevices = VREditor.GetVREnabledDevicesOnTargetGroup(targetGroup);
#else
vrEnabledDevices = VREditor.GetVREnabledDevices(targetGroup);
#endif
Append(targetGroup, string.Join(", ", vrEnabledDevices));
}
}
);

Append(
"Scripting Define Symbols",
() =>
Expand Down
34 changes: 1 addition & 33 deletions Assets/VIRTUOSO/VRTK/Source/SDK/Base/SDK_BaseHeadset.cs
Expand Up @@ -147,39 +147,7 @@ protected Transform GetSDKManagerHeadset()

protected virtual string ScrapeHeadsetType()
{
string model = CleanPropertyString(XRDevice.model);
string deviceName = CleanPropertyString(XRSettings.loadedDeviceName);
switch (model)
{
case "oculusriftcv1":
case "oculusriftes07":
return CleanPropertyString("oculusrift");
case "vivemv":
case "vivedvt":
return CleanPropertyString("htcvive");
case "googleinc-daydreamview":
return "googledaydream";
case "googleinc-defaultcardboard":
return "googlecardboard";
case "galaxynote5":
case "galaxys6":
case "galaxys6edge":
case "galaxys7":
case "galaxys7edge":
case "galaxys8":
case "galaxys8+":
if (deviceName == "oculus")
{
return "oculusgearvr";
}
break;
case "oculusriftdk1":
return CleanPropertyString("oculusriftdk1");
case "oculusriftdk2":
return CleanPropertyString("oculusriftdk2");
case "acermixedreality":
return CleanPropertyString("windowsmixedreality");
}
// No longer necessary to use; will become deprecated
return "";
}

Expand Down
16 changes: 0 additions & 16 deletions Assets/VIRTUOSO/VRTK/Source/SDK/Oculus/SDK_OculusController.cs
Expand Up @@ -105,16 +105,6 @@ public override ControllerType GetCurrentControllerType(VRTK_ControllerReference
return ControllerType.Oculus_OculusGamepad;
}

if ((connectedControllers & OVRInput.Controller.Touchpad) == OVRInput.Controller.Touchpad)
{
return ControllerType.Oculus_GearVRHMD;
}

if ((connectedControllers & (OVRInput.Controller.LTrackedRemote | OVRInput.Controller.RTrackedRemote)) != 0)
{
return ControllerType.Oculus_GearVRController;
}

return ControllerType.Undefined;
}

Expand Down Expand Up @@ -830,12 +820,6 @@ protected virtual OVRInput.Controller GetControllerMask(uint index)
return (index == 0 ? OVRInput.Controller.LTouch : OVRInput.Controller.None);
case OVRInput.Controller.RTouch:
return (index == 1 ? OVRInput.Controller.RTouch : OVRInput.Controller.None);
case OVRInput.Controller.LTrackedRemote:
return (index == 0 ? OVRInput.Controller.LTrackedRemote : OVRInput.Controller.None);
case OVRInput.Controller.RTrackedRemote:
return (index == 1 ? OVRInput.Controller.RTrackedRemote : OVRInput.Controller.None);
case OVRInput.Controller.Touchpad:
return (index == 1 ? OVRInput.Controller.Touchpad : OVRInput.Controller.None);
}
return activeControllerType;
}
Expand Down
5 changes: 0 additions & 5 deletions Assets/VIRTUOSO/VRTK/Source/SDK/Oculus/SDK_OculusHeadset.cs
Expand Up @@ -80,11 +80,6 @@ public override string GetHeadsetType()
{
case OVRPlugin.SystemHeadset.Rift_CV1:
return CleanPropertyString("oculusrift");
case OVRPlugin.SystemHeadset.GearVR_R320:
case OVRPlugin.SystemHeadset.GearVR_R321:
case OVRPlugin.SystemHeadset.GearVR_R322:
case OVRPlugin.SystemHeadset.GearVR_R323:
return CleanPropertyString("oculusgearvr");
case OVRPlugin.SystemHeadset.Rift_DK1:
return CleanPropertyString("oculusriftdk1");
case OVRPlugin.SystemHeadset.Rift_DK2:
Expand Down
Expand Up @@ -946,7 +946,7 @@ private IEnumerator FinishSDKSetupLoading(VRTK_SDKSetup[] sdkSetups, VRTK_SDKSet
// The loaded VR Device is actually a VR Device
XRSettings.enabled = true;

if (!XRDevice.isPresent)
if (!XRSettings.enabled)
{
// Despite being loaded, the loaded VR Device isn't working correctly
int nextSetupIndex = Array.IndexOf(sdkSetups, loadedSetup) + 1;
Expand Down
59 changes: 0 additions & 59 deletions Assets/VIRTUOSO/VRTK/Source/Scripts/Utilities/VRTK_DeviceFinder.cs
Expand Up @@ -433,65 +433,6 @@ public static Transform HeadsetCamera()
return VRTK_SDK_Bridge.GetHeadsetCamera();
}

/// <summary>
/// The ResetHeadsetTypeCache resets the cache holding the current headset type value.
/// </summary>
[System.Obsolete("`VRTK_DeviceFinder.ResetHeadsetTypeCache()` has been deprecated. This method will be removed in a future version of VRTK.")]
public static void ResetHeadsetTypeCache()
{
cachedHeadsetType = "";
}

/// <summary>
/// The GetHeadsetType method returns the type of headset connected to the computer.
/// </summary>
/// <param name="summary">If this is `true`, then the generic name for the headset is returned not including the version type (e.g. OculusRift will be returned for DK2 and CV1).</param>
/// <returns>The Headset type that is connected.</returns>
[System.Obsolete("`VRTK_DeviceFinder.GetHeadsetType(summary) -> VRTK_DeviceFinder.Headsets` has been replaced with `VRTK_DeviceFinder.GetHeadsetType() -> SDK_BaseHeadset.HeadsetType`. This method will be removed in a future version of VRTK.")]
public static Headsets GetHeadsetType(bool summary = false)
{
Headsets returnValue = Headsets.Unknown;
cachedHeadsetType = (cachedHeadsetType == "" ? XRDevice.model.Replace(" ", "").Replace(".", "").ToLowerInvariant() : cachedHeadsetType);
switch (cachedHeadsetType)
{
case "oculusriftcv1":
returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftCV1);
break;
case "oculusriftes07":
returnValue = (summary ? Headsets.OculusRift : Headsets.OculusRiftES07);
break;
case "vivemv":
returnValue = (summary ? Headsets.Vive : Headsets.ViveMV);
break;
case "vivedvt":
returnValue = (summary ? Headsets.Vive : Headsets.ViveDVT);
break;
}

if (returnValue == Headsets.Unknown)
{
VRTK_Logger.Warn(
string.Format("Your headset is of type '{0}' which VRTK doesn't know about yet. Please report this headset type to the maintainers of VRTK."
+ (summary ? " Falling back to a slower check to summarize the headset type now." : ""),
cachedHeadsetType)
);

if (summary)
{
if (cachedHeadsetType.Contains("rift"))
{
return Headsets.OculusRift;
}
if (cachedHeadsetType.Contains("vive"))
{
return Headsets.Vive;
}
}
}

return returnValue;
}

/// <summary>
/// The GetHeadsetTypeAsString method returns a string representing the type of headset connected.
/// </summary>
Expand Down

0 comments on commit aea6021

Please sign in to comment.