Vector3 CalculateForwardDirectionOnCurve( int ceilingIndex, float normalizedPositionBetweenPoints ) { ICurvePoint ceiling = thisCurvePoints[ceilingIndex]; ICurvePoint floor = thisCurvePoints[ceilingIndex - 1]; Vector3 ceilingForward = ceiling.GetPosition() - floor.GetPosition(); Vector3 floorForward = floor.GetPosition() - floor.GetPrevPointPosition(); return(Vector3.Lerp( floorForward, ceilingForward, normalizedPositionBetweenPoints )); }
public Vector3 GetLastCurvePointPrevPosition() { ICurvePoint lastCurvePoint = thisCurvePoints[thisCurvePoints.Length - 1]; return(lastCurvePoint.GetPrevPointPosition()); }