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(osg, 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 getAssociatedModes(std::vector<GLMode>& modes) const
[more]virtual void apply(State& state) const
[more]inline void setColorMode(ColorMode mode)
[more]inline ColorMode getColorMode() const
[more]void setAmbient( Face face, const Vec4& ambient )
[more]const Vec4& getAmbient(Face face) const
[more]inline bool getAmbientFrontAndBack() const
[more]void setDiffuse( Face face, const Vec4& diffuse )
[more]const Vec4& getDiffuse(Face face) const
[more]inline bool getDiffuseFrontAndBack() const
[more]void setSpecular( 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(Face face) const
Get the specular value for specified face
[more]inline bool getSpecularFrontAndBack() const
Get the whether specular values are equal for front and back faces
[more]void setEmission( 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(Face face) const
Get the emmsion value for specified face
[more]inline bool getEmissionFrontAndBack() const
Get the whether emission values are equal for front and back faces
[more]void setShininess(Face face, float shininess )
Set shininess of specified face(s) of the material, valid shininess range is 00 to 1280
[more]float getShininess(Face face) const
Get the shininess value for specified face
[more]inline bool getShininessFrontAndBack() const
Get the whether shininess values are equal for front and back faces
[more]void setTransparency(Face face, float trans)
Set the alpha value of ambient,diffuse,specular and emission colors, of specified face, to 1-transparency.
[more]void setAlpha(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* libraryName() const
ovirtual const char* className() const
ovirtual Type getType() const
ovirtual bool isTextureAttribute() 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(DataVariance dv)
oinline DataVariance getDataVariance() const
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

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

Protected Fields

omutable int _refCount
ostatic int _createdCount
ostatic int _deletedCount


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(osg, Material, MATERIAL)

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

ovirtual void getAssociatedModes(std::vector<GLMode>& modes) 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(ColorMode mode)

oinline ColorMode getColorMode() const

ovoid setAmbient( Face face, const Vec4& ambient )

oconst Vec4& getAmbient(Face face) const

oinline bool getAmbientFrontAndBack() const

ovoid setDiffuse( Face face, const Vec4& diffuse )

oconst Vec4& getDiffuse(Face face) const

oinline bool getDiffuseFrontAndBack() const

ovoid setSpecular( 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(Face face) const
Get the specular value for specified face

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

ovoid setEmission( 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(Face face) const
Get the emmsion value for specified face

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

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

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

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

ovoid setTransparency(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(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++.