public KinectUser Initialize(Body b) { id = b.TrackingId; bodyParts = new List <KinectBodyPart>(); leftHandState = b.HandLeftState.ToString(); rightHandState = b.HandRightState.ToString(); foreach (var j in b?.Joints?.Values) { var part = KinectBodyPart.Create(j); bodyParts.Add(part); } return(this); }
private void BodyPartsPosititons(JsonTextWriter jw, KinectBodyPart bodyParts) { jw.WritePropertyName(POSITIONS); jw.WriteStartArray(); jw.WriteStartObject(); var size = bodyParts.position.Length; if (size != AXIS.Length) { throw new Exception(ERROR_EN_LAS_COORDENADAS_LEIDAS); } for (int i = 0; i < size; i++) { ToPairKeyValue(jw, AXIS[i], bodyParts.position[i]); } jw.WriteEndObject(); jw.WriteEndArray(); }