Beispiel #1
0
        public void EditLine(SkeletonData incSkeletonData, int incNumTicksPerSec, int Xmin, int Xmax)
        {
            incNumTicksPerSec /= 2;
            int   totalXWidth = Xmax - Xmin;
            float LeftY       = incSkeletonData.Joints[JointID.HandLeft].Position.Y;
            float RightY      = incSkeletonData.Joints[JointID.HandRight].Position.Y;

            float DeltaB = 0;
            float DeltaM = 0;

            for (int i = 0; i < mCurrentSelectedLine.Points.Count; i++)
            {
                DeltaB = Truncate((LeftY - mOrgB.Y) * B_SCALER * totalXWidth / 10);
                DeltaM = Truncate((RightY - mOrgM.Y) * M_SCALER);
                double x;
                double y;
                x = i * (1.0f / (float)incNumTicksPerSec) + Xmin;
                y = (mCurrentSelectedLine.m + DeltaM) * x + (mCurrentSelectedLine.b + DeltaB);
                mCurrentSelectedLine.SetY(mCurrentSelectedLine.Title, i, y, incNumTicksPerSec);
                //mWindow.TableValues.Items.Add(Truncate(x) + "\t\t" + Truncate(y));
            }
            mNewMHolder = Truncate(mCurrentSelectedLine.m + DeltaM);
            mNewBHolder = Truncate(mCurrentSelectedLine.b + DeltaB);

            UpdateEquation(mNewMHolder, mNewBHolder);
        }