Revision 1001,
917 bytes
checked in by mattausch, 18 years ago
(diff) |
added mesh instance support
improved support for occlusion queries + other extensions
|
Rev | Line | |
---|
[162] | 1 | #ifndef __MATERIAL_H
|
---|
| 2 | #define __MATERIAL_H
|
---|
| 3 |
|
---|
[860] | 4 | namespace GtpVisibilityPreprocessor {
|
---|
[162] | 5 |
|
---|
| 6 |
|
---|
| 7 | class RgbColor
|
---|
| 8 | {
|
---|
| 9 | public:
|
---|
| 10 | float r, g, b;
|
---|
| 11 |
|
---|
| 12 | RgbColor():r(0.5f),g(0.5f),b(0.5f)
|
---|
| 13 | {
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | RgbColor(const float _r,
|
---|
| 17 | const float _g,
|
---|
| 18 | const float _b):r(_r),g(_g),b(_b)
|
---|
| 19 | {
|
---|
| 20 | }
|
---|
[608] | 21 |
|
---|
| 22 | friend RgbColor
|
---|
| 23 | RandomColor(const float a=0.0f, const float b=1.0f);
|
---|
| 24 |
|
---|
[162] | 25 | };
|
---|
| 26 |
|
---|
| 27 |
|
---|
| 28 | class Material
|
---|
| 29 | {
|
---|
| 30 | public:
|
---|
| 31 | RgbColor mDiffuseColor;
|
---|
| 32 | RgbColor mSpecularColor;
|
---|
| 33 | RgbColor mAmbientColor;
|
---|
| 34 |
|
---|
[1001] | 35 | Material(): mId(0)
|
---|
[162] | 36 | {
|
---|
| 37 | }
|
---|
[608] | 38 |
|
---|
[1001] | 39 | Material(const int id): mId(id)
|
---|
| 40 | {
|
---|
| 41 | }
|
---|
| 42 |
|
---|
[608] | 43 | Material(const RgbColor &color):mDiffuseColor(color),
|
---|
| 44 | mAmbientColor(color),
|
---|
[1001] | 45 | mSpecularColor(0,0,0), mId(0)
|
---|
[608] | 46 | {
|
---|
| 47 | }
|
---|
| 48 |
|
---|
[162] | 49 | friend Material RandomMaterial();
|
---|
| 50 |
|
---|
[1001] | 51 | /** Returns unique material id.
|
---|
| 52 | */
|
---|
| 53 | int GetId() const
|
---|
| 54 | {
|
---|
| 55 | return mId;
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | protected:
|
---|
| 59 |
|
---|
| 60 | // unique material id
|
---|
| 61 | int mId;
|
---|
[162] | 62 | };
|
---|
| 63 |
|
---|
| 64 |
|
---|
[860] | 65 | }
|
---|
[162] | 66 |
|
---|
| 67 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.