Example #1
0
        private BezierCurve Repro(BezierCurve bezierCurve)
        {
            int     pointIndex = RandomThreadStatic.Next(1, _bezierControlPointsCount + 1);
            Vector3 direction  = RandomThreadStatic.NextPointCube(1);

            var bezierCurveRepro     = new BezierCurve(bezierCurve.Points);
            var bezierDirectionRepro = Vector3.Normalize(direction) * 1f * (float)RandomThreadStatic.NextDouble();

            bezierCurveRepro.Points[pointIndex] += bezierDirectionRepro;

            if (_manipulator.ApproxWithinReach(bezierCurveRepro.Points[pointIndex] + bezierDirectionRepro))
            {
                bezierCurveRepro.Points[pointIndex] += bezierDirectionRepro;
            }
            else
            {
                bezierCurveRepro.Points[pointIndex] -= bezierDirectionRepro;
            }

            return(bezierCurveRepro);
        }