|
@@ -1,7 +1,6 @@
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
using Kinect = Windows.Kinect;
|
|
|
-using Valve.VR;
|
|
|
|
|
|
public class BodySourceView : MonoBehaviour
|
|
|
{
|
|
@@ -11,7 +10,6 @@ public class BodySourceView : MonoBehaviour
|
|
|
public PlayerReplay playerReplay;
|
|
|
public ModeController modeController;
|
|
|
|
|
|
- // TODO: Implementing color feedback
|
|
|
public GameObject body;
|
|
|
|
|
|
public bool wristLeftLate;
|
|
@@ -213,30 +211,6 @@ public class BodySourceView : MonoBehaviour
|
|
|
jointObj.GetComponent<Renderer>().enabled = false;
|
|
|
}
|
|
|
|
|
|
- // WristLeft and WristRight do something if not following the motions
|
|
|
- //if ((jt == Kinect.JointType.WristLeft && wristLeftLate) || (jt == Kinect.JointType.WristRight && wristRightLate))
|
|
|
- //{
|
|
|
- // if (modeController.feedback == ModeController.Feedback.ColorFeedback)
|
|
|
- // {
|
|
|
- // jointObj.GetComponent<Renderer>().material.color = new Color(1, 0, 0);
|
|
|
- // jointObj.GetComponent<LineRenderer>().startColor = new Color(1, 0, 0);
|
|
|
- // }
|
|
|
- // else if (modeController.feedback == ModeController.Feedback.HapticFeedback)
|
|
|
- // {
|
|
|
- // // TODO: Add haptic feedback need to test
|
|
|
- // if (jt == Kinect.JointType.WristLeft)
|
|
|
- // {
|
|
|
- // Debug.Log("WristLeft vibrate");
|
|
|
- // SteamVR_Actions.default_Haptic[SteamVR_Input_Sources.LeftHand].Execute(0, 0.01f, 10, 1);
|
|
|
- // }
|
|
|
- // else if (jt == Kinect.JointType.WristRight)
|
|
|
- // {
|
|
|
- // Debug.Log("WristRight vibrate");
|
|
|
- // SteamVR_Actions.default_Haptic[SteamVR_Input_Sources.RightHand].Execute(0, 0.01f, 10, 1);
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
LineRenderer lr = jointObj.GetComponent<LineRenderer>();
|
|
|
if (targetJoint.HasValue && jt != Kinect.JointType.Neck && jt != Kinect.JointType.ThumbLeft && jt != Kinect.JointType.ThumbRight
|
|
|
&& jt != Kinect.JointType.HandLeft && jt != Kinect.JointType.HandRight
|
|
@@ -259,36 +233,6 @@ public class BodySourceView : MonoBehaviour
|
|
|
// Record joints to PlayerReplay.cs
|
|
|
playerReplay.joints[(int)jt] = jointObj;
|
|
|
}
|
|
|
-
|
|
|
- // Joint orientations
|
|
|
- //Kinect.Vector4[] orientation = new Kinect.Vector4[22];
|
|
|
- //orientation[0] = body.JointOrientations[Kinect.JointType.Head].Orientation;
|
|
|
- //orientation[1] = body.JointOrientations[Kinect.JointType.Neck].Orientation;
|
|
|
- //orientation[2] = body.JointOrientations[Kinect.JointType.SpineMid].Orientation;
|
|
|
- //orientation[3] = body.JointOrientations[Kinect.JointType.ShoulderLeft].Orientation;
|
|
|
- //orientation[4] = body.JointOrientations[Kinect.JointType.ShoulderRight].Orientation;
|
|
|
- //orientation[5] = body.JointOrientations[Kinect.JointType.ElbowLeft].Orientation;
|
|
|
- //orientation[6] = body.JointOrientations[Kinect.JointType.ElbowRight].Orientation;
|
|
|
- //orientation[7] = body.JointOrientations[Kinect.JointType.WristLeft].Orientation;
|
|
|
- //orientation[8] = body.JointOrientations[Kinect.JointType.WristRight].Orientation;
|
|
|
- //orientation[9] = body.JointOrientations[Kinect.JointType.HipLeft].Orientation;
|
|
|
- //orientation[10] = body.JointOrientations[Kinect.JointType.HipRight].Orientation;
|
|
|
- //orientation[11] = body.JointOrientations[Kinect.JointType.KneeLeft].Orientation;
|
|
|
- //orientation[12] = body.JointOrientations[Kinect.JointType.KneeRight].Orientation;
|
|
|
- //orientation[13] = body.JointOrientations[Kinect.JointType.SpineBase].Orientation;
|
|
|
- //orientation[14] = body.JointOrientations[Kinect.JointType.AnkleLeft].Orientation;
|
|
|
- //orientation[15] = body.JointOrientations[Kinect.JointType.AnkleRight].Orientation;
|
|
|
- //orientation[16] = body.JointOrientations[Kinect.JointType.FootLeft].Orientation;
|
|
|
- //orientation[17] = body.JointOrientations[Kinect.JointType.FootRight].Orientation;
|
|
|
- //orientation[18] = body.JointOrientations[Kinect.JointType.HandLeft].Orientation;
|
|
|
- //orientation[19] = body.JointOrientations[Kinect.JointType.HandRight].Orientation;
|
|
|
- //orientation[20] = body.JointOrientations[Kinect.JointType.ThumbLeft].Orientation;
|
|
|
- //orientation[21] = body.JointOrientations[Kinect.JointType.ThumbRight].Orientation;
|
|
|
-
|
|
|
- //for (int j = 0; j < 22; j++)
|
|
|
- //{
|
|
|
- // //joints[j].rotation = ConvertKinectOrientationToUnity(orientation[j]);
|
|
|
- //}
|
|
|
}
|
|
|
|
|
|
private static Color GetColorForState(Kinect.TrackingState state)
|
|
@@ -309,7 +253,6 @@ public class BodySourceView : MonoBehaviour
|
|
|
private Vector3 GetVector3FromJoint(Kinect.Joint joint)
|
|
|
{
|
|
|
//return new Vector3(joint.Position.X * -10, joint.Position.Y * 10, joint.Position.Z * 10);
|
|
|
-
|
|
|
return new Vector3(joint.Position.X * -1, joint.Position.Y, joint.Position.Z);
|
|
|
}
|
|
|
|