|
@@ -334,41 +334,41 @@ public class BodySourceView : MonoBehaviour
|
|
|
rescaledJoints[(int)Kinect.JointType.AnkleRight] = initJoints[(int)Kinect.JointType.AnkleRight];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.KneeLeft] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.AnkleLeft], initJoints[(int)Kinect.JointType.KneeLeft], 0.4f);
|
|
|
+ initJoints[(int)Kinect.JointType.AnkleLeft], initJoints[(int)Kinect.JointType.KneeLeft], 0.4f) + rescaledJoints[(int)Kinect.JointType.AnkleLeft];
|
|
|
rescaledJoints[(int)Kinect.JointType.KneeRight] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.AnkleRight], initJoints[(int)Kinect.JointType.KneeRight], 0.4f);
|
|
|
+ initJoints[(int)Kinect.JointType.AnkleRight], initJoints[(int)Kinect.JointType.KneeRight], 0.4f) + rescaledJoints[(int)Kinect.JointType.AnkleRight];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.HipLeft] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.KneeLeft], initJoints[(int)Kinect.JointType.HipLeft], 0.25f);
|
|
|
+ initJoints[(int)Kinect.JointType.KneeLeft], initJoints[(int)Kinect.JointType.HipLeft], 0.25f) + rescaledJoints[(int)Kinect.JointType.KneeLeft];
|
|
|
rescaledJoints[(int)Kinect.JointType.HipRight] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.KneeRight], initJoints[(int)Kinect.JointType.HipRight], 0.25f);
|
|
|
+ initJoints[(int)Kinect.JointType.KneeRight], initJoints[(int)Kinect.JointType.HipRight], 0.25f) + rescaledJoints[(int)Kinect.JointType.KneeRight];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.SpineBase] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.HipLeft], initJoints[(int)Kinect.JointType.SpineBase], 0.08f);
|
|
|
+ initJoints[(int)Kinect.JointType.HipLeft], initJoints[(int)Kinect.JointType.SpineBase], 0.08f) + rescaledJoints[(int)Kinect.JointType.HipLeft];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.SpineMid] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.SpineBase], initJoints[(int)Kinect.JointType.SpineMid], 0.3f);
|
|
|
+ initJoints[(int)Kinect.JointType.SpineBase], initJoints[(int)Kinect.JointType.SpineMid], 0.3f) + rescaledJoints[(int)Kinect.JointType.SpineBase];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.SpineShoulder] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.SpineMid], initJoints[(int)Kinect.JointType.SpineShoulder], 0.2f);
|
|
|
+ initJoints[(int)Kinect.JointType.SpineMid], initJoints[(int)Kinect.JointType.SpineShoulder], 0.2f) + rescaledJoints[(int)Kinect.JointType.SpineMid];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.ShoulderLeft] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.ShoulderLeft], 0.15f);
|
|
|
+ initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.ShoulderLeft], 0.15f) + rescaledJoints[(int)Kinect.JointType.SpineShoulder];
|
|
|
rescaledJoints[(int)Kinect.JointType.ShoulderRight] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.ShoulderRight], 0.15f);
|
|
|
+ initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.ShoulderRight], 0.15f) + rescaledJoints[(int)Kinect.JointType.SpineShoulder];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.ElbowLeft] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.ShoulderLeft], initJoints[(int)Kinect.JointType.ElbowLeft], 0.25f);
|
|
|
+ initJoints[(int)Kinect.JointType.ShoulderLeft], initJoints[(int)Kinect.JointType.ElbowLeft], 0.25f) + rescaledJoints[(int)Kinect.JointType.ShoulderLeft];
|
|
|
rescaledJoints[(int)Kinect.JointType.ElbowRight] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.ShoulderRight], initJoints[(int)Kinect.JointType.ElbowRight], 0.25f);
|
|
|
+ initJoints[(int)Kinect.JointType.ShoulderRight], initJoints[(int)Kinect.JointType.ElbowRight], 0.25f) + rescaledJoints[(int)Kinect.JointType.ShoulderRight];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.WristLeft] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.ElbowLeft], initJoints[(int)Kinect.JointType.WristLeft], 0.2f);
|
|
|
+ initJoints[(int)Kinect.JointType.ElbowLeft], initJoints[(int)Kinect.JointType.WristLeft], 0.2f) + rescaledJoints[(int)Kinect.JointType.ElbowLeft];
|
|
|
rescaledJoints[(int)Kinect.JointType.WristRight] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.ElbowRight], initJoints[(int)Kinect.JointType.WristRight], 0.2f);
|
|
|
+ initJoints[(int)Kinect.JointType.ElbowRight], initJoints[(int)Kinect.JointType.WristRight], 0.2f) + rescaledJoints[(int)Kinect.JointType.ElbowRight];
|
|
|
|
|
|
rescaledJoints[(int)Kinect.JointType.Neck] = GetTargetJointWithDesiredLength(
|
|
|
- initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.Neck], 0.07f);
|
|
|
+ initJoints[(int)Kinect.JointType.SpineShoulder], initJoints[(int)Kinect.JointType.Neck], 0.07f) + rescaledJoints[(int)Kinect.JointType.SpineShoulder];
|
|
|
|
|
|
return rescaledJoints;
|
|
|
}
|
|
@@ -377,6 +377,6 @@ public class BodySourceView : MonoBehaviour
|
|
|
{
|
|
|
Vector3 sourceToTarget = target - source;
|
|
|
float length = sourceToTarget.magnitude;
|
|
|
- return sourceToTarget * desiredLength / length + source;
|
|
|
+ return sourceToTarget * desiredLength / length;
|
|
|
}
|
|
|
}
|