Assets/SplineTool/Scripts/CorgiSpline/Spline.cs
/// <summary>
/// Updates the Space of this Spline. 
/// Optionally automatically recalculates the stored Points to keep their relative world position stable when swapping spaces.
/// </summary>
/// <param name="space"></param>
Updates the Space of this Spline.
Optionally automatically recalculates the stored Points to keep their relative world position stable when swapping spaces.
Updates the Space of this Spline . Optionally automatically recalculates the stored Points to keep their relative world position stable when swapping spaces .
public void SetSplineSpace(Space space, bool updatePoints)
        {
            var previous = SplineSpace;
            if (previous != space)
            {
                if (updatePoints)
                {
                    for (var i = 0; i < Points.Length; ++i)
                    {
                        var point = Points[i];
                        switch (space)
                        {
                            case Space.Self:
                                point = InverseTransformSplinePoint(point);
                                break;
                            case Space.World:
                                point = TransformSplinePoint(point);
                                break;
                        }
                        Points[i] = point;
                    }
                }
                SplineSpace = space;
            }
        }
public void SetSplineSpace ( Space space , bool updatePoints ) { var previous = SplineSpace ; if ( previous != space ) { if ( updatePoints ) { for ( var i = 0 ; i < Points . Length ; ++ i ) { var point = Points [ i ] ; switch ( space ) { case Space . Self : point = InverseTransformSplinePoint ( point ) ; break ; case Space . World : point = TransformSplinePoint ( point ) ; break ; } Points [ i ] = point ; } } SplineSpace = space ; } }
Updates the Space of this Spline.
Updates the Space of this Spline .
space
Space
None
updatePoints
bool