Ignore:
Timestamp:
06/16/06 16:56:05 (18 years ago)
Author:
gumbau
Message:

Improved Foliage class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/leaves/foliage.h

    r830 r1019  
    33 
    44 
    5 #include "arbol.h" 
    65#include "Activas.h" 
    7 //#include "material.h" 
     6#include "GeoSubMesh.h" 
    87#include "tlista.h" 
    9 //#include <vl\VLf.h> 
    108#include "TMatrix.h" 
    11  
    12  
     9#include "VertexData.h" 
     10#include "Leaf.h" 
    1311 
    1412class Foliage 
     
    1614        public : 
    1715 
    18         Arbol    *MiArbol; 
    19         Activas  *Acth; // primera hoja activa 
    20         int ppio, final; 
    21         int nhactivas; 
    22         TMatrix mat_aux; 
     16                Activas  *Acth; // primera hoja activa 
     17                int ppio, final; 
     18                int nhactivas; 
     19                TMatrix mat_aux; 
    2320 
    24         public : 
    25                 Foliage (void); // Void constructor 
    26                 Foliage ( Arbol* Arbol1 ); // Constructor with the name of a file cotaining the data 
     21                Foliage (const Geometry::SubMesh *, const char *simpSeq, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL); 
     22                Foliage (const Foliage *); 
    2723                virtual ~Foliage (void); // Destructor 
    2824                 
    29                 // sacar por pantalla 
    30 /*              void Dibuja_Hoja ( Hoja&); 
    31                 int  DibujarHojas (float frustum[6][4], float zoom); 
    32                 void DibujaEsfera (float);*/ 
    33  
    3425                //culling 
    3526                void Culling (float frustum[6][4]); 
     
    3930                bool EsActivo (  int num); 
    4031                int  DondeEsta (  float x, float y, float z, float rva, float rvb,float rvc, float rvd); 
    41                 bool Criterio ( Hoja &aHoja, char ch, float rva, float rvb,float rvc, float rvd, float radio); 
     32                bool Criterio ( Leaf &, char ch, float rva, float rvb,float rvc, float rvd, float radio); 
    4233                int  ResolucionV ( char c, float rva, float rvb,float rvc, float rvd, float radio); 
    4334                void ColapsaHoja (int, int&); 
     
    5647                void RCsplit (  int nhojas); 
    5748 
    58                 //impostores 
    59 //              void DibujaCaja (float alfa, float d); 
    60 //              int  DibujaMediaCopa ( char c, float rva, float rvb,float rvc, float rvd, float radio); 
     49                Geometry::VertexData *vertexdata; 
     50                Geometry::IndexData *indexdata; 
     51 
     52                Leaf   *Leaves; 
     53                Activas  *MinDet; // primera hoja activa 
     54                int nHojas; 
     55                int TotHojas; 
    6156                 
     57                float cx,cy,cz; //centro de la copa// para los impostores y resolucion variable 
     58                float rad; //radio de la esfera envolvente 
     59                int minHojas; 
     60                int TotVerts; 
     61 
     62        private: 
     63                Geometry::CREATEVERTEXDATAFUNC create_vertex_data_func;          
     64                Geometry::CREATEINDEXDATAFUNC create_index_data_func; 
     65 
     66                void ReadLeafs(const Geometry::SubMesh *); 
     67                void ReadVertices(const Geometry::SubMesh *); 
     68                bool ReadSimpSeq(const char*); /// returns true when successful 
     69                void RellenoRaiz (void); 
     70 
     71                void GetNormalH (Leaf&); 
     72//              void GetNormalT(Tronco&); 
     73 
     74                void CrossProduct(const float *v1, const float *v2, float *res); 
     75                void Normalize(const float *v, float *res); 
     76//              void CalculaNormalesVertice(void); 
     77                void CalculaTexCoordsYNorms(void); 
     78 
    6279}; 
    6380 
Note: See TracChangeset for help on using the changeset viewer.