Browse Source

make all joints white at the end of visualization step

Kenkart 2 years ago
parent
commit
627bed37d4
1 changed files with 14 additions and 2 deletions
  1. 14 2
      Assets/Scripts/BodyComparer.cs

+ 14 - 2
Assets/Scripts/BodyComparer.cs

@@ -58,6 +58,18 @@ public class BodyComparer : MonoBehaviour
 
             yield return new WaitForSeconds(waitTime);
         }
-        // TODO: make all of them white
-    }
+
+        // Make all joints white
+        Transform body = bsv.body.transform;
+        for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
+        {
+            // Skip these joints
+            if (jt == Kinect.JointType.Head || jt == Kinect.JointType.ThumbLeft || jt == Kinect.JointType.ThumbRight
+                    || jt == Kinect.JointType.HandLeft || jt == Kinect.JointType.HandRight
+                    || jt == Kinect.JointType.HandTipLeft || jt == Kinect.JointType.HandTipRight)
+                continue;
+
+            body.GetChild((int)jt).GetComponent<Renderer>().material.color = Color.white;
+        }
+     }
 }