File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Assets/MRTK/SDK/Features/UX/Scripts/PulseShader Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -188,20 +188,14 @@ public void PulseFingerTips()
188
188
// Check if the palm is facing the camera
189
189
private bool IsAPalmFacingCamera ( )
190
190
{
191
- foreach ( IMixedRealityController c in CoreServices . InputSystem . DetectedControllers )
191
+ foreach ( IMixedRealityController controller in CoreServices . InputSystem . DetectedControllers )
192
192
{
193
- if ( c . ControllerHandedness . IsMatch ( Handedness . Both ) )
193
+ if ( controller . ControllerHandedness . IsMatch ( Handedness . Both )
194
+ && controller is IMixedRealityHand jointedHand
195
+ && jointedHand . TryGetJoint ( TrackedHandJoint . Palm , out MixedRealityPose palmPose )
196
+ && Vector3 . Dot ( palmPose . Up , CameraCache . Main . transform . forward ) > 0.0f )
194
197
{
195
- MixedRealityPose palmPose ;
196
- var jointedHand = c as IMixedRealityHand ;
197
-
198
- if ( ( jointedHand != null ) && jointedHand . TryGetJoint ( TrackedHandJoint . Palm , out palmPose ) )
199
- {
200
- if ( Vector3 . Dot ( palmPose . Up , CameraCache . Main . transform . forward ) > 0.0f )
201
- {
202
- return true ;
203
- }
204
- }
198
+ return true ;
205
199
}
206
200
}
207
201
You can’t perform that action at this time.
0 commit comments