|
@@ -1,6 +1,7 @@
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using Kinect = Windows.Kinect;
|
|
|
+using Valve.VR;
|
|
|
|
|
|
public class BodySourceView : MonoBehaviour
|
|
|
{
|
|
@@ -191,10 +192,19 @@ public class BodySourceView : MonoBehaviour
|
|
|
jointObj.GetComponent<Renderer>().enabled = false;
|
|
|
}
|
|
|
|
|
|
- // WristLeft and WristRight change to red color if not following the motions
|
|
|
+ // WristLeft and WristRight do something if not following the motions
|
|
|
if ((jt == Kinect.JointType.WristLeft && wristLeftLate) || (jt == Kinect.JointType.WristRight && wristRightLate))
|
|
|
{
|
|
|
- jointObj.GetComponent<Renderer>().material.color = new Color(1, 0, 0);
|
|
|
+ if (modeController.feedback == ModeController.Feedback.ColorFeedback)
|
|
|
+ {
|
|
|
+ // Change to red color
|
|
|
+ jointObj.GetComponent<Renderer>().material.color = new Color(1, 0, 0);
|
|
|
+ } else if (modeController.feedback == ModeController.Feedback.HapticFeedback)
|
|
|
+ {
|
|
|
+ // TODO: Add haptic feedback need to test
|
|
|
+ SteamVR_Actions.default_Haptic[SteamVR_Input_Sources.LeftHand].Execute(0, 1, 10, 1);
|
|
|
+ SteamVR_Actions.default_Haptic[SteamVR_Input_Sources.RightHand].Execute(0, 1, 10, 1);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
LineRenderer lr = jointObj.GetComponent<LineRenderer>();
|