Added Material::operator =

This commit is contained in:
Robert Osfield 2004-02-20 11:51:14 +00:00
parent b73d3c3e7f
commit ebbf92e43c
2 changed files with 26 additions and 0 deletions

View File

@ -77,6 +77,8 @@ class SG_EXPORT Material : public StateAttribute
return 0; // passed all the above comparison macro's, must be equal.
}
Material& operator = (const Material& rhs);
virtual void getAssociatedModes(std::vector<GLMode>& modes) const
{
// Have to think about the role of _colorMode

View File

@ -45,6 +45,30 @@ Material::~Material()
{
}
Material& Material:: operator = (const Material& rhs)
{
if (&rhs==this) return *this;
_colorMode= rhs._colorMode;
_ambientFrontAndBack= rhs._ambientFrontAndBack;
_ambientFront= rhs._ambientFront;
_ambientBack= rhs._ambientBack;
_diffuseFrontAndBack= rhs._diffuseFrontAndBack;
_diffuseFront= rhs._diffuseFront;
_diffuseBack= rhs._diffuseBack;
_specularFrontAndBack= rhs._specularFrontAndBack;
_specularFront= rhs._specularFront;
_specularBack= rhs._specularBack;
_emissionFrontAndBack= rhs._emissionFrontAndBack;
_emissionFront= rhs._emissionFront;
_emissionBack= rhs._emissionBack;
_shininessFrontAndBack= rhs._shininessFrontAndBack;
_shininessFront= rhs._shininessFront;
_shininessBack= rhs._shininessBack;
return *this;
}
void Material::setAmbient(Face face, const Vec4& ambient )
{