Exemplo n.º 1
0
        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
                       ));
        }
Exemplo n.º 2
0
        Vector3 CalculatePositionOnCurve(
            int ceilingIndex,
            float normalizedPositionBetweenPoints
            )
        {
            ICurvePoint ceiling = thisCurvePoints[ceilingIndex];
            ICurvePoint floor   = thisCurvePoints[ceilingIndex - 1];

            return(Vector3.Lerp(
                       floor.GetPosition(),
                       ceiling.GetPosition(),
                       normalizedPositionBetweenPoints
                       ));
        }