Ignore:
Timestamp:
10/13/05 13:10:21 (19 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r322 r325  
    234234                /// the view cell associated with this subdivsion 
    235235                ViewCell *mViewCell; 
    236                  
     236                /// rays piercing this node 
     237                RayContainer *mRays; 
     238 
    237239                BspTraversalData(): 
    238240                mNode(NULL), 
    239241                mPolygons(NULL), 
    240242                mDepth(0), 
    241                 mViewCell(NULL) 
     243                mViewCell(NULL), 
     244                mRays(NULL) 
    242245                {} 
    243246                 
     
    245248                                                 PolygonContainer *polys,  
    246249                                                 const int depth,  
    247                                                  ViewCell *viewCell):  
     250                                                 ViewCell *viewCell, 
     251                                                 RayContainer *rays = NULL):  
    248252                mNode(node),  
    249253                mPolygons(polys),  
    250254                mDepth(depth),  
    251                 mViewCell(viewCell) 
     255                mViewCell(viewCell), 
     256                mRays(rays) 
    252257                {} 
    253258    }; 
     
    353358        */ 
    354359        float SplitPlaneCost(PolygonContainer &polys,  
    355                                                  const Plane3 &candidatePlane); 
     360                                                 const Plane3 &candidatePlane, 
     361                                                 const RayContainer &rays); 
    356362 
    357363        /** Evaluates tree stats in the BSP tree leafs. 
     
    369375                @param leaf the leaf to be split 
    370376                @param polys the polygon list on which the split decition is based 
    371                 @Returns the split plane 
     377                @param rays ray container on which selection may be based 
     378                Returns the split plane 
    372379        */ 
    373380        Plane3 SelectPlane(BspLeaf *leaf,  
    374                                            PolygonContainer &polys); 
     381                                           PolygonContainer &polys, 
     382                                           const RayContainer &ray); 
    375383 
    376384        /** Filters next view cell down the tree and inserts it into the appropriate leaves 
     
    390398                @param backPolys returns the polygons in the back of the split plane 
    391399                @param coincident returns the polygons coincident to the split plane 
     400                @param rays ray container used to guide the split process 
    392401                @returns the root of the subdivision 
    393402        */ 
     
    396405                                                           PolygonContainer &frontPolys, 
    397406                                                           PolygonContainer &backPolys,  
    398                                                            PolygonContainer &coincident); 
     407                                                           PolygonContainer &coincident, 
     408                                                           const RayContainer &rays); 
    399409 
    400410        /** Filters polygons down the tree. 
     
    413423                2.5d aligned) 
    414424                @param polygons container of polygons 
     425                @param rays bundle of rays on which the split can be based 
    415426                @param maxTests the maximal number of candidate tests 
    416427        */ 
    417428        Plane3 SelectPlaneHeuristics(PolygonContainer &polys,  
    418                                                                 const int maxTests); 
     429                                                                 const RayContainer &rays, 
     430                                                                 const int maxTests); 
    419431 
    420432        /** Extracts the meshes of the objects and adds them to polygons.  
     
    490502                                                         vector<SortableEntry> &splitCandidates) const; 
    491503 
     504        /** Splits the rays into front and back rays according to split plane 
     505                @param rays contains the rays to be split. The rays are  
     506                           distributed to front and back rays. 
     507                @param frontRays returns rays on the front side of the plane 
     508                @param backRays returns rays on the back side of the plane 
     509        */ 
     510        void BspTree::SplitRays(const Plane3 plane, 
     511                                                        RayContainer &rays,  
     512                                                        RayContainer &frontRays,  
     513                                                        RayContainer &backRays); 
     514 
    492515        /// Pointer to the root of the tree 
    493516        BspNode *mRoot; 
Note: See TracChangeset for help on using the changeset viewer.