Пример #1
0
            public override Status Step(Vector pos, out Vector stepped, out float stepLength)
            {
                // One predictor step.
                Status status = Predictor.Step(pos, out stepped, out stepLength);

                if (status != Status.OK)
                {
                    return(status);
                }
                // Now, step until the corrector reaches a critical point.
                Vector point;
                Vector next = stepped;

                if (CheckPosition(next) != Status.OK)
                {
                    StepBorder(pos, out stepped, out stepLength);
                    return(CheckPosition(stepped));
                }
                int step = -1;

                do
                {
                    step++;
                    point  = next;
                    status = Corrector.Step(point, out next, out stepLength);
                } while (status == Status.OK && step < Corrector.MaxNumSteps);

                if (status == Status.CP)
                {
                    return(Status.OK);
                }
                return(status);
            }