Revision 2575,
1.3 KB
checked in by bittner, 17 years ago
(diff) |
big merge: preparation for havran ray caster, check if everything works
|
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 |
|
---|
[2148] | 25 | // Mapping from interval 0.0-1.0 to RGB using "rainbow" color map
|
---|
| 26 | // (range of hue from 0-240)
|
---|
| 27 |
|
---|
[2173] | 28 | friend RgbColor RainbowColorMapping(const float value);
|
---|
[2148] | 29 |
|
---|
[162] | 30 | };
|
---|
| 31 |
|
---|
| 32 |
|
---|
[2575] | 33 | // Forward declarations
|
---|
| 34 | RgbColor RandomColor(const float a, const float b);
|
---|
| 35 |
|
---|
| 36 | // Mapping from interval 0.0-1.0 to RGB using "rainbow" color map
|
---|
| 37 | // (range of hue from 0-240)
|
---|
| 38 | RgbColor RainbowColorMapping(const float value);
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 |
|
---|
[162] | 42 | class Material
|
---|
| 43 | {
|
---|
| 44 | public:
|
---|
| 45 | RgbColor mDiffuseColor;
|
---|
| 46 | RgbColor mSpecularColor;
|
---|
| 47 | RgbColor mAmbientColor;
|
---|
| 48 |
|
---|
[1001] | 49 | Material(): mId(0)
|
---|
[162] | 50 | {
|
---|
| 51 | }
|
---|
[608] | 52 |
|
---|
[1001] | 53 | Material(const int id): mId(id)
|
---|
| 54 | {
|
---|
| 55 | }
|
---|
| 56 |
|
---|
[608] | 57 | Material(const RgbColor &color):mDiffuseColor(color),
|
---|
| 58 | mAmbientColor(color),
|
---|
[1001] | 59 | mSpecularColor(0,0,0), mId(0)
|
---|
[608] | 60 | {
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[162] | 63 | friend Material RandomMaterial();
|
---|
| 64 |
|
---|
[1001] | 65 | /** Returns unique material id.
|
---|
| 66 | */
|
---|
| 67 | int GetId() const
|
---|
| 68 | {
|
---|
| 69 | return mId;
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 | protected:
|
---|
| 73 |
|
---|
| 74 | // unique material id
|
---|
| 75 | int mId;
|
---|
[162] | 76 | };
|
---|
| 77 |
|
---|
| 78 |
|
---|
[2575] | 79 | extern Material RandomMaterial();
|
---|
| 80 |
|
---|
[860] | 81 | }
|
---|
[162] | 82 |
|
---|
| 83 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.