|
@@ -8,6 +8,7 @@ public class PlayerReplay : MonoBehaviour
|
|
|
{
|
|
|
|
|
|
public Transform[] joints = new Transform[25];
|
|
|
+
|
|
|
public List<Vector3[]> jointsSequence = new List<Vector3[]>();
|
|
|
public List<float> recordingTimes = new List<float>();
|
|
|
public Material boneMaterial;
|
|
@@ -82,6 +83,12 @@ public class PlayerReplay : MonoBehaviour
|
|
|
recordingTimes.Add(recordingTime);
|
|
|
}
|
|
|
|
|
|
+ public void ResetRecording()
|
|
|
+ {
|
|
|
+ jointsSequence.Clear();
|
|
|
+ recordingTimes.Clear();
|
|
|
+ }
|
|
|
+
|
|
|
public void Save()
|
|
|
{
|
|
|
if (jointsSequence.Count == 0)
|
|
@@ -136,8 +143,7 @@ public class PlayerReplay : MonoBehaviour
|
|
|
Vector3 jointPosition = new Vector3(jd.jointsPositionsX[(int)jt], jd.jointsPositionsY[(int)jt], jd.jointsPositionsZ[(int)jt]);
|
|
|
float distance = Vector3.Distance(prevJointPosition, jointPosition);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if (distance >= 2)
|
|
|
{
|
|
|
newJointsData.Add(jd);
|
|
@@ -148,7 +154,6 @@ public class PlayerReplay : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
StartCoroutine(Visualize(newJointsData, newRecordingTimes));
|
|
|
}
|
|
|
|
|
@@ -167,7 +172,7 @@ public class PlayerReplay : MonoBehaviour
|
|
|
GameObject body = new GameObject("Recorded Body " + i);
|
|
|
for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
if (jt == Kinect.JointType.Head)
|
|
|
continue;
|
|
|
|
|
@@ -189,7 +194,7 @@ public class PlayerReplay : MonoBehaviour
|
|
|
|
|
|
for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
if (!_BoneMap.ContainsKey(jt) || jt == Kinect.JointType.Neck)
|
|
|
continue;
|
|
|
|