Beispiel #1
0
        /// <summary>
        ///     If num curve sections are identical, adds the curve coefficients together, keeping the limits of this curve
        /// </summary>
        /// <param name="otherCurve"></param>
        public void AddCurve(FARFloatCurve otherCurve)
        {
            if (sections.Length != otherCurve.sections.Length)
            {
                throw new ArgumentException("Section array lengths do not match");
            }

            for (int i = 0; i < sections.Length; ++i)
            {
                CubicSection tmpSection = sections[i];
                CubicSection addSection = otherCurve.sections[i];

                tmpSection.a += addSection.a;
                tmpSection.b += addSection.b;
                tmpSection.c += addSection.c;
                tmpSection.d += addSection.d;

                sections[i] = tmpSection;
            }
        }
        /// <summary>
        /// If num curve sections are identical, adds the curve coefficients together, keeping the limits of this curve
        /// </summary>
        /// <param name="otherCurve"></param>
        public void AddCurve(FARFloatCurve otherCurve)
        {
            if (sections.Length != otherCurve.sections.Length)
                throw new ArgumentException("Section array lengths do not match");

            for(int i = 0; i < sections.Length; ++i)
            {
                CubicSection tmpSection = sections[i];
                CubicSection addSection = otherCurve.sections[i];

                tmpSection.a += addSection.a;
                tmpSection.b += addSection.b;
                tmpSection.c += addSection.c;
                tmpSection.d += addSection.d;

                sections[i] = tmpSection;
            }
        }