Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        camera = USearch.FindCurrentCamera();

        Malla     = (Malla)General.Create(Root.malla, container: Program.ClassContainer.transform);
        Poly      = new UPoly();
        subDivide = new SubDivider();
        Vertex    = new Vertexer();
        iniTerr   = new InitializerTerrain();

        iniTerr.Initializer(ref Vertices, ref mesh);
        iniTerr.InitializeMallaStats(Vertices, ref wholeMalla, ref nextStart, ref zLot);

        SubPolyr  = new SubPolyr();
        subMesh   = new SubMeshData();
        IsLoading = true;

        //bz is static and if a new game is started needs to clean up and start again
        CrystalManager1 = new CrystalManager();
    }
Beispiel #2
0
Datei: UPoly.cs Projekt: Cdrix/SM
    public static List <Vector3> ReturnARealPoly(Vector3 hitVector3, Vector3[] Vertices, InitializerTerrain iniTerr,
                                                 Vertexer vertex)
    {
        if (hitVector3 == null || hitVector3 == new Vector3())
        {
            return(new List <Vector3>());
        }
        Vector3 firstVertex = vertex.FindClosestVertex(hitVector3, Vertices);

        Dir     quadrant     = vertex.FindVertexQuadrant(firstVertex, hitVector3);
        Vector3 lefTopVertex = vertex.FindTopLeftVertex(firstVertex, quadrant,
                                                        iniTerr.StepX, iniTerr.StepZ, Vertices);
        //UVisHelp.CreateHelpers(lefTopVertex, Root.redSphereHelp);

        List <Vector3> poly = FindPoly(lefTopVertex, iniTerr.StepX, iniTerr.StepZ, vertex, Vertices);

        //UVisHelp.CreateHelpers(poly, Root.boxCollHelp);
        return(poly);
    }