15 #define OSG_MATERIAL 1
18 #include <osg/StateAttribute>
20 #ifndef OSG_GL_FIXED_FUNCTION_AVAILABLE
21 #define GL_AMBIENT 0x1200
22 #define GL_DIFFUSE 0x1201
23 #define GL_SPECULAR 0x1202
24 #define GL_EMISSION 0x1600
25 #define GL_AMBIENT_AND_DIFFUSE 0x1602
26 #define GL_COLOR_MATERIAL 0x0B57
40 _colorMode(mat._colorMode),
41 _ambientFrontAndBack(mat._ambientFrontAndBack),
42 _ambientFront(mat._ambientFront),
43 _ambientBack(mat._ambientBack),
44 _diffuseFrontAndBack(mat._diffuseFrontAndBack),
45 _diffuseFront(mat._diffuseFront),
46 _diffuseBack(mat._diffuseBack),
47 _specularFrontAndBack(mat._specularFrontAndBack),
48 _specularFront(mat._specularFront),
49 _specularBack(mat._specularBack),
50 _emissionFrontAndBack(mat._emissionFrontAndBack),
51 _emissionFront(mat._emissionFront),
52 _emissionBack(mat._emissionBack),
53 _shininessFrontAndBack(mat._shininessFrontAndBack),
54 _shininessFront(mat._shininessFront),
55 _shininessBack(mat._shininessBack) {}
97 virtual void apply(
State& state)
const;
102 FRONT_AND_BACK = GL_FRONT_AND_BACK
117 void setAmbient( Face face,
const Vec4& ambient );
118 const Vec4& getAmbient(Face face)
const;
121 void setDiffuse( Face face,
const Vec4& diffuse );
122 const Vec4& getDiffuse(Face face)
const;
128 void setSpecular( Face face,
const Vec4& specular );
131 const Vec4& getSpecular(Face face)
const;
141 void setEmission( Face face,
const Vec4& emission );
144 const Vec4& getEmission(Face face)
const;
154 void setShininess(Face face,
float shininess );
157 float getShininess(Face face)
const;
168 void setTransparency(Face face,
float trans);
173 void setAlpha(Face face,
float alpha);
bool getDiffuseFrontAndBack() const
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
void setColorMode(ColorMode mode)
virtual bool getModeUsage(StateAttribute::ModeUsage &) const
#define GL_AMBIENT_AND_DIFFUSE
bool _emissionFrontAndBack
bool _diffuseFrontAndBack
bool _specularFrontAndBack
bool getShininessFrontAndBack() const
bool getSpecularFrontAndBack() const
bool _shininessFrontAndBack
bool _ambientFrontAndBack
#define META_StateAttribute(library, name, type)
virtual int compare(const StateAttribute &sa) const
bool getAmbientFrontAndBack() const
#define COMPARE_StateAttribute_Parameter(parameter)
bool getEmissionFrontAndBack() const
Material(const Material &mat, const CopyOp ©op=CopyOp::SHALLOW_COPY)
ColorMode getColorMode() const