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 )); }
Vector3 CalculatePositionOnCurve( int ceilingIndex, float normalizedPositionBetweenPoints ) { ICurvePoint ceiling = thisCurvePoints[ceilingIndex]; ICurvePoint floor = thisCurvePoints[ceilingIndex - 1]; return(Vector3.Lerp( floor.GetPosition(), ceiling.GetPosition(), normalizedPositionBetweenPoints )); }