Ejemplo n.º 1
0
    protected void linkNodes(WaypointNode one, float uCoordA, float vCoordA,
                             WaypointNode two, float uCoordB, float vCoordB)
    {
        float diffU = Mathf.Abs(uCoordA - uCoordB);
        float diffV = Mathf.Abs(vCoordA - vCoordB);

        if (diffU > diffV)
        {
            if (uCoordA > uCoordB)
            {
                one.setLeft(two); two.setRight(one);
            }
            else
            {
                one.setRight(two); two.setLeft(one);
            }
        }
        else
        {
            if (vCoordA > vCoordB)
            {
                one.setBack(two); two.setFront(one);
            }
            else
            {
                one.setFront(two); two.setBack(one);
            }
        }
    }