Ignore:
Timestamp:
08/16/05 20:30:53 (19 years ago)
Author:
mattausch
Message:

added bsp stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h

    r240 r241  
    44#include "Mesh.h" 
    55#include "Containers.h" 
     6 
     7 
    68#include <queue> 
    79#include <stack> 
     
    1921*/ 
    2022typedef std::vector<Polygon3 *> PolygonContainer; 
     23 
     24struct BspRayTraversalData  
     25{ 
     26    BspNode *mNode; 
     27    Vector3 mExitPoint; 
     28    float mMaxT; 
     29     
     30    BspRayTraversalData() {} 
     31 
     32    BspRayTraversalData(BspNode *n, const Vector3 &p, const float maxt): 
     33    mNode(n), mExitPoint(p), mMaxT(maxt)  
     34        {} 
     35}; 
    2136 
    2237class BspTreeStatistics // TODO: should have common superclass with KdTreeStatistics 
     
    299314        Plane3 SelectPlaneHeuristics(PolygonContainer *polygons, int maxTests) const; 
    300315 
    301         /** Extracts the meshes of the objects and copies them into the mesh. 
    302         */ 
    303         static void Copy2PolygonSoup(const ObjectContainer &objects, PolygonContainer &polys, int maxPolys); 
    304  
    305         /** copy this mesh into polygons. 
    306         */ 
    307         static void CopyMesh2Polygons(Mesh *mesh, PolygonContainer &polys); 
     316        /** Extracts the meshes of the objects and copies them into the mesh. Also calculcates the bounding box of the tree. 
     317                @param maxPolys the maximal number of objects to be stored as polygons 
     318        */ 
     319        void Copy2PolygonSoup(const ObjectContainer &objects, PolygonContainer &polys, int maxObjects); 
     320 
     321        /** Add this mesh as polygons to polygon container. 
     322        */ 
     323        void AddMesh2Polygons(Mesh *mesh, PolygonContainer &polys); 
     324 
     325        /** A ray is cast possible intersecting the tree. 
     326                @param the ray that is cast. 
     327                @returns the number of intersections with objects stored in the tree. 
     328        */ 
     329        int CastRay(Ray &ray); 
    308330 
    309331        /// Pointer to the root of the tree 
     
    321343        /// Strategies for choosing next split plane. 
    322344        enum {NEXT_POLYGON, LEAST_SPLITS, BALANCED_TREE, COMBINED}; 
     345 
     346        /// box around the whole view domain 
     347        AxisAlignedBox3 mBox; 
    323348 
    324349public: 
Note: See TracChangeset for help on using the changeset viewer.