Assets/SplineTool/Scripts/CorgiSpline/Spline.cs
/// <summary>
/// Returns a world space forward, given an input t. t is valid from 0 to 1.
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
Returns a world space forward, given an input t. t is valid from 0 to 1.
Returns a world space forward given an input t . t is valid from 0 to 1 .
public Vector3 GetForward(float t)
        {
            var delta_t = 1f / 256f;
            var p0 = GetPoint(t - delta_t * 1);
            var p1 = GetPoint(t + delta_t * 1);
            var vec = (p1.position - p0.position);
            var forward = vec.sqrMagnitude > 0 ? vec.normalized : Vector3.forward;
            if (SplineSpace == Space.Self)
            {
                return transform.TransformDirection(forward);
            }
            else
            {
                return forward;
            }
        }
public Vector3 GetForward ( float t ) { var delta_t = 1f / 256f ; var p0 = GetPoint ( t - delta_t * 1 ) ; var p1 = GetPoint ( t + delta_t * 1 ) ; var vec = ( p1 . position - p0 . position ) ; var forward = vec . sqrMagnitude > 0 ? vec . normalized : Vector3 . forward ; if ( SplineSpace == Space . Self ) { return transform . TransformDirection ( forward ) ; } else { return forward ; } }
Returns a world space forward, given an input t. t is valid from 0 to 1.
Returns a world space forward given an input t . t is valid from 0 to 1 .
None
t
float
None