Skip to content

Commit 92009fc

Browse files
authored
Pr fixes (#10576)
* suppressed warning about the Oculus Integration SDK for OpenXR enabled unity versions * Fixed whitespace issues * Replacing Contains + indexing with TryGetValue * Oculus Integration csc adjustments * Moving variables inside ifdef * typo
1 parent 667bb3f commit 92009fc

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

Assets/MRTK/Core/Providers/Hands/BaseHandVisualizer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ public virtual void OnHandJointsUpdated(InputEventData<IDictionary<TrackedHandJo
127127
{
128128
TrackedHandJoint handJoint = (TrackedHandJoint)i;
129129
// Skip this hand joint if the event data doesn't have an entry for it
130-
if (!eventData.InputData.ContainsKey(handJoint))
130+
if (!eventData.InputData.TryGetValue(handJoint, out MixedRealityPose handJointPose))
131131
{
132132
continue;
133133
}
134-
MixedRealityPose handJointPose = eventData.InputData[handJoint];
135134
Transform jointTransform = jointsArray[i];
136135

137136
if (jointTransform != null)

Assets/MRTK/Providers/Oculus/XRSDK/MRTK-Quest/Editor/OculusXRSDKHandtrackingConfigurationChecker.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ static void UpdateCSC()
228228
List<string> warningNumbers = new List<string>();
229229

230230
// List of new warning numbers to add to the csc file
231+
// Empty as of Oculus Integration 39.0 https://developer.oculus.com/downloads/package/unity-integration/39.0
231232
List<string> warningNumbersToAdd = new List<string>()
232233
{
233-
"414",
234-
"618",
235-
"649"
236234
};
237235

238236
if (!File.Exists(cscFilePath))

Assets/MRTK/Providers/Oculus/XRSDK/OculusXRSDKDeviceManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ public OculusXRSDKDeviceManager(
4848
public override void Initialize()
4949
{
5050
base.Initialize();
51+
#if !UNITY_2020_1_OR_NEWER
5152
UnityEngine.Debug.Log(@"Detected a potential deployment issue for the Oculus Quest. In order to use hand tracking with the Oculus Quest, download the Oculus Integration Package from the Unity Asset Store and run the Integration tool before deploying.
5253
The tool can be found under <i>Mixed Reality > Toolkit > Utilities > Oculus > Integrate Oculus Integration Unity Modules</i>");
54+
// Add a note about abandoning Oculus XRSDK if on 2020+, use open xr instead please
55+
#endif
5356
}
5457
#endif
5558

Assets/MRTK/Providers/Oculus/XRSDK/OculusXRSDKDeviceManagerProfile.cs

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,33 +117,18 @@ public OVRHand.TrackingConfidence MinimumHandConfidence
117117
/// Current tracking confidence of right hand. Value managed by OculusQuestHand.cs.
118118
/// </summary>
119119
public OVRHand.TrackingConfidence CurrentRightHandTrackingConfidence { get; set; }
120-
#endif
121-
122-
[SerializeField]
123-
[Range(0f, 5f)]
124-
[Tooltip("Time after which low confidence is considered unreliable, and tracking is set to false. Setting this to 0 means low-confidence is always acceptable.")]
125-
private float lowConfidenceTimeThreshold = 0.2f;
126-
127-
/// <summary>
128-
/// Time in seconds after which low confidence is considered unreliable, and tracking is set to false.
129-
/// </summary>
130-
public float LowConfidenceTimeThreshold
131-
{
132-
get => lowConfidenceTimeThreshold;
133-
set => lowConfidenceTimeThreshold = value;
134-
}
135120

136121
[Header("Performance Configuration")]
137122
[SerializeField]
138123
[Tooltip("Default CPU performance level (0-2 is documented), (3-5 is undocumented).")]
139124
[Range(0, 5)]
140-
private int defaultCpuLevel = 2;
125+
private OVRManager.ProcessorPerformanceLevel defaultCpuLevel = OVRManager.ProcessorPerformanceLevel.SustainedHigh;
141126

142127
/// <summary>
143128
/// Accessor for the Oculus CPU performance level.
144129
/// https://developer.oculus.com/documentation/native/android/mobile-power-overview
145130
/// </summary>
146-
public int CPULevel
131+
public OVRManager.ProcessorPerformanceLevel CPULevel
147132
{
148133
get => defaultCpuLevel;
149134
set
@@ -156,12 +141,12 @@ public int CPULevel
156141
[SerializeField]
157142
[Tooltip("Default GPU performance level (0-2 is documented), (3-5 is undocumented).")]
158143
[Range(0, 5)]
159-
private int defaultGpuLevel = 2;
144+
private OVRManager.ProcessorPerformanceLevel defaultGpuLevel = OVRManager.ProcessorPerformanceLevel.SustainedHigh;
160145

161146
/// <summary>
162147
/// Accessor for the Oculus GPU performance level.
163148
/// </summary>
164-
public int GPULevel
149+
public OVRManager.ProcessorPerformanceLevel GPULevel
165150
{
166151
get => defaultGpuLevel;
167152
set
@@ -170,6 +155,22 @@ public int GPULevel
170155
ApplyConfiguredPerformanceSettings();
171156
}
172157
}
158+
#endif
159+
160+
[SerializeField]
161+
[Range(0f, 5f)]
162+
[Tooltip("Time after which low confidence is considered unreliable, and tracking is set to false. Setting this to 0 means low-confidence is always acceptable.")]
163+
private float lowConfidenceTimeThreshold = 0.2f;
164+
165+
/// <summary>
166+
/// Time in seconds after which low confidence is considered unreliable, and tracking is set to false.
167+
/// </summary>
168+
public float LowConfidenceTimeThreshold
169+
{
170+
get => lowConfidenceTimeThreshold;
171+
set => lowConfidenceTimeThreshold = value;
172+
}
173+
173174

174175
#if OCULUSINTEGRATION_PRESENT
175176
[Header("Super sampling")]
@@ -189,8 +190,8 @@ public void ApplyConfiguredPerformanceSettings()
189190
{
190191
#if OCULUSINTEGRATION_PRESENT
191192
UnityEngine.XR.XRSettings.eyeTextureResolutionScale = resolutionScale;
192-
OVRManager.cpuLevel = CPULevel;
193-
OVRManager.gpuLevel = GPULevel;
193+
OVRManager.suggestedCpuPerfLevel = CPULevel;
194+
OVRManager.suggestedGpuPerfLevel = GPULevel;
194195

195196
if (OVRManager.fixedFoveatedRenderingSupported)
196197
{

Assets/MRTK/SDK/Features/UX/Scripts/Pointers/BaseControllerPointer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public virtual void Reset()
510510

511511
#endregion IMixedRealityPointer Implementation
512512

513-
#region IEquality Implementation
513+
#region IEquality Implementation
514514

515515
private static bool Equals(IMixedRealityPointer left, IMixedRealityPointer right)
516516
{
@@ -558,7 +558,7 @@ public override int GetHashCode()
558558

559559
#endregion IEquality Implementation
560560

561-
#region IMixedRealitySourcePoseHandler Implementation
561+
#region IMixedRealitySourcePoseHandler Implementation
562562

563563
private static readonly ProfilerMarker OnSourceLostPerfMarker = new ProfilerMarker("[MRTK] BaseControllerPointer.OnSourceLost");
564564

@@ -594,7 +594,7 @@ public override void OnSourceLost(SourceStateEventData eventData)
594594

595595
#endregion IMixedRealitySourcePoseHandler Implementation
596596

597-
#region IMixedRealityInputHandler Implementation
597+
#region IMixedRealityInputHandler Implementation
598598

599599
private static readonly ProfilerMarker OnInputUpPerfMarker = new ProfilerMarker("[MRTK] BaseControllerPointer.OnInputUp");
600600

Assets/MRTK/SDK/Features/UX/Scripts/RiggedHandVisualizer/RiggedHandVisualizer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,10 @@ public override void OnHandJointsUpdated(InputEventData<IDictionary<TrackedHandJ
320320
{
321321
TrackedHandJoint handJoint = (TrackedHandJoint)i;
322322
// Skip this hand joint if the event data doesn't have an entry for it
323-
if (!eventData.InputData.ContainsKey(handJoint))
323+
if (!eventData.InputData.TryGetValue(handJoint, out MixedRealityPose handJointPose))
324324
{
325325
continue;
326326
}
327-
MixedRealityPose handJointPose = eventData.InputData[handJoint];
328327
Transform jointTransform = riggedVisualJointsArray[i];
329328

330329
if (jointTransform != null)

0 commit comments

Comments
 (0)