示例#1
0
        /// <summary>
        /// Calculates a FrameCalc from a given frame.
        /// </summary>
        /// <param name="arr">Frame values.</param>
        /// <returns>FrameCalc of this node.</returns>
        public FrameCalc calc_fc_from_frame(float[] arr)
        {
            FrameCalc frame = new FrameCalc(this.Name, this.Offset);

            for (int i = 0; i < Channels.Length; i++)
            {
                BoneChannel bc = Channels[i];
                frame.update_channel_values(bc.channel, arr[bc.pifl]);
            }

            return(frame);
        }
示例#2
0
        /// <summary>
        /// analyze channels from string
        /// </summary>
        /// <param name="str">channels as string</param>
        /// <returns>array of BoneChannel</returns>
        private BoneChannel[] StringToChannels(string str)
        {
            str = StringProccesing.CleanUp(str);
            str = str.Replace("  ", " ");
            string[]      arr   = str.Split(' ');
            BoneChannel[] chans = new BoneChannel[arr.Length];
            for (int i = 0; i < arr.Length; i++)
            {
                chans[i] = new BoneChannel(this, arr[i]);
            }

            return(chans);
        }