瀏覽代碼

make head joint invisible

Kenkart 2 年之前
父節點
當前提交
290b985b5f
共有 1 個文件被更改,包括 5 次插入1 次删除
  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));