Browse Source

make head joint invisible

Kenkart 2 years ago
parent
commit
290b985b5f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Assets/KinectView/Scripts/BodySourceView.cs

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

@@ -147,13 +147,17 @@ public class BodySourceView : MonoBehaviour
             Transform jointObj = bodyObject.transform.Find(jt.ToString());
             jointObj.localPosition = GetVector3FromJoint(sourceJoint);
 
+            // Make head joint invisible (need to test)
+            jointObj.GetComponent<Renderer>().enabled = false;
+
+            // Make camera follow the head
             if (jt == Kinect.JointType.Head)
             {
                 cameraRig.localPosition = new Vector3(jointObj.localPosition.x, jointObj.localPosition.y - 1, jointObj.localPosition.z);
             }
 
             LineRenderer lr = jointObj.GetComponent<LineRenderer>();
-            if (targetJoint.HasValue)
+            if (targetJoint.HasValue && targetJoint != body.Joints[_BoneMap[Kinect.JointType.Head]]) // (need to test)
             {
                 lr.SetPosition(0, jointObj.localPosition);
                 lr.SetPosition(1, GetVector3FromJoint(targetJoint.Value));