//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); }
//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); }