Skip to content

Commit

Permalink
fix(DeviceFinder): add oculus headset type for rare es07
Browse files Browse the repository at this point in the history
The Oculus Rift headset can have a rare reported type of es07 which
is now being caught and returned correctly.

Thanks to @avik-das for identifying the issue.
  • Loading branch information
thestonefox committed Sep 27, 2017
1 parent 2bb32eb commit 71ecaa5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Assets/VRTK/Documentation/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7477,6 +7477,7 @@ The Device Finder offers a collection of static methods that can be called to fi
* `Vive` - A summary of all HTC Vive headset versions.
* `ViveMV` - A specific version of the HTC Vive headset, the first consumer version.
* `ViveDVT` - A specific version of the HTC Vive headset, the first consumer version.
* `OculusRiftES07` - A specific version of the Oculus Rift headset, the rare ES07.

### Class Methods

Expand Down Expand Up @@ -7740,7 +7741,7 @@ The ResetHeadsetTypeCache resets the cache holding the current headset type valu
> `public static Headsets GetHeadsetType(bool summary = false)`

* Parameters
* `bool 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).
* `bool 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).
* Returns
* `Headsets` - The Headset type that is connected.

Expand Down
11 changes: 9 additions & 2 deletions Assets/VRTK/Source/Scripts/Utilities/VRTK_DeviceFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public enum Headsets
/// <summary>
/// A specific version of the HTC Vive headset, the first consumer version.
/// </summary>
ViveDVT
ViveDVT,
/// <summary>
/// A specific version of the Oculus Rift headset, the rare ES07.
/// </summary>
OculusRiftES07
}

private static string cachedHeadsetType = "";
Expand Down Expand Up @@ -368,7 +372,7 @@ public static void ResetHeadsetTypeCache()
/// <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>
/// <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>
public static Headsets GetHeadsetType(bool summary = false)
{
Expand All @@ -379,6 +383,9 @@ public static Headsets GetHeadsetType(bool summary = false)
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;
Expand Down

0 comments on commit 71ecaa5

Please sign in to comment.