Example #1
0
 private void UseAll_Unchecked(object sender, RoutedEventArgs e)
 {
     foreach (CompositeElement joint in bvhTo.BVH.JointList)
     {
         JointFrame jf = bvhTo.BVH.FrameList[0].GetJointFrame(joint.Name);
         jf.SetValue("Xrotation", 0.0);
     }
 }
Example #2
0
        public FrameElement(BVH bvh, string[] args)
            : this(bvh)
        {
            Queue <string> queue = new Queue <string>(args);

            foreach (CompositeElement joint in m_bvh.JointList)
            {
                JointFrame a = m_map[joint.Name];
                foreach (string channel in joint.Channels.ChannelList)
                {
                    a.SetValue(channel, double.Parse(queue.Dequeue()));
                }
            }
            if (queue.Count != 0)
            {
                throw new InvalidDataException();
            }
        }
        private FrameElement ConvertFrame(BVH dest, FrameElement srcFrame)
        {
            FrameElement destFrame = new FrameElement(dest);

            foreach (CompositeElement joint in dest.JointList)
            {
                JointFrame jfDest = destFrame.GetJointFrame(joint.Name);
                JointFrame jfSrc  = srcFrame.GetJointFrame(GetSrcJointName(joint.Name));
                if (jfSrc == null)
                {
                    continue;
                }

                foreach (string channel in new string[] { "Zrotation", "Xrotation", "Yrotation" })
                {
                    jfDest.SetValue(channel, jfSrc.GetValue(channel));
                }

                ConvertJointFrame(jfDest, joint.Name, srcFrame);
            }
            return(destFrame);
        }