示例#1
0
        private void Update(float updatePeriod)
        {
            //timeSec += e.Time;
            //var seconds = (float)timeSec;
            var seconds       = (float)timeSource.Elapsed.TotalSeconds;
            var activeSegment = CatmullRomSpline.FindSegment(seconds, wayPoints.Count);
            var pos           = CatmullRomSpline.EvaluateSegment(wayPoints[activeSegment.Item1]
                                                                 , wayPoints[activeSegment.Item2]
                                                                 , wayTangents[activeSegment.Item1]
                                                                 , wayTangents[activeSegment.Item2]
                                                                 , seconds - (float)Math.Floor(seconds));

            bird.CenterX = pos.X;
            bird.CenterY = pos.Y;
        }