コード例 #1
0
                public override void Unserialize(GMDataReader reader)
                {
                    Interpolation = (InterpolationEnum)reader.ReadInt32();

                    List = new GMList <Keyframe <Data> >();
                    List.Unserialize(reader);
                }
コード例 #2
0
        public string set_interpolation(InterpolationEnum interpolation)
        {
            try
            {
                this.Excel_yieldCurveViewModel_.Excel_interpolationViewModel_
                    = new Excel_interpolationViewModel();

                return("load complete");
            }
            catch (Exception e)
            {
                return("load fail : " + e.Message);
            }
        }
コード例 #3
0
        public static Vector3 GetPointAlongSpline(SplinePoint[] points, float normalizedLength, InterpolationEnum interpolation = InterpolationEnum.Bezeir)
        {
            int   pointIndex          = (Mathf.RoundToInt(normalizedLength * points.Length));
            float subnormalizedLength = normalizedLength - ((float)pointIndex / points.Length);

            if (pointIndex + 3 >= points.Length)
            {
                return(points[points.Length - 1].Point);
            }
            if (pointIndex < 0)
            {
                return(points[0].Point);
            }

            Vector3 point1 = points[pointIndex].Point;
            Vector3 point2 = points[pointIndex + 1].Point;
            Vector3 point3 = points[pointIndex + 2].Point;
            Vector3 point4 = points[pointIndex + 3].Point;

            switch (interpolation)
            {
            case InterpolationEnum.Bezeir:
            default:
                return(InterpolateBezeirPoints(point1, point2, point3, point4, subnormalizedLength));

            case InterpolationEnum.CatmullRom:
                return(InterpolateCatmullRomPoints(point1, point2, point3, point4, subnormalizedLength));
            }
        }
コード例 #4
0
        public string set_interpolation(InterpolationEnum interpolation)
        {
            try
            {
                this.Excel_yieldCurveViewModel_.Excel_interpolationViewModel_
                    = new Excel_interpolationViewModel();

                return "load complete";
            }
            catch (Exception e)
            {
                return "load fail : " + e.Message;
            }
        }