source: trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h @ 362

Revision 362, 1.7 KB checked in by mattausch, 19 years ago (diff)

added post merging bsp view cells
fixed bug at per ray subdivision

Line 
1#ifndef _ViewCell_H__
2#define _ViewCell_H__
3
4#include "Mesh.h"
5#include "Containers.h"
6#include "Ray.h"
7
8//namespace GtpVisibilityPreprocessor {
9 
10class BspInterior;
11class BspPvs;
12struct Triangle3;
13
14/**
15        View cell with an optional mesh representation
16*/
17class ViewCell: public MeshInstance
18{
19public:
20        ViewCell();
21        /** Constructor taking a mesh representing the shape of the viewcell.
22        */
23        ViewCell(Mesh *mesh);
24        /** Returns PvS.
25        */
26        ViewCellPvs &GetPvs();
27
28        int Type() const;
29
30        /** Derives viewcells from object container.
31                @param objects the intersectables the viewcells are derived from
32                @param viewCells the viewcells are returned in this container
33                @param maxViewCells the maximum number of viewcells created. if 0 => unbounded
34        */
35        static void DeriveViewCells(const ObjectContainer &objects,
36                                                                ViewCellContainer &viewCells,
37                                                                const int maxViewCells);
38
39       
40        /** Adds a passing ray to the passing ray container.
41        */
42        void AddPassingRay(const Ray &ray, const int contributions);   
43
44        /** Constructs view cell from base triangle. The ViewCell is extruded along the normal vector.
45                @param the base triangle
46                @param the height of the newly created view cell
47        */
48        static ViewCell *ExtrudeViewCell(const Triangle3 &baseTri, const float height);
49
50        /** Merges two view cells.
51                @note the piercing rays of the front and back will be ordered   
52                @returns new view cell based on the merging.
53        */
54        static ViewCell *Merge(ViewCell &front, ViewCell &back);
55
56
57        /// Ray set description of the rays passing through this node. 
58        PassingRaySet mPassingRays;
59
60        /// Rays piercing this view cell.
61        RayContainer mPiercingRays;
62
63protected:
64
65        /// the potentially visible objects
66        ViewCellPvs mPvs;
67};
68
69//}; // GtpVisibilityPreprocessor
70
71#endif
Note: See TracBrowser for help on using the repository browser.