Revision 1001,
917 bytes
checked in by mattausch, 19 years ago
(diff) |
added mesh instance support
improved support for occlusion queries + other extensions
|
Line | |
---|
1 | #ifndef __MATERIAL_H
|
---|
2 | #define __MATERIAL_H
|
---|
3 |
|
---|
4 | namespace GtpVisibilityPreprocessor {
|
---|
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 | }
|
---|
21 |
|
---|
22 | friend RgbColor
|
---|
23 | RandomColor(const float a=0.0f, const float b=1.0f);
|
---|
24 |
|
---|
25 | };
|
---|
26 |
|
---|
27 |
|
---|
28 | class Material
|
---|
29 | {
|
---|
30 | public:
|
---|
31 | RgbColor mDiffuseColor;
|
---|
32 | RgbColor mSpecularColor;
|
---|
33 | RgbColor mAmbientColor;
|
---|
34 |
|
---|
35 | Material(): mId(0)
|
---|
36 | {
|
---|
37 | }
|
---|
38 |
|
---|
39 | Material(const int id): mId(id)
|
---|
40 | {
|
---|
41 | }
|
---|
42 |
|
---|
43 | Material(const RgbColor &color):mDiffuseColor(color),
|
---|
44 | mAmbientColor(color),
|
---|
45 | mSpecularColor(0,0,0), mId(0)
|
---|
46 | {
|
---|
47 | }
|
---|
48 |
|
---|
49 | friend Material RandomMaterial();
|
---|
50 |
|
---|
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;
|
---|
62 | };
|
---|
63 |
|
---|
64 |
|
---|
65 | }
|
---|
66 |
|
---|
67 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.