Revision 240,
1.6 KB
checked in by mattausch, 19 years ago
(diff) |
added dome bsp tree stuff
|
Line | |
---|
1 | #ifndef __PVS_H
|
---|
2 | #define __PVS_H
|
---|
3 |
|
---|
4 | #include <map>
|
---|
5 |
|
---|
6 | class KdNode;
|
---|
7 | class BspNode;
|
---|
8 | class Ray;
|
---|
9 |
|
---|
10 | struct LtKdNode
|
---|
11 | {
|
---|
12 | bool operator()(const KdNode *a,
|
---|
13 | const KdNode *b) const
|
---|
14 | {
|
---|
15 | return a < b;
|
---|
16 | }
|
---|
17 |
|
---|
18 | };
|
---|
19 |
|
---|
20 | /** Superclass for all types of PVS data.
|
---|
21 | */
|
---|
22 | class Pvs {
|
---|
23 | public:
|
---|
24 | Pvs(): mSamples(0) {}
|
---|
25 | int mSamples;
|
---|
26 |
|
---|
27 | virtual int Compress() = 0;
|
---|
28 | virtual int GetSize() = 0;
|
---|
29 | };
|
---|
30 |
|
---|
31 | struct KdPvsData {
|
---|
32 | int mVisibleSamples;
|
---|
33 | KdPvsData() {}
|
---|
34 | KdPvsData(const int samples):mVisibleSamples(samples) {}
|
---|
35 | };
|
---|
36 |
|
---|
37 | typedef std::map<KdNode *, KdPvsData, LtKdNode> KdPvsMap;
|
---|
38 |
|
---|
39 |
|
---|
40 | class KdPvs: public Pvs {
|
---|
41 | public:
|
---|
42 |
|
---|
43 | KdPvsMap mEntries;
|
---|
44 |
|
---|
45 | KdPvs():mEntries() {}
|
---|
46 |
|
---|
47 | KdPvsData *Find(KdNode *node);
|
---|
48 | int AddNodeSample(KdNode *node);
|
---|
49 | int Compress() {return 0;}
|
---|
50 | int GetSize() { return mEntries.size(); }
|
---|
51 | void GetData(const int index,
|
---|
52 | KdNode *&node,
|
---|
53 | KdPvsData &data
|
---|
54 | );
|
---|
55 |
|
---|
56 | };
|
---|
57 |
|
---|
58 | struct LtBspNode
|
---|
59 | {
|
---|
60 | bool operator()(const BspNode *a,
|
---|
61 | const BspNode *b) const
|
---|
62 | {
|
---|
63 | return a < b;
|
---|
64 | }
|
---|
65 | };
|
---|
66 |
|
---|
67 | struct BspPvsData {
|
---|
68 | int mVisibleSamples;
|
---|
69 | BspPvsData() {}
|
---|
70 | BspPvsData(const int samples): mVisibleSamples(samples) {}
|
---|
71 | };
|
---|
72 |
|
---|
73 | typedef std::map<BspNode *, BspPvsData, LtBspNode> BspPvsMap;
|
---|
74 |
|
---|
75 | class BspPvs: public Pvs
|
---|
76 | {
|
---|
77 | public:
|
---|
78 | BspPvs(): mEntries() {}
|
---|
79 |
|
---|
80 | BspPvsMap mEntries;
|
---|
81 |
|
---|
82 | BspPvsData *Find(BspNode *node);
|
---|
83 | int AddNodeSample(BspNode *node);
|
---|
84 |
|
---|
85 | int Compress() {return 0;}
|
---|
86 |
|
---|
87 | int GetSize() {return mEntries.size();}
|
---|
88 |
|
---|
89 | void GetData(const int index,
|
---|
90 | BspNode *&node,
|
---|
91 | BspPvsData &data);
|
---|
92 | };
|
---|
93 |
|
---|
94 | #endif
|
---|
95 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.