示例#1
0
        void AddToJointList(XmlNode skel, string jointstr, List <JointGait> joints)
        {
            JointTypeGait jointType;

            Enum.TryParse <JointTypeGait>(jointstr, out jointType);

            if (skel != null && skel[jointstr] != null)
            {
                string[] line = skel[jointstr].InnerText.Split(',');

                TrackingStateGait ts = StringToTrackingState(line[0]);

                float x, y, z, depthX, depthY;
                float.TryParse(line[1], out x);
                float.TryParse(line[2], out y);
                float.TryParse(line[3], out z);
                float.TryParse(line[4], out depthX);
                float.TryParse(line[5], out depthY);

                JointGait joint = new JointGait()
                {
                    X = x, Y = y, Z = z, DepthX = depthX, DepthY = depthY, JointType = jointType, TrackingState = ts
                };
                joints.Add(joint);
            }
            else
            {
                joints.Add(new JointGait()
                {
                    JointType = jointType
                });
            }
        }
示例#2
0
        Vector orthogonal(JointGait v1, Vector v2)
        {
            Vector v1t = new Vector();

            v1t.X = v1.X;
            v1t.Y = v1.Y;
            v1t.Z = v1.Z;
            return(orthogonal(v1t, v2));
        }
示例#3
0
 Vector diff(JointGait j1, JointGait j2)
 {
     return(new Vector(j1.X - j2.X, j1.Y - j2.Y, j1.Z - j2.Z));
 }