source: GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h @ 1548

Revision 1548, 21.3 KB checked in by mattausch, 18 years ago (diff)
Line 
1#ifndef _BvHierarchy_H__
2#define _BvHierarchy_H__
3
4#include <stack>
5
6#include "Mesh.h"
7#include "Containers.h"
8#include "Statistics.h"
9#include "VssRay.h"
10#include "RayInfo.h"
11#include "gzstream.h"
12#include "SubdivisionCandidate.h"
13#include "AxisAlignedBox3.h"
14#include "IntersectableWrapper.h"
15
16
17namespace GtpVisibilityPreprocessor {
18
19
20class ViewCellLeaf;
21class Plane3;
22class AxisAlignedBox3;
23class Ray;
24class ViewCellsStatistics;
25class ViewCellsManager;
26class MergeCandidate;
27class Beam;
28class ViewCellsTree;
29class Environment;
30class BvhInterior;
31class BvhLeaf;
32class BvhNode;
33class BvhIntersectable;
34class BvhTree;
35class VspTree;
36class ViewCellsContainer;
37class HierarchyManager;
38
39
40/** View space partition statistics.
41*/
42class BvhStatistics: public StatisticsBase
43{
44public:
45       
46        /// Constructor
47        BvhStatistics()
48        {
49                Reset();
50        }
51
52        int Nodes() const {return nodes;}
53        int Interior() const { return nodes / 2; }
54        int Leaves() const { return (nodes / 2) + 1; }
55       
56        double AvgDepth() const
57        { return accumDepth / (double)Leaves(); }
58
59        double AvgObjectRefs() const
60        { return objectRefs / (double)Leaves(); }
61
62        double AvgRayRefs() const
63        { return rayRefs / (double)Leaves(); }
64
65
66        void Reset()
67        {
68                nodes = 0;
69                splits = 0;
70                maxDepth = 0;
71                minDepth = 99999;
72                accumDepth = 0;
73        maxDepthNodes = 0;
74                minProbabilityNodes = 0;
75                maxCostNodes = 0;
76                       
77                ///////////////////
78                minObjectsNodes = 0;
79                maxObjectRefs = 0;
80                minObjectRefs = 999999999;
81                objectRefs = 0;
82                emptyNodes = 0;
83
84                ///////////////////
85                minRaysNodes = 0;
86                maxRayRefs = 0;
87                minRayRefs = 999999999;
88                rayRefs = 0;
89                maxRayContriNodes = 0;
90                mGlobalCostMisses = 0;
91        }
92
93
94public:
95
96        // total number of nodes
97        int nodes;
98        // number of splits
99        int splits;
100        // maximal reached depth
101        int maxDepth;
102        // minimal depth
103        int minDepth;
104        // max depth nodes
105        int maxDepthNodes;
106        // accumulated depth (used to compute average)
107        int accumDepth;
108        // minimum area nodes
109        int minProbabilityNodes;
110        /// nodes termination because of max cost ratio;
111        int maxCostNodes;
112        // global cost ratio violations
113        int mGlobalCostMisses;
114
115        //////////////////
116        // nodes with minimum objects
117        int minObjectsNodes;
118        // max number of rays per node
119        int maxObjectRefs;
120        // min number of rays per node
121        int minObjectRefs;
122        /// object references
123        int objectRefs;
124        // leaves with no objects
125        int emptyNodes;
126
127        //////////////////////////
128        // nodes with minimum rays
129        int minRaysNodes;
130        // max number of rays per node
131        int maxRayRefs;
132        // min number of rays per node
133        int minRayRefs;
134        /// object references
135        int rayRefs;
136        /// nodes with max ray contribution
137        int maxRayContriNodes;
138
139        void Print(ostream &app) const;
140
141        friend ostream &operator<<(ostream &s, const BvhStatistics &stat)
142        {
143                stat.Print(s);
144                return s;
145        }
146};
147
148
149/**
150    VspNode abstract class serving for interior and leaf node implementation
151*/
152class BvhNode
153{
154public:
155       
156        // types of vsp nodes
157        enum {Interior, Leaf};
158
159        BvhNode();
160        BvhNode(const AxisAlignedBox3 &bbox);
161        BvhNode(const AxisAlignedBox3 &bbox, BvhInterior *parent);
162
163        virtual ~BvhNode(){};
164
165        /** Determines whether this node is a leaf or not
166                @return true if leaf
167        */
168        virtual bool IsLeaf() const = 0;
169
170        /** Determines whether this node is a root
171                @return true if root
172        */
173        virtual bool IsRoot() const;
174
175        /** Returns parent node.
176        */
177        BvhInterior *GetParent();
178
179        /** Sets parent node.
180        */
181        void SetParent(BvhInterior *parent);
182
183        /** The bounding box specifies the node extent.
184        */
185        inline
186        AxisAlignedBox3 GetBoundingBox() const
187        { return mBoundingBox; }
188
189
190        inline
191        void SetBoundingBox(const AxisAlignedBox3 &boundingBox)
192        { mBoundingBox = boundingBox; }
193
194
195        /////////////////////////////////////
196        //-- mailing options
197       
198        static void NewMail(const int reserve = 1) {
199                sMailId += sReservedMailboxes;
200                sReservedMailboxes = reserve;
201        }
202       
203        void Mail() { mMailbox = sMailId; }
204        bool Mailed() const { return mMailbox == sMailId; }
205
206        void Mail(const int mailbox) { mMailbox = sMailId + mailbox; }
207        bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; }
208
209        int IncMail() { return ++ mMailbox - sMailId; }
210
211        static int sMailId;
212        int mMailbox;
213        static int sReservedMailboxes;
214
215        ///////////////////////////////////
216
217protected:
218       
219        /// the bounding box of the node
220        AxisAlignedBox3 mBoundingBox;
221        /// parent of this node
222        BvhInterior *mParent;
223};
224
225
226/** BSP interior node implementation
227*/
228class BvhInterior: public BvhNode
229{
230public:
231        /** Standard contructor taking a bounding box as argument.
232        */
233        BvhInterior(const AxisAlignedBox3 &bbox);
234        BvhInterior(const AxisAlignedBox3 &bbox, BvhInterior *parent);
235
236        ~BvhInterior();
237        /** @return false since it is an interior node
238        */
239        bool IsLeaf() const;
240       
241        BvhNode *GetBack() { return mBack; }
242        BvhNode *GetFront() { return mFront; }
243
244        /** Replace front or back child with new child.
245        */
246        void ReplaceChildLink(BvhNode *oldChild, BvhNode *newChild);
247
248        /** Replace front and back child.
249        */
250        void SetupChildLinks(BvhNode *front, BvhNode *back);
251
252        friend ostream &operator<<(ostream &s, const BvhInterior &A)
253        {
254                return s << A.mBoundingBox;
255        }
256
257protected:
258
259        /// back node
260        BvhNode *mBack;
261        /// front node
262        BvhNode *mFront;
263};
264
265
266/** BSP leaf node implementation.
267*/
268class BvhLeaf: public BvhNode
269{
270public:
271        /** Standard contructor taking a bounding box as argument.
272        */
273        BvhLeaf(const AxisAlignedBox3 &bbox);
274        BvhLeaf(const AxisAlignedBox3 &bbox, BvhInterior *parent);
275        BvhLeaf(const AxisAlignedBox3 &bbox, BvhInterior *parent, const int numObjects);
276
277        ~BvhLeaf();
278
279        /** @return true since it is an interior node
280        */
281        bool IsLeaf() const;
282       
283        SubdivisionCandidate *GetSubdivisionCandidate()// const
284        {
285                return mSubdivisionCandidate;
286        }
287
288        void SetSubdivisionCandidate(SubdivisionCandidate *candidate)
289        {
290                mSubdivisionCandidate = candidate;
291        }
292
293public:
294
295        /// Rays piercing this leaf.
296        VssRayContainer mVssRays;
297        /// objects
298        ObjectContainer mObjects;
299        /// universal counter
300        int mCounter;
301
302protected:
303
304        /// pointer to a split plane candidate splitting this leaf
305        SubdivisionCandidate *mSubdivisionCandidate;
306};
307
308
309typedef map<BvhNode *, BvhIntersectable *> BvhIntersectableMap;
310
311
312/** View Space Partitioning tree.
313*/
314class BvHierarchy
315{
316        friend class ViewCellsParseHandlers;
317        friend class HierarchyManager;
318
319protected:
320        struct SortableEntry;
321        typedef vector<SortableEntry> SortableEntryContainer;
322
323public:
324       
325        /** Additional data which is passed down the BSP tree during traversal.
326        */
327        class BvhTraversalData
328        { 
329        public:
330               
331                BvhTraversalData():
332                mNode(NULL),
333                mDepth(0),
334                mProbability(0.0),
335                mMaxCostMisses(0),
336                mAxis(0),
337                mNumRays(0)
338                {
339                        mSortedObjects[0] = mSortedObjects[1] = mSortedObjects[2] = NULL;
340                }
341               
342                BvhTraversalData(BvhLeaf *node,
343                                                 const int depth,
344                                                 const float v,
345                                                 const int numRays):
346                mNode(node),
347                mDepth(depth),
348                //mBoundingBox(box),
349                mProbability(v),
350                mMaxCostMisses(0),
351                mAxis(0),
352                mNumRays(numRays)
353                {
354                        mSortedObjects[0] = mSortedObjects[1] = mSortedObjects[2] = NULL;
355                }
356
357                /** Deletes contents and sets them to NULL.
358                */
359                void Clear()
360                {
361                        DEL_PTR(mNode);
362                        DEL_PTR(mSortedObjects[0]);
363                        DEL_PTR(mSortedObjects[1]);
364                        DEL_PTR(mSortedObjects[2]);
365                }
366
367                /// the current node
368                BvhLeaf *mNode;
369                /// current depth
370                int mDepth;
371                /// the probability that this node is seen
372                float mProbability;
373                /// the bounding box of the node
374                //AxisAlignedBox3 mBoundingBox;
375                /// how often this branch has missed the max-cost ratio
376                int mMaxCostMisses;
377                /// current axis
378                int mAxis;
379                /// number of rays
380                int mNumRays;
381                /// the sorted objects for the three dimensions
382                ObjectContainer *mSortedObjects[3];             
383    };
384
385
386        /** Candidate for a object space split.
387        */
388        class BvhSubdivisionCandidate: public SubdivisionCandidate
389        { 
390        public:
391
392        BvhSubdivisionCandidate(const BvhTraversalData &tData): mParentData(tData)
393                {};
394
395                ~BvhSubdivisionCandidate()
396                {
397                        mParentData.Clear();
398                }
399
400                int Type() const { return OBJECT_SPACE; }
401       
402                void EvalPriority()
403                {
404                        sBvHierarchy->EvalSubdivisionCandidate(*this); 
405                }
406
407                bool GlobalTerminationCriteriaMet() const
408                {
409                        return sBvHierarchy->GlobalTerminationCriteriaMet(mParentData);
410                }
411
412                BvhSubdivisionCandidate(
413                        const ObjectContainer &frontObjects,
414                        const ObjectContainer &backObjects,
415                        const BvhTraversalData &tData):
416                mFrontObjects(frontObjects), mBackObjects(backObjects), mParentData(tData)
417                {}
418
419                /// pointer to parent tree.
420                static BvHierarchy *sBvHierarchy;
421                /// parent data
422                BvhTraversalData mParentData;
423                /// the objects on the front of the potential split
424                ObjectContainer mFrontObjects;
425                /// the objects on the back of the potential split
426                ObjectContainer mBackObjects;
427        };
428
429        /** Struct for traversing line segment.
430        */
431        struct LineTraversalData
432        {
433                BvhNode *mNode;
434                Vector3 mExitPoint;
435               
436                float mMaxT;
437   
438                LineTraversalData () {}
439                LineTraversalData (BvhNode *n, const Vector3 &p, const float maxt):
440                mNode(n), mExitPoint(p), mMaxT(maxt) {}
441        };
442
443
444        /** Default constructor creating an empty tree.
445        */
446        BvHierarchy();
447
448        /** Default destructor.
449        */
450        ~BvHierarchy();
451
452        /** Returns tree statistics.
453        */
454        const BvhStatistics &GetStatistics() const;
455 
456        /** Returns bounding box of the specified node.
457        */
458        AxisAlignedBox3 GetBoundingBox(BvhNode *node) const;
459
460        /** Reads parameters from environment singleton.
461        */
462        void ReadEnvironment();
463
464        /** Evaluates candidate for splitting.
465        */
466        void EvalSubdivisionCandidate(BvhSubdivisionCandidate &splitData);
467
468        /** Returns list of leaves with pvs smaller than
469                a certain threshold.
470                @param onlyUnmailed if only the unmailed leaves should be considered
471                @param maxPvs the maximal pvs of a leaf to be added (-1 means unlimited)
472        */
473        void CollectLeaves(vector<BvhLeaf *> &leaves) const;
474
475        /** Returns bounding box of the whole tree (= bbox of root node)
476        */
477        AxisAlignedBox3 GetBoundingBox()const;
478
479        /** Returns root of the view space partitioning tree.
480        */
481        BvhNode *GetRoot() const;
482
483        /** A ray is cast possible intersecting the tree.
484                @param the ray that is cast.
485                @returns the number of intersections with objects stored in the tree.
486        */
487        //int CastRay(Ray &ray);
488
489        /** finds neighbouring leaves of this tree node.
490        */
491        int FindNeighbors(BvhLeaf *n,
492                                          vector<BvhLeaf *> &neighbors,
493                                          const bool onlyUnmailed) const;
494
495        /** Returns random leaf of BSP tree.
496                @param halfspace defines the halfspace from which the leaf is taken.
497        */
498        BvhLeaf *GetRandomLeaf(const Plane3 &halfspace);
499
500        /** Returns random leaf of BSP tree.
501                @param onlyUnmailed if only unmailed leaves should be returned.
502        */
503        BvhLeaf *GetRandomLeaf(const bool onlyUnmailed = false);
504
505        /** Casts line segment into the tree.
506                @param origin the origin of the line segment
507                @param termination the end point of the line segment
508                @returns view cells intersecting the line segment.
509        */
510    int CastLineSegment(const Vector3 &origin,
511                                                const Vector3 &termination,
512                                                ViewCellContainer &viewcells);
513               
514        /** Sets pointer to view cells manager.
515        */
516        void SetViewCellsManager(ViewCellsManager *vcm);
517
518        /** Writes tree to output stream
519        */
520        bool Export(OUT_STREAM &stream);
521
522        /** Returns or creates a new intersectable for use in a kd based pvs.
523                The OspTree is responsible for destruction of the intersectable.
524        */
525        BvhIntersectable *GetOrCreateBvhIntersectable(BvhNode *node);
526
527        /** Collects rays.
528        */
529        void CollectRays(const ObjectContainer &objects, VssRayContainer &rays) const;
530
531        /** Intersects box with the tree and returns the number of intersected boxes.
532                @returns number of view cells found
533        */
534        int ComputeBoxIntersections(
535                const AxisAlignedBox3 &box,
536                ViewCellContainer &viewCells) const;
537
538        /** Returns leaf the point pt lies in, starting from root.
539        */
540        BvhLeaf *GetLeaf(Intersectable *obj, BvhNode *root = NULL) const;
541
542        /** Sets a pointer to the view cells tree.
543        */
544        ViewCellsTree *GetViewCellsTree() const { return mViewCellsTree; }
545        /** See Get
546        */
547        void SetViewCellsTree(ViewCellsTree *vt) { mViewCellsTree = vt; }
548
549
550protected:
551
552        /** Returns true if tree can be terminated.
553        */
554        bool LocalTerminationCriteriaMet(const BvhTraversalData &data) const;
555
556        /** Returns true if global tree can be terminated.
557        */
558        bool GlobalTerminationCriteriaMet(const BvhTraversalData &data) const;
559
560        /** For sorting the objects during the heuristics
561        */
562        struct SortableEntry
563        {
564                Intersectable *mObject;
565                float mPos;
566
567                SortableEntry() {}
568
569                SortableEntry(Intersectable *obj, const float pos):
570                mObject(obj), mPos(pos)
571                {}
572
573                bool operator<(const SortableEntry &b) const
574                {
575                        return mPos < b.mPos;
576                }
577        };
578
579        /** Evaluate balanced object partition.
580        */
581        float EvalLocalObjectPartition(
582                const BvhTraversalData &tData,
583                const int axis,
584                ObjectContainer &objectsFront,
585                ObjectContainer &objectsBack);
586
587        float EvalSah(
588                const BvhTraversalData &tData,
589                const int axis,
590                ObjectContainer &objectsFront,
591                ObjectContainer &objectsBack);
592
593        /** Computes priority of the traversal data and stores it in tData.
594        */
595        void EvalPriority(BvhTraversalData &tData) const;
596
597        /** Evaluates render cost of the bv induced by these objects
598        */
599        float EvalRenderCost(const ObjectContainer &objects) const;
600
601        /** Evaluates tree stats in the BSP tree leafs.
602        */
603        void EvaluateLeafStats(const BvhTraversalData &data);
604
605        /** Subdivides node using a best split priority queue.
606            @param tQueue the best split priority queue
607                @param splitCandidate the candidate for the next split
608                @param globalCriteriaMet if the global termination criteria were already met
609                @returns new root of the subtree
610        */
611        BvhNode *Subdivide(
612                SplitQueue &tQueue,
613                SubdivisionCandidate *splitCandidate,
614                const bool globalCriteriaMet);
615       
616        /** Subdivides leaf.
617                @param sc the subdivisionCandidate holding all necessary data for subdivision           
618               
619                @param frontData returns the traversal data for the front node
620                @param backData returns the traversal data for the back node
621
622                @returns the new interior node = the of the subdivision
623        */
624        BvhInterior *SubdivideNode(
625                const BvhSubdivisionCandidate &sc,
626                BvhTraversalData &frontData,
627                BvhTraversalData &backData);
628
629        /** Splits the objects for the next subdivision.
630                @returns cost for this split
631        */
632        float SelectObjectPartition(
633                const BvhTraversalData &tData,
634                ObjectContainer &frontObjects,
635                ObjectContainer &backObjects);
636       
637        /** Writes the node to disk
638                @note: should be implemented as visitor.
639        */
640        void ExportNode(BvhNode *node, OUT_STREAM &stream);
641
642        void ExportObjects(BvhLeaf *leaf, OUT_STREAM &stream);
643
644        /** Returns estimated memory usage of tree.
645        */
646        float GetMemUsage() const;
647
648        /** Associates the objects with their bvh leaves.
649        */
650        static void AssociateObjectsWithLeaf(BvhLeaf *leaf);
651
652
653        /////////////////////////////
654        // Helper functions for local cost heuristics
655       
656        /** Prepare split candidates for cost heuristics using axis aligned splits.
657                @param node the current node
658                @param axis the current split axis
659        */
660        void PrepareLocalSubdivisionCandidates(
661                const BvhTraversalData &tData,
662                const int axis);
663
664        static void CreateLocalSubdivisionCandidates(
665                const ObjectContainer &objects,
666                SortableEntryContainer **subdivisionCandidates,
667                const bool sort,
668                const int axis);
669
670        /** Computes object partition with the best cost according to the heurisics.
671                @param tData the traversal data
672                @param axis the split axis
673                @param objectsFront the objects in the front child bv
674                @param objectsBack the objects in the back child bv
675                @param backObjectsStart the iterator marking the position where the back objects begin
676
677                @returns relative cost (relative to parent cost)
678        */
679        float EvalLocalCostHeuristics(
680                const BvhTraversalData &tData,
681                const int axis,
682                ObjectContainer &objectsFront,
683                ObjectContainer &objectsBack);
684
685        /** Evaluates the contribution to the front and back volume
686                when this object is changing sides in the bvs.
687
688                @param object the object
689                @param volLeft updates the left pvs
690                @param volPvs updates the right pvs
691        */
692        void EvalHeuristicsContribution(
693                Intersectable *obj,
694                float &volLeft,
695                float &volRight);
696
697        /** Prepares objects for the cost heuristics.
698                @returns sum of volume of associated view cells
699        */
700        float PrepareHeuristics(const BvhTraversalData &tData, const int axis);
701       
702        ////////////////////////////////////////////////
703
704
705        /** Prepares construction for vsp and osp trees.
706        */
707        AxisAlignedBox3 EvalBoundingBox(
708                const ObjectContainer &objects,
709                const AxisAlignedBox3 *parentBox = NULL) const;
710
711        /** Collects list of invalid candidates. Candidates
712                are invalidated by a view space subdivision step
713                that affects this candidate.
714        */
715        void CollectDirtyCandidates(
716                BvhSubdivisionCandidate *sc,
717                vector<SubdivisionCandidate *> &dirtyList);
718
719        /** Collect view cells which see this bvh leaf.
720        */
721        void CollectViewCells(
722                const ObjectContainer &objects,
723                ViewCellContainer &viewCells,
724                const bool setCounter = false) const;
725
726        /** Collects view cells which see an object.
727        */
728        void CollectViewCells(
729                Intersectable *object,
730                ViewCellContainer &viewCells,
731                const bool useMailBoxing,
732                const bool setCounter = false) const;
733
734        /** Rays will be clipped to the bounding box.
735        */
736        void PreprocessRays(
737                BvhLeaf *root,
738                const VssRayContainer &sampleRays,
739                RayInfoContainer &rays);
740
741        /** Print the subdivision stats in the subdivison log.
742        */
743        void PrintSubdivisionStats(const SubdivisionCandidate &tData);
744
745        /** Prints out the stats for this subdivision.
746        */
747        void AddSubdivisionStats(
748                const int viewCells,
749                const float renderCostDecr,
750                const float totalRenderCost);
751
752        /** Stores rays with objects that see the rays.
753        */
754        int AssociateObjectsWithRays(const VssRayContainer &rays) const;
755
756        /** Tests if object is in this leaf.
757                @note: assumes that objects are sorted by their id.
758        */
759        bool IsObjectInLeaf(BvhLeaf *, Intersectable *object) const;
760
761        /** Prepares the construction of the bv hierarchy and returns
762                the first subdivision candidate.
763        */
764        SubdivisionCandidate *PrepareConstruction(
765                const VssRayContainer &sampleRays,
766                const ObjectContainer &objects);
767
768        /** Resets bv hierarchy. E.g. deletes root and resets stats.
769        */
770        SubdivisionCandidate *Reset(
771                const VssRayContainer &rays,
772                const ObjectContainer &objects);
773
774        /** Evaluates volume of view cells that see the objects.
775        */
776        float EvalViewCellsVolume(const ObjectContainer &objects) const;
777
778        /** Creates initial list of sorted objects.
779        */
780        void CreateInitialSortedObjectList(BvhTraversalData &tData);
781
782        /** Assigns sorted objects to front and back data.
783        */
784        void AssignSortedObjects(
785                const BvhSubdivisionCandidate &sc,
786                BvhTraversalData &frontData,
787                BvhTraversalData &backData);
788       
789        /** Creates new root of hierarchy.
790        */
791        void CreateRoot(const ObjectContainer &objects);
792
793protected:
794       
795        /// pre-sorted subdivision candidtes for all three directions.
796        vector<SortableEntry> *mGlobalSubdivisionCandidates[3];
797        /// pointer to the hierarchy of view cells
798        ViewCellsTree *mViewCellsTree;
799        /// The view cells manager
800        ViewCellsManager *mViewCellsManager;
801        /// candidates for placing split planes during cost heuristics
802        vector<SortableEntry> *mSubdivisionCandidates;
803        /// Pointer to the root of the tree
804        BvhNode *mRoot;
805        /// Statistics for the object space partition
806        BvhStatistics mBvhStats;       
807        /// box around the whole view domain
808        AxisAlignedBox3 mBoundingBox;
809        /// the hierarchy manager
810        HierarchyManager *mHierarchyManager;
811
812
813        ////////////////////
814        //-- local termination criteria
815
816        /// maximal possible depth
817        int mTermMaxDepth;
818        /// mininum probability
819        float mTermMinProbability;
820        /// minimal number of objects
821        int mTermMinObjects;
822        /// maximal acceptable cost ratio
823        float mTermMaxCostRatio;
824        /// tolerance value indicating how often the max cost ratio can be failed
825        int mTermMissTolerance;
826        /// minimum number of rays
827        int mTermMinRays;
828
829
830        ////////////////////
831        //-- global termination criteria
832
833        float mTermMinGlobalCostRatio;
834        int mTermGlobalCostMissTolerance;
835       
836
837        /// maximal number of view cells
838        int mTermMaxLeaves;
839        /// maximal tree memory
840        float mMaxMemory;
841        /// the tree is out of memory
842        bool mOutOfMemory;
843
844
845        ////////////////////////////////////////
846        //-- split heuristics based parameters
847       
848        bool mUseCostHeuristics;
849        /// balancing factor for PVS criterium
850        float mCtDivCi;
851        /// if only driving axis should be used for split
852        bool mOnlyDrivingAxis;
853        /// current time stamp (used for keeping split history)
854        int mTimeStamp;
855        // if rays should be stored in leaves
856        bool mStoreRays;
857        // subdivision stats output file
858        ofstream  mSubdivisionStats;
859        /// keeps track of cost during subdivision
860        float mTotalCost;
861        /// keeps track of overall pvs size during subdivision
862        int mTotalPvsSize;
863        /// number of currenly generated view cells
864        int mCreatedLeaves;
865        /// represents min and max band for sweep
866        float mSplitBorder;
867        /// weight between render cost decrease and node render cost
868        float mRenderCostDecreaseWeight;
869        /// stores the kd node intersectables used for pvs
870        BvhIntersectableMap mBvhIntersectables;
871
872        bool mUseGlobalSorting;
873};
874
875}
876
877#endif
Note: See TracBrowser for help on using the repository browser.