Revision 265,
1.6 KB
checked in by mattausch, 19 years ago
(diff) |
did bsp stuff
|
Rev | Line | |
---|
[177] | 1 | #ifndef __PVS_H
|
---|
| 2 | #define __PVS_H
|
---|
| 3 |
|
---|
| 4 | #include <map>
|
---|
| 5 |
|
---|
| 6 | class KdNode;
|
---|
[240] | 7 | class BspNode;
|
---|
[191] | 8 | class Ray;
|
---|
[177] | 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 |
|
---|
[240] | 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 |
|
---|
[177] | 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 |
|
---|
[240] | 40 | class KdPvs: public Pvs {
|
---|
[177] | 41 | public:
|
---|
[240] | 42 |
|
---|
[177] | 43 | KdPvsMap mEntries;
|
---|
[191] | 44 |
|
---|
[240] | 45 | KdPvs():mEntries() {}
|
---|
[191] | 46 |
|
---|
[177] | 47 | KdPvsData *Find(KdNode *node);
|
---|
| 48 | int AddNodeSample(KdNode *node);
|
---|
| 49 | int Compress() {return 0;}
|
---|
[265] | 50 | int GetSize() { return (int)mEntries.size(); }
|
---|
[177] | 51 | void GetData(const int index,
|
---|
| 52 | KdNode *&node,
|
---|
| 53 | KdPvsData &data
|
---|
| 54 | );
|
---|
| 55 |
|
---|
| 56 | };
|
---|
| 57 |
|
---|
[240] | 58 | struct LtBspNode
|
---|
| 59 | {
|
---|
| 60 | bool operator()(const BspNode *a,
|
---|
| 61 | const BspNode *b) const
|
---|
| 62 | {
|
---|
| 63 | return a < b;
|
---|
| 64 | }
|
---|
| 65 | };
|
---|
[191] | 66 |
|
---|
[240] | 67 | struct BspPvsData {
|
---|
| 68 | int mVisibleSamples;
|
---|
| 69 | BspPvsData() {}
|
---|
| 70 | BspPvsData(const int samples): mVisibleSamples(samples) {}
|
---|
| 71 | };
|
---|
[191] | 72 |
|
---|
[240] | 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 |
|
---|
[260] | 87 | int GetSize() {return (int)mEntries.size();}
|
---|
[240] | 88 |
|
---|
| 89 | void GetData(const int index,
|
---|
| 90 | BspNode *&node,
|
---|
| 91 | BspPvsData &data);
|
---|
| 92 | };
|
---|
| 93 |
|
---|
[177] | 94 | #endif
|
---|
| 95 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.