class SG_EXPORT osg::Material

Material - encapsulates OpenGL glMaterial state

Inheritance:


Public Methods

[more] Material()
[more] Material(const Material& mat, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more] META_StateAttribute(Material, MATERIAL)
[more]virtual int compare(const StateAttribute& sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) const
[more]virtual void apply(State& state) const
[more]inline void setColorMode(const ColorMode mode)
[more]inline const ColorMode getColorMode() const
[more]void setAmbient( const Face face, const Vec4& ambient )
[more]const Vec4& getAmbient(const Face face) const
[more]inline const bool getAmbientFrontAndBack() const
[more]void setDiffuse( const Face face, const Vec4& diffuse )
[more]const Vec4& getDiffuse(const Face face) const
[more]inline const bool getDiffuseFrontAndBack() const
[more]void setSpecular( const Face face, const Vec4& specular )
Set specular value of specified face(s) of the material, valid specular[03] range is 00 to 10
[more]const Vec4& getSpecular(const Face face) const
Get the specular value for specified face
[more]inline const bool getSpecularFrontAndBack() const
Get the whether specular values are equal for front and back faces
[more]void setEmission( const Face face, const Vec4& emission )
Set emission value of specified face(s) of the material, valid emmison[03] range is 00 to 10
[more]const Vec4& getEmission(const Face face) const
Get the emmsion value for specified face
[more]inline const bool getEmissionFrontAndBack() const
Get the whether emission values are equal for front and back faces
[more]void setShininess( const Face face, float shininess )
Set shininess of specified face(s) of the material, valid shininess range is 00 to 10
[more]const float getShininess(const Face face) const
Get the shininess value for specified face
[more]inline const bool getShininessFrontAndBack() const
Get the whether shininess values are equal for front and back faces
[more]void setTransparency(const Face face, float trans)
Set the alpha value of ambient,diffuse,specular and emission colors, of specified face, to 1-transparency.
[more]void setAlpha(const Face face, float alpha)
Set the alpha value of ambient,diffuse,specular and emission colors.

Public Members

[more]enum Face
[more]enum ColorMode

Protected Fields

[more]ColorMode _colorMode
[more]bool _ambientFrontAndBack
[more]Vec4 _ambientFront
[more]Vec4 _ambientBack
[more]bool _diffuseFrontAndBack
[more]Vec4 _diffuseFront
[more]Vec4 _diffuseBack
[more]bool _specularFrontAndBack
[more]Vec4 _specularFront
[more]Vec4 _specularBack
[more]bool _emissionFrontAndBack
[more]Vec4 _emissionFront
[more]Vec4 _emissionBack
[more]bool _shininessFrontAndBack
[more]float _shininessFront
[more]float _shininessBack

Protected Methods

[more]virtual ~Material()


Inherited from StateAttribute:

Public Methods

ovirtual Object* cloneType() const
ovirtual Object* clone(const CopyOp&) const
ovirtual bool isSameKindAs(const Object* obj) const
ovirtual const char* className() const
ovirtual const Type getType() const
obool operator < (const StateAttribute& rhs) const
obool operator == (const StateAttribute& rhs) const
obool operator != (const StateAttribute& rhs) const
ovirtual void compile(State&) const

Public Members

otypedef GLenum GLMode
otypedef unsigned int GLModeValue
otypedef unsigned int OverrideValue
oenum Values
otypedef unsigned int Type
oenum Types


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Material - encapsulates OpenGL glMaterial state
o Material()

o Material(const Material& mat, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

o META_StateAttribute(Material, MATERIAL)

ovirtual int compare(const StateAttribute& sa) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) const

ovirtual void apply(State& state) const

oenum Face

o FRONT

o BACK

o FRONT_AND_BACK

oenum ColorMode

o AMBIENT

o DIFFUSE

o SPECULAR

o EMISSION

o AMBIENT_AND_DIFFUSE

o OFF

oinline void setColorMode(const ColorMode mode)

oinline const ColorMode getColorMode() const

ovoid setAmbient( const Face face, const Vec4& ambient )

oconst Vec4& getAmbient(const Face face) const

oinline const bool getAmbientFrontAndBack() const

ovoid setDiffuse( const Face face, const Vec4& diffuse )

oconst Vec4& getDiffuse(const Face face) const

oinline const bool getDiffuseFrontAndBack() const

ovoid setSpecular( const Face face, const Vec4& specular )
Set specular value of specified face(s) of the material, valid specular[03] range is 00 to 10

oconst Vec4& getSpecular(const Face face) const
Get the specular value for specified face

oinline const bool getSpecularFrontAndBack() const
Get the whether specular values are equal for front and back faces

ovoid setEmission( const Face face, const Vec4& emission )
Set emission value of specified face(s) of the material, valid emmison[03] range is 00 to 10

oconst Vec4& getEmission(const Face face) const
Get the emmsion value for specified face

oinline const bool getEmissionFrontAndBack() const
Get the whether emission values are equal for front and back faces

ovoid setShininess( const Face face, float shininess )
Set shininess of specified face(s) of the material, valid shininess range is 00 to 10

oconst float getShininess(const Face face) const
Get the shininess value for specified face

oinline const bool getShininessFrontAndBack() const
Get the whether shininess values are equal for front and back faces

ovoid setTransparency(const Face face, float trans)
Set the alpha value of ambient,diffuse,specular and emission colors, of specified face, to 1-transparency. Valid transparency range is 0.0 to 1.0.

ovoid setAlpha(const Face face, float alpha)
Set the alpha value of ambient,diffuse,specular and emission colors. Valid transparency range is 0.0 to 1.0.

ovirtual ~Material()

oColorMode _colorMode

obool _ambientFrontAndBack

oVec4 _ambientFront

oVec4 _ambientBack

obool _diffuseFrontAndBack

oVec4 _diffuseFront

oVec4 _diffuseBack

obool _specularFrontAndBack

oVec4 _specularFront

oVec4 _specularBack

obool _emissionFrontAndBack

oVec4 _emissionFront

oVec4 _emissionBack

obool _shininessFrontAndBack

ofloat _shininessFront

ofloat _shininessBack


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.