|
@@ -17,6 +17,21 @@ public class BodyComparer : MonoBehaviour
|
|
|
private List<List<Vector3>> posJointsBodys = new List<List<Vector3>>();
|
|
|
private List<float> csvTimes = new List<float>();
|
|
|
|
|
|
+ private bool isComparing;
|
|
|
+ public bool endStepsPressed;
|
|
|
+
|
|
|
+ private void Update()
|
|
|
+ {
|
|
|
+ if (!isComparing)
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (SteamVR_Actions.default_GrabPinch.GetStateDown(SteamVR_Input_Sources.Any) || Input.GetKeyDown(KeyCode.Space))
|
|
|
+ {
|
|
|
+ isComparing = false;
|
|
|
+ endStepsPressed = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void SetDataDemo(List<JointsData> jointsDataDemo, List<float> recordingTimesDemo)
|
|
|
{
|
|
|
this.jointsDataDemo = jointsDataDemo;
|
|
@@ -31,6 +46,8 @@ public class BodyComparer : MonoBehaviour
|
|
|
yield break;
|
|
|
}
|
|
|
|
|
|
+ isComparing = true;
|
|
|
+
|
|
|
for (int i = 0; i < jointsDataDemo.Count; i++)
|
|
|
{
|
|
|
Transform body = bsv.body.transform;
|
|
@@ -88,8 +105,8 @@ public class BodyComparer : MonoBehaviour
|
|
|
posJointsBodys.Add(oneBodyReal);
|
|
|
csvTimes.Add(viveInput.csvTime);
|
|
|
|
|
|
- float waitTime = 0.01f;
|
|
|
- if (i < recordingTimesDemo.Count - 1)
|
|
|
+ float waitTime = 0;
|
|
|
+ if (isComparing && i < recordingTimesDemo.Count - 1)
|
|
|
{
|
|
|
waitTime = recordingTimesDemo[i + 1] - recordingTimesDemo[i];
|
|
|
}
|
|
@@ -97,6 +114,8 @@ public class BodyComparer : MonoBehaviour
|
|
|
yield return new WaitForSeconds(waitTime);
|
|
|
}
|
|
|
|
|
|
+ isComparing = false;
|
|
|
+
|
|
|
// Make all joints white
|
|
|
Transform bodyEnd = bsv.body.transform;
|
|
|
for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
|