source: GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.h @ 653

Revision 653, 22.0 KB checked in by mattausch, 18 years ago (diff)

implemented split queue (but not tested yet!)

Line 
1#ifndef _VspBspTree_H__
2#define _VspBspTree_H__
3
4#include "Mesh.h"
5#include "Containers.h"
6#include "Polygon3.h"
7#include <stack>
8#include "Statistics.h"
9#include "VssRay.h"
10#include "RayInfo.h"
11#include "ViewCellBsp.h"
12
13class ViewCell;
14//class BspViewCell;
15class Plane3;
16class VspBspTree; 
17class BspInterior;
18class BspNode;
19class AxisAlignedBox3;
20class Ray;
21class ViewCellsStatistics;
22class ViewCellsManager;
23class MergeCandidate;
24class Beam;
25class ViewCellsTree;
26
27
28struct BspRay;
29
30#define OCTREE_HACK 0
31/**
32        This is a view space partitioning specialised BSPtree. 
33        There are no polygon splits, but we split the sample rays.
34        The candidates for the next split plane are evaluated only
35        by checking the sampled visibility information.
36        The polygons are employed merely as candidates for the next split planes.
37*/
38class VspBspTree
39{
40        friend class ViewCellsParseHandlers;
41        friend class VspBspViewCellsManager;
42public:
43       
44        /** Additional data which is passed down the BSP tree during traversal.
45        */
46        struct VspBspTraversalData
47        { 
48                /// the current node
49                BspNode *mNode;
50                /// polygonal data for splitting
51                PolygonContainer *mPolygons;
52                /// current depth
53                int mDepth;
54                /// rays piercing this node
55                RayInfoContainer *mRays;
56                /// the probability that this node contains view point
57                float mProbability;
58                /// geometry of node as induced by planes
59                BspNodeGeometry *mGeometry;
60                /// pvs size
61                int mPvs;
62                /// how often this branch has missed the max-cost ratio
63                int mMaxCostMisses;
64                /// if this node is a kd-node (i.e., boundaries are axis aligned
65                bool mIsKdNode;
66#if OCTREE_HACK // OCTREE HACK
67                int mAxis;
68#endif
69                /// bounding box of current view space.
70                ///AxisAlignedBox3 mBbox;
71               
72                /** Returns average ray contribution.
73                */
74                float GetAvgRayContribution() const
75                {
76                        return (float)mPvs / ((float)mRays->size() + Limits::Small);
77                }
78
79
80                VspBspTraversalData():
81                mNode(NULL),
82                mPolygons(NULL),
83                mDepth(0),
84                mRays(NULL),
85                mPvs(0),
86                mProbability(0.0),
87                mGeometry(NULL),
88                mMaxCostMisses(0),
89                mIsKdNode(false)
90                {}
91               
92                VspBspTraversalData(BspNode *node,
93                                                        PolygonContainer *polys,
94                                                        const int depth,
95                                                        RayInfoContainer *rays,
96                                                        const int pvs,
97                                                        const float p,
98                                                        BspNodeGeometry *geom):
99                mNode(node),
100                mPolygons(polys),
101                mDepth(depth),
102                mRays(rays),
103                mPvs(pvs),
104                mProbability(p),
105                mGeometry(geom),
106                mMaxCostMisses(0),
107                mIsKdNode(false)
108                {}
109
110                VspBspTraversalData(PolygonContainer *polys,
111                                                        const int depth,
112                                                        RayInfoContainer *rays,
113                                                        BspNodeGeometry *geom):
114                mNode(NULL),
115                mPolygons(polys),
116                mDepth(depth),
117                mRays(rays),
118                mPvs(0),
119                mProbability(0),
120                mGeometry(geom),
121                mMaxCostMisses(0),
122                mIsKdNode(false)
123                {}
124
125                /** Returns cost of the traversal data.
126                */
127                float GetCost() const
128                {
129#if 1
130                        return mPvs * mProbability;
131#endif
132#if 0
133                        return (float) (-mDepth); // for regular grid
134#endif
135#if 0
136                        return (float)(mPvs * (int)mRays->size());
137#endif
138#if 0
139                        return (float)mPvs;
140#endif
141#if 0
142                        return mProbabiliy * (float)mRays->size();
143#endif
144                }
145
146                // deletes contents and sets them to NULL
147                void Clear()
148                {
149                        DEL_PTR(mPolygons);
150                        DEL_PTR(mRays);
151                        DEL_PTR(mGeometry);
152                }
153
154                friend bool operator<(const VspBspTraversalData &a, const VspBspTraversalData &b)
155                {
156                        return a.GetCost() < b.GetCost();
157                }
158    };
159       
160        typedef std::priority_queue<VspBspTraversalData> VspBspTraversalQueue;
161       
162       
163        struct VspBspSplitCandidate
164        { 
165                /// the current node
166                Plane3 mSplitPlane;
167               
168                // parent data
169                VspBspTraversalData mParentData;
170
171                float mRenderCost;
172
173                VspBspSplitCandidate(): mRenderCost(0)
174                {};
175
176                VspBspSplitCandidate(const Plane3 &plane, const VspBspTraversalData &tData):
177                mSplitPlane(plane), mParentData(tData), mRenderCost(0)
178                {}
179
180                /** Returns cost of the traversal data.
181                */
182                float GetCost() const
183                {
184#if 1
185                        return mRenderCost;
186#endif
187#if 0
188                        return (float) (-mDepth); // for kd tree
189#endif
190                }
191
192                friend bool operator<(const VspBspSplitCandidate &a, const VspBspSplitCandidate &b)
193                {
194                        return a.GetCost() < b.GetCost();
195                }
196    };
197
198        typedef std::priority_queue<VspBspSplitCandidate> VspBspSplitQueue;
199
200        /** Default constructor creating an empty tree.
201        */
202        VspBspTree();
203
204        /** Default destructor.
205        */
206        ~VspBspTree();
207
208        /** Returns BSP Tree statistics.
209        */
210        const BspTreeStatistics &GetStatistics() const;
211 
212
213        /** Constructs the tree from a given set of rays.
214                @param sampleRays the set of sample rays the construction is based on
215                @param viewCells if not NULL, new view cells are
216                created in the leafs and stored in the container
217        */
218        void Construct(const VssRayContainer &sampleRays,
219                                   AxisAlignedBox3 *forcedBoundingBox);
220
221        /** Returns list of BSP leaves with pvs smaller than
222                a certain threshold.
223                @param onlyUnmailed if only the unmailed leaves should be considered
224                @param maxPvs the maximal pvs (-1 means unlimited)
225        */
226        void CollectLeaves(vector<BspLeaf *> &leaves,
227                                           const bool onlyUnmailed = false,
228                                           const int maxPvs = -1) const;
229
230        /** Returns box which bounds the whole tree.
231        */
232        AxisAlignedBox3 GetBoundingBox()const;
233
234        /** Returns root of BSP tree.
235        */
236        BspNode *GetRoot() const;
237
238        /** Collects the leaf view cells of the tree
239                @param viewCells returns the view cells
240        */
241        void CollectViewCells(ViewCellContainer &viewCells, bool onlyValid) const;
242
243        /** A ray is cast possible intersecting the tree.
244                @param the ray that is cast.
245                @returns the number of intersections with objects stored in the tree.
246        */
247        int CastRay(Ray &ray);
248
249        /// bsp tree construction types
250        enum {FROM_INPUT_VIEW_CELLS, FROM_SCENE_GEOMETRY, FROM_SAMPLES};
251
252        /** finds neighbouring leaves of this tree node.
253        */
254        int FindNeighbors(BspNode *n,
255                                          vector<BspLeaf *> &neighbors,
256                                          const bool onlyUnmailed) const;
257
258        /** Constructs geometry associated with the half space intersections
259                leading to this node.
260        */
261        void ConstructGeometry(BspNode *n, BspNodeGeometry &geom) const;
262       
263        /** Construct geometry of view cell.
264        */
265        void ConstructGeometry(ViewCell *vc, BspNodeGeometry &geom) const;
266
267        /** Returns random leaf of BSP tree.
268                @param halfspace defines the halfspace from which the leaf is taken.
269        */
270        BspLeaf *GetRandomLeaf(const Plane3 &halfspace);
271
272        /** Returns random leaf of BSP tree.
273                @param onlyUnmailed if only unmailed leaves should be returned.
274        */
275        BspLeaf *GetRandomLeaf(const bool onlyUnmailed = false);
276
277        /** Returns epsilon of this tree.
278        */
279        float GetEpsilon() const;
280
281        /** Casts line segment into the tree.
282                @param origin the origin of the line segment
283                @param termination the end point of the line segment
284                @returns view cells intersecting the line segment.
285        */
286    int CastLineSegment(const Vector3 &origin,
287                                                const Vector3 &termination,
288                                                ViewCellContainer &viewcells);
289
290               
291        /** Sets pointer to view cells manager.
292        */
293        void SetViewCellsManager(ViewCellsManager *vcm);
294
295        /** Returns distance from node 1 to node 2.
296        */
297        int TreeDistance(BspNode *n1, BspNode *n2) const;
298
299        /** Collapses the tree with respect to the view cell partition.
300                @returns number of collapsed nodes
301        */
302        int CollapseTree();
303
304        /** Returns view cell the current point is located in.
305        */
306        ViewCell *GetViewCell(const Vector3 &point);
307
308
309        /** Returns true if this view point is in a valid view space,
310                false otherwise.
311        */
312        bool ViewPointValid(const Vector3 &viewPoint) const;
313
314        /** Returns view cell corresponding to
315                the invalid view space.
316        */
317        BspViewCell *GetOutOfBoundsCell();
318
319        /** Writes tree to output stream
320        */
321        bool Export(ofstream &stream);
322
323        /** Casts beam, i.e. a 5D frustum of rays, into tree.
324                Tests conservative using the bounding box of the nodes.
325                @returns number of view cells it intersected
326        */
327        int CastBeam(Beam &beam);
328
329        void CollectViewCells(BspNode *root,
330                                                  bool onlyValid,
331                                                  ViewCellContainer &viewCells,
332                                                  bool onlyUnmailed = false) const;
333
334       
335        int FindApproximateNeighbors(BspNode *n,
336                                                             vector<BspLeaf *> &neighbors,
337                                                                 const bool onlyUnmailed) const;
338
339        /** Checks if tree validity-flags are right
340                with respect to view cell valitiy.
341                If not, marks subtree as invalid.
342        */
343        void ValidateTree();
344
345        /** Invalid view cells are added to the unbounded space
346        */
347        void CollapseViewCells();
348
349        /** Collects rays stored in the leaves.
350        */
351        void CollectRays(VssRayContainer &rays);
352
353
354        ViewCellsTree *mViewCellsTree;
355
356
357protected:
358
359        // --------------------------------------------------------------
360        // For sorting objects
361        // --------------------------------------------------------------
362        struct SortableEntry
363        {
364                enum EType
365                {
366                        ERayMin,
367                        ERayMax
368                };
369
370                int type;
371                float value;
372                VssRay *ray;
373 
374                SortableEntry() {}
375                SortableEntry(const int t, const float v, VssRay *r):type(t),
376                                          value(v), ray(r)
377                {
378                }
379               
380                friend bool operator<(const SortableEntry &a, const SortableEntry &b)
381                {
382                        return a.value < b.value;
383                }
384        };
385
386        /** faster evaluation of split plane cost for kd axis aligned cells.
387        */
388        float EvalAxisAlignedSplitCost(const VspBspTraversalData &data,
389                                                                   const AxisAlignedBox3 &box,
390                                                                   const int axis,
391                                                                   const float &position,
392                                                                   float &pFront,
393                                                                   float &pBack) const;
394
395        void EvalSplitCandidate(VspBspTraversalData &tData, VspBspSplitCandidate &splitData);
396
397        float EvalRenderCostDecrease(const Plane3 &candidatePlane,
398                                                                 const VspBspTraversalData &data) const;
399
400        void ConstructWithSplitQueueQueue(const PolygonContainer &polys, RayInfoContainer *rays);
401
402
403        /** Returns view cell corresponding to
404                the invalid view space. If it does not exist, it is created.
405        */
406        BspViewCell *GetOrCreateOutOfBoundsCell();
407
408        /** Collapses the tree with respect to the view cell partition,
409                i.e. leaves having the same view cell are collapsed.
410                @param node the root of the subtree to be collapsed
411                @param collapsed returns the number of collapsed nodes
412                @returns node of type leaf if the node could be collapsed,
413                this node otherwise
414        */
415        BspNode *CollapseTree(BspNode *node, int &collapsed);
416
417        /** Helper function revalidating the view cell leaf list after merge.
418        */
419        void RepairViewCellsLeafLists();
420
421        /** Evaluates tree stats in the BSP tree leafs.
422        */
423        void EvaluateLeafStats(const VspBspTraversalData &data);
424
425        /** Subdivides node with respect to the traversal data.
426            @param tStack current traversal stack
427                @param tData traversal data also holding node to be subdivided
428                @returns new root of the subtree
429        */
430        BspNode *Subdivide(VspBspTraversalQueue &tStack,
431                                           VspBspTraversalData &tData);
432
433        BspNode *Subdivide(VspBspSplitQueue &tQueue,
434                                           VspBspSplitCandidate &splitCandidate);
435
436        /** Constructs the tree from the given traversal data.
437                @param polys stores set of polygons on which subdivision may be based
438                @param rays storesset of rays on which subdivision may be based
439        */
440        void Construct(const PolygonContainer &polys, RayInfoContainer *rays);
441
442        /** Selects the best possible splitting plane.
443                @param plane returns the split plane
444                @param leaf the leaf to be split
445                @param polys the polygon list on which the split decition is based
446                @param rays ray container on which selection may be based
447                @note the polygons can be reordered in the process
448                @returns true if the cost of the split is under maxCostRatio
449
450        */
451        bool SelectPlane(Plane3 &plane,
452                                         BspLeaf *leaf,
453                                         VspBspTraversalData &data,
454                                         VspBspTraversalData &frontData,
455                                         VspBspTraversalData &backData,
456                                         int &splitAxis);
457       
458        /** Strategies where the effect of the split plane is tested
459            on all input rays.
460
461                @returns the cost of the candidate split plane
462        */
463        float EvalSplitPlaneCost(const Plane3 &candidatePlane,
464                                                         const VspBspTraversalData &data,
465                                                         BspNodeGeometry &geomFront,
466                                                         BspNodeGeometry &geomBack,
467                                                         float &pFront,
468                                                         float &pBack) const;
469
470        /** Subdivides leaf.
471                @param leaf the leaf to be subdivided
472               
473                @param polys the polygons to be split
474                @param frontPolys returns the polygons in front of the split plane
475                @param backPolys returns the polygons in the back of the split plane
476               
477                @param rays the polygons to be filtered
478                @param frontRays returns the polygons in front of the split plane
479                @param backRays returns the polygons in the back of the split plane
480
481                @returns the root of the subdivision
482        */
483
484        BspInterior *SubdivideNode(const Plane3 &splitPlane,
485                                                           VspBspTraversalData &tData,
486                                                           VspBspTraversalData &frontData,
487                               VspBspTraversalData &backData,
488                                                           PolygonContainer &coincident);
489
490        /** Extracts the meshes of the objects and adds them to polygons.
491                Adds object aabb to the aabb of the tree.
492                @param maxPolys the maximal number of objects to be stored as polygons
493                @returns the number of polygons
494        */
495        int AddToPolygonSoup(const ObjectContainer &objects,
496                                                 PolygonContainer &polys,
497                                                 int maxObjects = 0);
498
499        /** Extracts the meshes of the view cells and and adds them to polygons.
500                Adds view cell aabb to the aabb of the tree.
501                @param maxPolys the maximal number of objects to be stored as polygons
502                @returns the number of polygons
503        */
504        int AddToPolygonSoup(const ViewCellContainer &viewCells,
505                                                 PolygonContainer &polys,
506                                                 int maxObjects = 0);
507
508        /** Extract polygons of this mesh and add to polygon container.
509                @param mesh the mesh that drives the polygon construction
510                @param parent the parent intersectable this polygon is constructed from
511                @returns number of polygons
512        */
513        int AddMeshToPolygons(Mesh *mesh, PolygonContainer &polys, MeshInstance *parent);
514
515        /** Selects an axis aligned for the next split.
516                @returns cost for this split
517        */
518        float SelectAxisAlignedPlane(Plane3 &plane,
519                                                                 const VspBspTraversalData &tData,
520                                                                 int &axis,
521                                                                 BspNodeGeometry **frontGeom,
522                                                                 BspNodeGeometry **backGeom,
523                                                                 float &pFront,
524                                                                 float &pBack,
525                                                                 const bool useKdSplit);
526
527        /** Sorts split candidates for surface area heuristics for axis aligned splits.
528                @param polys the input for choosing split candidates
529                @param axis the current split axis
530                @param splitCandidates returns sorted list of split candidates
531        */
532        void SortSplitCandidates(const RayInfoContainer &rays, const int axis);
533
534        /** Computes best cost for axis aligned planes.
535        */
536        float BestCostRatioHeuristics(const RayInfoContainer &rays,
537                                                                  const AxisAlignedBox3 &box,
538                                                                  const int pvsSize,
539                                                                  const int &axis,
540                                                                  float &position);
541
542        /** Selects an axis aligned split plane.
543                @Returns true if split is valied
544        */
545        bool SelectAxisAlignedPlane(Plane3 &plane, const PolygonContainer &polys) const;
546
547        /** Subdivides the rays into front and back rays according to the split plane.
548               
549                @param plane the split plane
550                @param rays contains the rays to be split. The rays are
551                           distributed into front and back rays.
552                @param frontRays returns rays on the front side of the plane
553                @param backRays returns rays on the back side of the plane
554               
555                @returns the number of splits
556        */
557        int SplitRays(const Plane3 &plane,
558                                  RayInfoContainer &rays,
559                              RayInfoContainer &frontRays,
560                                  RayInfoContainer &backRays) const;
561
562
563        /** Extracts the split planes representing the space bounded by node n.
564        */
565        void ExtractHalfSpaces(BspNode *n, vector<Plane3> &halfSpaces) const;
566
567        /** Adds the object to the pvs of the front and back leaf with a given classification.
568
569                @param obj the object to be added
570                @param cf the ray classification regarding the split plane
571                @param frontPvs returns the PVS of the front partition
572                @param backPvs returns the PVS of the back partition
573       
574        */
575        void AddObjToPvs(Intersectable *obj,
576                                         const int cf,
577                                         int &frontPvs,
578                                         int &backPvs,
579                                         int &totalPvs) const;
580       
581        /** Computes PVS size induced by the rays.
582        */
583        int ComputePvsSize(const RayInfoContainer &rays) const;
584
585        /** Returns true if tree can be terminated.
586        */
587        inline bool TerminationCriteriaMet(const VspBspTraversalData &data) const;
588
589        /** Computes accumulated ray lenght of this rays.
590        */
591        float AccumulatedRayLength(const RayInfoContainer &rays) const;
592
593        /** Splits polygons with respect to the split plane.
594
595                @param plane the split plane
596                @param polys the polygons to be split. the polygons are consumed and
597                           distributed to the containers frontPolys, backPolys, coincident.
598                @param frontPolys returns the polygons in the front of the split plane
599                @param backPolys returns the polygons in the back of the split plane
600                @param coincident returns the polygons coincident to the split plane
601
602                @returns the number of splits   
603        */
604        int SplitPolygons(const Plane3 &plane,
605                                          PolygonContainer &polys,
606                                          PolygonContainer &frontPolys,
607                                          PolygonContainer &backPolys,
608                                          PolygonContainer &coincident) const;
609
610        /** Adds ray sample contributions to the PVS.
611                @param sampleContributions the number contributions of the samples
612                @param contributingSampels the number of contributing rays
613               
614        */
615        void AddToPvs(BspLeaf *leaf,
616                                  const RayInfoContainer &rays,
617                                  float &sampleContributions,
618                                  int &contributingSamples);
619
620
621
622
623
624       
625        /** Take 3 ray endpoints, where two are minimum and one a maximum
626                point or the other way round.
627        */
628        Plane3 ChooseCandidatePlane(const RayInfoContainer &rays) const;
629
630        /** Take plane normal as plane normal and the midpoint of the ray.
631                PROBLEM: does not resemble any point where visibility is
632                likely to change
633        */
634        Plane3 ChooseCandidatePlane2(const RayInfoContainer &rays) const;
635
636        /** Fit the plane between the two lines so that the plane
637                has equal shortest distance to both lines.
638        */
639        Plane3 ChooseCandidatePlane3(const RayInfoContainer &rays) const;
640 
641        /** Collects candidates for merging.
642                @param leaves the leaves to be merged
643                @returns number of leaves in queue
644        */
645        int CollectMergeCandidates(const vector<BspLeaf *> leaves, vector<MergeCandidate> &candidates);
646
647        /** Collects candidates for the merge in the merge queue.
648                @returns number of leaves in queue
649        */
650        int CollectMergeCandidates(const VssRayContainer &rays, vector<MergeCandidate> &candidates);
651       
652        /** Preprocesses polygons and throws out all polygons which are coincident to
653                the view space box faces (they can be problematic).
654        */
655        void PreprocessPolygons(PolygonContainer &polys);
656       
657        /** Propagates valid flag up the tree.
658        */
659        void PropagateUpValidity(BspNode *node);
660
661        /** Writes the node to disk
662                @note: should be implemented as visitor
663        */
664        void ExportNode(BspNode *node, ofstream &stream);
665
666        /** Returns estimated memory usage of tree.
667        */
668        //float GetMemUsage(const VspBspTraversalQueue &tstack) const;
669        float GetMemUsage() const;
670
671
672
673        /// Pointer to the root of the tree
674        BspNode *mRoot;
675               
676        BspTreeStatistics mBspStats;
677
678        /// Strategies for choosing next split plane.
679        enum {NO_STRATEGY = 0,
680                  RANDOM_POLYGON = 1,
681                  AXIS_ALIGNED = 2,
682                  LEAST_RAY_SPLITS = 256,
683                  BALANCED_RAYS = 512,
684                  PVS = 1024
685                };
686
687        /// box around the whole view domain
688        AxisAlignedBox3 mBox;
689
690        bool mUseCostHeuristics;
691
692        /// minimal number of rays before subdivision termination
693        int mTermMinRays;
694        /// maximal possible depth
695        int mTermMaxDepth;
696        /// mininum probability
697        float mTermMinProbability;
698        /// mininum PVS
699        int mTermMinPvs;
700        /// maximal contribution per ray
701        float mTermMaxRayContribution;
702        /// minimal accumulated ray length
703        float mTermMinAccRayLength;
704
705        //HACK
706        int mTermMinPolygons;
707
708        //-- termination criteria for axis aligned split
709
710        /// minimal number of rays for axis aligned split
711        int mTermMinRaysForAxisAligned;
712        // max ray contribution
713        float mTermMaxRayContriForAxisAligned;
714
715        /// strategy to get the best split plane
716        int mSplitPlaneStrategy;
717        /// number of candidates evaluated for the next split plane
718        int mMaxPolyCandidates;
719        /// number of candidates for split planes evaluated using the rays
720        int mMaxRayCandidates;
721        /// balancing factor for PVS criterium
722        float mCtDivCi;
723
724        //-- axis aligned split criteria
725        float mAxisAlignedCtDivCi;
726        /// spezifies the split border of the axis aligned split
727        float mAxisAlignedSplitBorder;
728
729        /// maximal acceptable cost ratio
730        float mTermMaxCostRatio;
731        /// tolerance value indicating how often the max cost ratio can be failed
732        int mTermMissTolerance;
733
734        //-- factors guiding the split plane heuristics
735        float mLeastRaySplitsFactor;
736        float mBalancedRaysFactor;
737        float mPvsFactor;
738
739        /// if area or volume should be used for PVS heuristics
740        bool mUseAreaForPvs;
741        /// tolerance for polygon split
742        float mEpsilon;
743        /// maximal number of test rays used to evaluate candidate split plane
744        int mMaxTests;
745        /// normalizes different bsp split plane criteria
746        float mCostNormalizer;
747        /// maximal number of view cells
748        int mMaxViewCells;
749       
750        ofstream  mSubdivisionStats;
751
752        // if rays should be stored in leaves
753        bool mStoreRays;
754       
755        /// if only driving axis should be used for split
756        bool mOnlyDrivingAxis;
757
758        ViewCellsManager *mViewCellsManager;
759
760        vector<SortableEntry> *mSplitCandidates;
761
762       
763        float mRenderCostWeight;
764        /// View cell corresponding to the space outside the valid view space
765        BspViewCell *mOutOfBoundsCell;
766
767        /// maximal tree memory
768        float mMaxMemory;
769        /// the tree is out of memory
770        bool mOutOfMemory;
771       
772        float mTotalCost;
773        int mTotalPvsSize;
774
775        //int mSplits;
776
777        ofstream mSubdivsionStats;
778
779        bool mUseRandomAxis;
780
781        bool mUsePolygonSplitIfAvailable;
782
783        int mTimeStamp;
784
785        int mCreatedViewCells;
786
787private:
788
789
790        static const float sLeastRaySplitsTable[5];
791        /** Evaluates split plane classification with respect to the plane's
792                contribution for balanced rays.
793        */
794        static const float sBalancedRaysTable[5];
795
796        /// Generates unique ids for PVS criterium
797        static void GenerateUniqueIdsForPvs();
798
799        //-- unique ids for PVS criterium
800        static int sFrontId;
801        static int sBackId;
802        static int sFrontAndBackId;
803};
804
805
806
807
808#endif
Note: See TracBrowser for help on using the repository browser.