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 |
|
---|
10 | class BspInterior;
|
---|
11 | class BspPvs;
|
---|
12 | struct Triangle3;
|
---|
13 | class BspLeaf;
|
---|
14 | class VspKdTree;
|
---|
15 | class VspKdTreeLeaf;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | View cell with an optional mesh representation
|
---|
19 | */
|
---|
20 | class ViewCell: public MeshInstance
|
---|
21 | {
|
---|
22 | public:
|
---|
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 |
|
---|
45 | protected:
|
---|
46 |
|
---|
47 | /// the potentially visible objects
|
---|
48 | ViewCellPvs mPvs;
|
---|
49 | };
|
---|
50 |
|
---|
51 | class BspViewCell: public ViewCell
|
---|
52 | {
|
---|
53 | public:
|
---|
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 |
|
---|
62 | class VspKdViewCell: public ViewCell
|
---|
63 | {
|
---|
64 | public:
|
---|
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 |
|
---|
75 | protected:
|
---|
76 | float mSize;
|
---|
77 | };
|
---|
78 | #endif
|
---|