Ejemplo n.º 1
0
 public GoSpline(List <Vector3> nodes, bool useStraightLines = false)
 {
     if (useStraightLines || nodes.Count == 2)
     {
         splineType = GoSplineType.StraightLine;
         _solver    = new GoSplineStraightLineSolver(nodes);
     }
     else if (nodes.Count == 3)
     {
         splineType = GoSplineType.QuadraticBezier;
         _solver    = new GoSplineQuadraticBezierSolver(nodes);
     }
     else if (nodes.Count == 4)
     {
         splineType = GoSplineType.CubicBezier;
         _solver    = new GoSplineCubicBezierSolver(nodes);
     }
     else
     {
         splineType = GoSplineType.CatmullRom;
         _solver    = new GoSplineCatmullRomSolver(nodes);
     }
 }
Ejemplo n.º 2
0
 // default constructor
 public GoSpline(List <Vector3> nodes, bool useStraightLines = false)
 {
     // determine spline typeEnum and solver based on number of nodes
     if (useStraightLines || nodes.Count == 2)
     {
         splineType = GoSplineType.StraightLine;
         _solver    = new GoSplineStraightLineSolver(nodes);
     }
     else if (nodes.Count == 3)
     {
         splineType = GoSplineType.QuadraticBezier;
         _solver    = new GoSplineQuadraticBezierSolver(nodes);
     }
     else if (nodes.Count == 4)
     {
         splineType = GoSplineType.CubicBezier;
         _solver    = new GoSplineCubicBezierSolver(nodes);
     }
     else
     {
         splineType = GoSplineType.CatmullRom;
         _solver    = new GoSplineCatmullRomSolver(nodes);
     }
 }
Ejemplo n.º 3
0
	// default constructor
	public GoSpline( List<Vector3> nodes, bool useStraightLines = false )
	{
		// determine spline type and solver based on number of nodes
		if( useStraightLines || nodes.Count == 2 )
		{
			splineType = GoSplineType.StraightLine;
			_solver = new GoSplineStraightLineSolver( nodes );
		}
		else if( nodes.Count == 3 )
		{
			splineType = GoSplineType.QuadraticBezier;
			_solver = new GoSplineQuadraticBezierSolver( nodes );
		}
		else if( nodes.Count == 4 )
		{
			splineType = GoSplineType.CubicBezier;
			_solver = new GoSplineCubicBezierSolver( nodes );
		}
		else
		{
			splineType = GoSplineType.CatmullRom;
			_solver = new GoSplineCatmullRomSolver( nodes );
		}
	}