예제 #1
0
 public SkeletonJoint getJoint(SkeletonJoint.JointType type)
 {
     if (!_states.ContainsKey(type))
     {
         _states[type] = new SkeletonJoint(Skeleton_getJoint(this.Handle, type));
     }
     return(_states[type]);
 }
예제 #2
0
        public SkeletonJoint GetJoint(SkeletonJoint.JointType type)
        {
            if (!states.ContainsKey(type))
            {
                states[type] = new SkeletonJoint(Skeleton_getJoint(Handle, type));
            }

            return(states[type]);
        }
예제 #3
0
        private void DrawLineBetweenJoints(
            Graphics g,
            Skeleton skel,
            SkeletonJoint.JointType j1,
            SkeletonJoint.JointType j2)
        {
            try
            {
                if (skel.State == Skeleton.SkeletonState.Tracked)
                {
                    var joint1 = skel.GetJoint(j1);
                    var joint2 = skel.GetJoint(j2);

                    if (joint1.Position.Z > 0 && joint2.Position.Z > 0)
                    {
                        var joint1PosEllipse = new Point();
                        var joint2PosEllipse = new Point();
                        var joint1PosLine    = userTracker.ConvertJointCoordinatesToDepth(joint1.Position);
                        var joint2PosLine    = userTracker.ConvertJointCoordinatesToDepth(joint2.Position);
                        joint1PosEllipse.X = (int)joint1PosLine.X - 5;
                        joint1PosEllipse.Y = (int)joint1PosLine.Y - 5;
                        joint2PosEllipse.X = (int)joint2PosLine.X - 5;
                        joint2PosEllipse.Y = (int)joint2PosLine.Y - 5;
                        joint1PosLine.X   -= 2;
                        joint1PosLine.Y   -= 2;
                        joint2PosLine.X   -= 2;
                        joint2PosLine.Y   -= 2;
                        g.DrawLine(new Pen(Brushes.White, 3), joint1PosLine, joint2PosLine);
                        g.DrawEllipse(new Pen(Brushes.White, 5), new Rectangle(joint1PosEllipse, new Size(5, 5)));
                        g.DrawEllipse(new Pen(Brushes.White, 5), new Rectangle(joint2PosEllipse, new Size(5, 5)));
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #4
0
 private static extern IntPtr Skeleton_getJoint(IntPtr objectHandler, SkeletonJoint.JointType type);