コード例 #1
0
        private List <KinectUser> createNewKinect(Body[] bodies)
        {
            var users = new List <KinectUser>();

            var length = bodies.Length;

            for (int i = 0; i < length; i++)
            {
                var body = bodies[i];
                if (!body.IsTracked)
                {
                    continue;
                }

                var kinectuser = KinectUser.Create(body);
                users.Add(kinectuser);
            }

            return(users);
        }
コード例 #2
0
        private void BodyPartsProperties(JsonTextWriter jw, KinectUser user)
        {
            jw.WritePropertyName(BODY_PARTS);
            jw.WriteStartArray();

            foreach (var bodyParts in user.bodyParts)
            {
                jw.WriteStartObject();

                ToPairKeyValue(jw, NAME, bodyParts.name);
                ToPairKeyValue(jw, IS_PRESENT, bodyParts.present);
                ToPairKeyValue(jw, IS_TRACKED, bodyParts.tracked);

                this.BodyPartsPosititons(jw, bodyParts);

                jw.WriteEndObject();
            }

            jw.WriteEndArray();
            jw.WriteEndObject();
        }