예제 #1
0
파일: SubPolyr.cs 프로젝트: Cdrix/SM
    //create one subpoly based on where we hit the terrain
    List <Vector3> CreateOneSubPoly(Vector3 hitPointOnSubPoly, bool isMouseOnTerrain, Vertexer vertex,
                                    SubDivider subDivide, UPoly poly, List <Vector3> currentHoverVertices)
    {
        //print(isMouseOnTerrain + "isMouseOnTerrain");
        List <Vector3> subPoly = new List <Vector3>();

        if (isMouseOnTerrain)
        {
            Vector3 firstVertex = vertex.FindClosestVertex(hitPointOnSubPoly, currentHoverVertices.ToArray());

            Dir     quadrant     = vertex.FindVertexQuadrant(firstVertex, hitPointOnSubPoly);
            Vector3 lefTopVertex = vertex.FindTopLeftVertex(firstVertex, quadrant,
                                                            subDivide.XSubStep, subDivide.ZSubStep, currentHoverVertices.ToArray());

            subPoly = UPoly.FindPoly(lefTopVertex, subDivide.XSubStep, subDivide.ZSubStep,
                                     vertex, currentHoverVertices.ToArray());
            //UVisHelp.CreateHelpers(subPoly, Root.blueCube);
        }
        return(subPoly);
    }
예제 #2
0
    //this is a method helper
    private List <Vector3> returnPoly(Vector3 real, Vector3[] vertices)
    {
        List <Vector3> poly = UPoly.FindPoly(real, m.IniTerr.StepX, m.IniTerr.StepZ, m.Vertex, vertices);

        return(poly);
    }