Ejemplo n.º 1
0
    private void GenerateFairwayHulls()
    {
        for (int i = 1; i < points.Count; i++)
        {
            FairwayPoint prev = points[i - 1];
            FairwayPoint next = points[i];

            var prevPoints = MathfEx.CircleCoordinatesXZ(prev.position, prev.radius, transform.rotation, options.circleFidelity);
            var nextPoints = MathfEx.CircleCoordinatesXZ(next.position, next.radius, transform.rotation, options.circleFidelity);

            hulls.Add(new Hull(prevPoints, nextPoints));
        }

        this.GenerateFairwayOuterHulls();
    }
Ejemplo n.º 2
0
    private void GenerateFairwayOuterHulls()
    {
        for (int i = 1; i < points.Count; i++)
        {
            FairwayPoint prev = points[i - 1];
            FairwayPoint next = points[i];

            //Calculate outer hull radii
            float pR = prev.radius + (prev.radius * options.outerHullOffset);
            float nR = next.radius + (prev.radius * options.outerHullOffset);

            var prevPoints = MathfEx.CircleCoordinatesXZ(prev.position, pR, transform.rotation, options.circleFidelity);
            var nextPoints = MathfEx.CircleCoordinatesXZ(next.position, nR, transform.rotation, options.circleFidelity);

            outerHulls.Add(new Hull(prevPoints, nextPoints));
        }
    }