示例#1
0
 public Skeleton(SkeletonJoint[] joints, ulong id, float[] lean, int state)
 {
     this.joints = joints;
     this.ID = id;
     var leanp = new PointF();
     leanp.X = lean[1];
     leanp.Y = lean[2];
     this.Lean = leanp;
     this.LeanTrackingState = (TrackingState)(int)lean[0];
     this.State = state;
 }
示例#2
0
 public Skeleton(Body body)
 {
     this.ID = body.TrackingId;
     this.Lean = body.Lean;
     this.LeanTrackingState = (TrackingState)body.LeanTrackingState;
     this.State |= body.IsRestricted ? 0x01 : 0x00;
     this.State |= body.HandLeftState == HandState.Closed ? 0x02 : body.HandLeftState == HandState.Open ? 0x04 : body.HandLeftState == HandState.Lasso ? 0x08 : 0x00;
     this.State |= body.HandRightState == HandState.Closed ? 0x20 : body.HandRightState == HandState.Open ? 0x40 : body.HandRightState == HandState.Lasso ? 0x80 : 0x00;
     this.joints = new SkeletonJoint[Body.JointCount];
     for (int i = 0; i < Body.JointCount; ++i)
     {
         joints[i] = new SkeletonJoint(body.Joints[(JointType)i], body.JointOrientations[(JointType)i]);
     }
 }
示例#3
0
 internal Skeleton ToSkeleton()
 {
     var joints = new SkeletonJoint[]
     {
         new SkeletonJoint(0,this.SpineBase),
         new SkeletonJoint(1,this.SpineMid),
         new SkeletonJoint(2,this.Neck),
         new SkeletonJoint(3,this.Head),
         new SkeletonJoint(4,this.ShoulderLeft),
         new SkeletonJoint(5,this.ElbowLeft),
         new SkeletonJoint(6,this.WristLeft),
         new SkeletonJoint(7,this.HandLeft),
         new SkeletonJoint(8,this.ShoulderRight),
         new SkeletonJoint(9,this.ElbowRight),
         new SkeletonJoint(10,this.WristRight),
         new SkeletonJoint(11,this.HandRight),
         new SkeletonJoint(12,this.HipLeft),
         new SkeletonJoint(13,this.KneeLeft),
         new SkeletonJoint(14,this.AnkleLeft),
         new SkeletonJoint(15,this.FootLeft),
         new SkeletonJoint(16,this.HipRight),
         new SkeletonJoint(17,this.KneeRight),
         new SkeletonJoint(18,this.AnkleRight),
         new SkeletonJoint(19,this.FootRight),
         new SkeletonJoint(20,this.SpineShoulder),
         new SkeletonJoint(21,this.HandTipLeft),
         new SkeletonJoint(22,this.ThumbLeft),
         new SkeletonJoint(23,this.HandTipRight),
         new SkeletonJoint(24,this.ThumbRight)
     };
     return new Skeleton(joints, this.ID, this.LeanState, this.State);
 }