#ifndef FOLIAGE_H #define FOLIAGE_H #include "GeoSubMesh.h" #include "tlista.h" #include "VertexData.h" #include "Leaf.h" #include "GeoTreeSimpSequence.h" class ActiveLeafNode { public : // Variable members int index;// Array of pointers to vertices int prev; int next; ActiveLeafNode (void){ index = prev = next = -1; } // Constructor }; class Foliage { public : ActiveLeafNode *Acth; // first active leaf int begin, final; int active_leaf_count; Foliage (const Geometry::SubMesh *, const Geometry::TreeSimplificationSequence *, Geometry::CREATEVERTEXDATAFUNC vdfun=NULL, Geometry::CREATEINDEXDATAFUNC idfun=NULL); Foliage (const Foliage *); virtual ~Foliage (void); // Destructor void CalculateLOD(int nhojas); Geometry::VertexData *vertexdata; Geometry::IndexData *indexdata; Leaf *Leaves; ActiveLeafNode *MinDet; // first active leaf int leafCount; int leafTotal; int minLeaves; int TotalVerts; private: Geometry::CREATEVERTEXDATAFUNC create_vertex_data_func; Geometry::CREATEINDEXDATAFUNC create_index_data_func; bool IsActive( int num) const; int PrevActive (int h); int NextActive (int h); void RCecol(int nhojas); void RCsplit(int nhojas); void ReadLeafs(const Geometry::SubMesh *); void ReadVertices(const Geometry::SubMesh *); bool ReadSimpSeq(const Geometry::TreeSimplificationSequence *); /// returns true when successful void FillRoot(void); void GetNormalH (Leaf&); void CrossProduct(const float *v1, const float *v2, float *res); void Normalize(const float *v, float *res); // void CalculaNormalesVertice(void); void CalculateTexCoordsAndNorms(void); }; #endif