Browse Source

make shoulders shorter

Kenkart 2 years ago
parent
commit
9970408bc3
1 changed files with 10 additions and 1 deletions
  1. 10 1
      Assets/KinectView/Scripts/BodySourceView.cs

+ 10 - 1
Assets/KinectView/Scripts/BodySourceView.cs

@@ -288,8 +288,17 @@ public class BodySourceView : MonoBehaviour
 
     private static Vector3 GetVector3FromJoint(Kinect.Joint joint)
     {
-        // TODO: modify to make joints more accurate
         //return new Vector3(joint.Position.X * -10, joint.Position.Y * 10, joint.Position.Z * 10);
+
+        // TODO: change offset to be more realistic
+        if (joint.JointType == Kinect.JointType.ShoulderLeft)
+        {
+            return new Vector3(joint.Position.X * -1 + 0.1f, joint.Position.Y * 1, joint.Position.Z * 1);
+        } else if (joint.JointType == Kinect.JointType.ShoulderRight)
+        {
+            return new Vector3(joint.Position.X * -1 - 0.1f, joint.Position.Y * 1, joint.Position.Z * 1);
+        }
+
         return new Vector3(joint.Position.X * -1, joint.Position.Y * 1, joint.Position.Z * 1);
     }