コード例 #1
0
        private void DrawBone(NBody body, NJointType j0, NJointType j1)
        {
            NJoint joint0 = body.Joints[j0];
            NJoint joint1 = body.Joints[j1];

            if (j0 == NJointType.Neck && joint0 == null)
            {
                joint0 = body.Joints[NJointType.SpineShoulder];
            }
            else if (j1 == NJointType.Neck && joint1 == null)
            {
                joint1 = body.Joints[NJointType.SpineShoulder];
            }

            if (joint0 == null || joint1 == null)
            {
                return;
            }

            // If we can't find either of these joints, exit
            if (joint0.Tracking == NTrackingState.NotTracked ||
                joint1.Tracking == NTrackingState.NotTracked)
            {
                return;
            }

            // Don't draw if both points are inferred
            if (joint0.Tracking == NTrackingState.Inferred &&
                joint1.Tracking == NTrackingState.Inferred)
            {
                return;
            }

            buffer.DrawPolyline(new System.Drawing.Point[] { joint0.Position2D, joint1.Position2D }, false, brdBlue, 10);
        }
コード例 #2
0
 public NJoint GetJoint(NJointType ntype) {
   if (Joints.ContainsKey(ntype) && Joints[ntype] != null) {
     return Joints[ntype];
   }
   
   var njoint = new NJoint(ntype, this);
   Joints[ntype] = njoint;
   return njoint;
 }
コード例 #3
0
        public NJoint GetJoint(NJointType ntype)
        {
            if (Joints.ContainsKey(ntype) && Joints[ntype] != null)
            {
                return(Joints[ntype]);
            }

            var njoint = new NJoint(ntype, this);

            Joints[ntype] = njoint;
            return(njoint);
        }
コード例 #4
0
    private void DrawBone(NBody body, NJointType j0, NJointType j1) {

      NJoint joint0 = body.Joints[j0];
      NJoint joint1 = body.Joints[j1];

      if (j0 == NJointType.Neck && joint0 == null) {
        joint0 = body.Joints[NJointType.SpineShoulder];
      } else if (j1 == NJointType.Neck && joint1 == null) {
        joint1 = body.Joints[NJointType.SpineShoulder];
      }

      if (joint0 == null || joint1 == null) { return; }

      // If we can't find either of these joints, exit
      if (joint0.Tracking == NTrackingState.NotTracked ||
          joint1.Tracking == NTrackingState.NotTracked) { return; }

      // Don't draw if both points are inferred
      if (joint0.Tracking == NTrackingState.Inferred &&
          joint1.Tracking == NTrackingState.Inferred) { return; }

      buffer.DrawPolyline(new System.Drawing.Point[] { joint0.Position2D, joint1.Position2D }, false, brdBlue, 10);
    }
コード例 #5
0
 public NJoint(NJointType type, NBody body) { 
   Type = type;
   Body = body;
 }
コード例 #6
0
 public NJoint(NJointType type, NBody body)
 {
     Type = type;
     Body = body;
 }