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

Revision 454, 1.5 KB checked in by mattausch, 19 years ago (diff)
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;
13class BspLeaf;
14class VspKdTree;
15class VspKdTreeLeaf;
16
17/**
18        View cell with an optional mesh representation
19*/
20class ViewCell: public MeshInstance
21{
22public:
23        ViewCell();
24        /** Constructor taking a mesh representing the shape of the viewcell.
25        */
26        ViewCell(Mesh *mesh);
27        /** Returns Pvs.
28        */
29        const ViewCellPvs &GetPvs() const;
30        ViewCellPvs &GetPvs();
31
32        int Type() const;
33       
34        /** Adds a passing ray to the passing ray container.
35        */
36        void AddPassingRay(const Ray &ray, const int contributions);   
37
38
39        /// Ray set description of the rays passing through this node. 
40        PassingRaySet mPassingRays;
41
42        /// Rays piercing this view cell.
43        RayContainer mPiercingRays;
44
45protected:
46
47        /// the potentially visible objects
48        ViewCellPvs mPvs;
49};
50
51class BspViewCell: public ViewCell
52{
53public:
54        BspViewCell(): mBspLeaves(0) {}
55        BspViewCell(Mesh *mesh):
56        ViewCell(mesh), mBspLeaves(0) {}
57
58        /// Leaves which hold this view cell.
59        vector<BspLeaf *> mBspLeaves;
60};
61
62class VspKdViewCell: public ViewCell
63{
64public:
65        VspKdViewCell(): mVspKdLeaves(0) {}
66        VspKdViewCell(Mesh *mesh):
67        ViewCell(mesh), mVspKdLeaves(0) {}
68
69        float GetSize() {return 0;}
70        void SetSize(float size) {mSize = size;}
71
72        /// Leaves which hold this view cell.
73        vector<VspKdTreeLeaf *> mVspKdLeaves;
74
75protected:
76        float mSize;
77};
78#endif
Note: See TracBrowser for help on using the repository browser.