Gazebo Rendering

API Reference

3.7.2

#include <BaseMaterial.hh>

Public Member Functions

virtual ~BaseMaterial ()
 
virtual math::Color Ambient () const override
 Get the ambient color. More...
 
virtual bool CastShadows () const override
 Determine if this material casts shadows. More...
 
virtual void ClearEmissiveMap () override
 Removes any emissive map mapped to this material. More...
 
virtual void ClearEnvironmentMap () override
 Removes any environment map mapped to this material. More...
 
virtual void ClearMetalnessMap () override
 Removes any metalness map mapped to this material. More...
 
virtual void ClearNormalMap () override
 Removes any normal map mapped to this material. More...
 
virtual void ClearRoughnessMap () override
 Removes any roughness map mapped to this material. More...
 
virtual void ClearTexture () override
 Removes any texture mapped to this material. More...
 
virtual MaterialPtr Clone (const std::string &_name="") const override
 Clone this material. More...
 
virtual void CopyFrom (const common::Material &_material) override
 Copy properties from given Material. More...
 
virtual void CopyFrom (ConstMaterialPtr _material) override
 Copy properties from given Material. More...
 
virtual bool DepthCheckEnabled () const override
 Determine if depth buffer checking is enabled. More...
 
virtual bool DepthWriteEnabled () const override
 Determine if depth buffer writing is enabled. More...
 
virtual math::Color Diffuse () const override
 Get the diffuse color. More...
 
virtual math::Color Emissive () const override
 Get the emissive color. More...
 
virtual std::string EmissiveMap () const override
 Get the URI of the emissive map file. More...
 
virtual std::string EnvironmentMap () const override
 Get the URI of the environment map file. More...
 
virtual std::string FragmentShader () const override
 Get path to the fragment shader. More...
 
virtual ShaderParamsPtr FragmentShaderParams () override
 Get params for the fragment shader. More...
 
virtual bool HasEmissiveMap () const override
 Determine if this material has an emissive map. More...
 
virtual bool HasEnvironmentMap () const override
 Determine if this material has a environment map. More...
 
virtual bool HasMetalnessMap () const override
 Determine if this material has a metalness map. More...
 
virtual bool HasNormalMap () const override
 Determine if this material has a normal map. More...
 
virtual bool HasRoughnessMap () const override
 Determine if this material has a roughness map. More...
 
virtual bool HasTexture () const override
 Determine if this material has a texture. More...
 
virtual bool LightingEnabled () const override
 Determine if lighting affects this material. More...
 
virtual float Metalness () const override
 Get the metalness value of this material. More...
 
virtual std::string MetalnessMap () const override
 Get the URI of the metalness map file. More...
 
virtual std::string NormalMap () const override
 Get the URI of the normal map file. More...
 
virtual void PreRender () override
 Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender. More...
 
virtual bool ReceiveShadows () const override
 Determine if this material receives shadows. More...
 
virtual bool ReflectionEnabled () const override
 Determine if this material has a reflection. More...
 
virtual double Reflectivity () const override
 Get the reflectivity value. More...
 
virtual float Roughness () const override
 Get the roughness value of this material. More...
 
virtual std::string RoughnessMap () const override
 Get the URI of the roughness map file. More...
 
virtual void SetAmbient (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the ambient color. More...
 
virtual void SetAmbient (const math::Color &_color) override
 Set the ambient color. More...
 
virtual void SetCastShadows (const bool _castShadows) override
 Specify if this material casts shadows. More...
 
virtual void SetDepthCheckEnabled (bool _enabled) override
 Specify if depth buffer checking is enabled. More...
 
virtual void SetDepthMaterial (const double far, const double near) override
 Configuration for Depth Material. More...
 
virtual void SetDepthWriteEnabled (bool _enabled) override
 Specify if depth buffer writing is enabled. More...
 
virtual void SetDiffuse (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the diffuse color. More...
 
virtual void SetDiffuse (const math::Color &_color) override
 Set the diffuse color. More...
 
virtual void SetEmissive (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the emissive color. More...
 
virtual void SetEmissive (const math::Color &_color) override
 Set the emissive color. More...
 
virtual void SetEmissiveMap (const std::string &_emissiveMap) override
 Set the material emissive map. More...
 
virtual void SetEnvironmentMap (const std::string &_metalnessMap) override
 Set the material environment map. More...
 
virtual void SetFragmentShader (const std::string &_path) override
 Set the fragment shader. More...
 
virtual void SetLightingEnabled (const bool _enabled) override
 Specify if lighting affects this material. More...
 
virtual void SetMetalness (const float _metalness) override
 Set the metalness value. Only affects material of type MT_PBS. More...
 
virtual void SetMetalnessMap (const std::string &_metalnessMap) override
 Set the material metalness map. More...
 
virtual void SetNormalMap (const std::string &_normalMap) override
 Set the material normal map. More...
 
virtual void SetReceiveShadows (const bool _receiveShadows) override
 Specify if this material receives shadows. More...
 
virtual void SetReflectionEnabled (const bool _enabled) override
 Specify if this material has a reflection. More...
 
virtual void SetReflectivity (const double _reflectivity) override
 Set the reflectivity value. More...
 
virtual void SetRoughness (const float _roughness) override
 Set the roughness value. Only affects material of type MT_PBS. More...
 
virtual void SetRoughnessMap (const std::string &_roughnessMap) override
 Set the material roughness map. More...
 
virtual void SetShaderType (enum ShaderType _type) override
 Set the ShaderType value. More...
 
virtual void SetShininess (const double _shininess) override
 Set the shininess value. More...
 
virtual void SetSpecular (const double _r, const double _g, const double _b, const double _a=1.0) override
 Set the specular color. More...
 
virtual void SetSpecular (const math::Color &_color) override
 Set the specular color. More...
 
virtual void SetTexture (const std::string &_texture) override
 Set the material texture. More...
 
virtual void SetTransparency (const double _transparency) override
 Set the transparency value. More...
 
virtual void SetVertexShader (const std::string &_path) override
 Set the vertex shader. More...
 
virtual enum ShaderType ShaderType () const override
 Get the ShaderType value. More...
 
virtual double Shininess () const override
 Get the shininess value. More...
 
virtual math::Color Specular () const override
 Get the specular color. More...
 
virtual std::string Texture () const override
 Get the URI of the texture file. More...
 
virtual double Transparency () const override
 Get the transparency value. More...
 
virtual MaterialType Type () const override
 Removes any metalness map mapped to this material. More...
 
virtual std::string VertexShader () const override
 Get path to the vertex shader. More...
 
virtual ShaderParamsPtr VertexShaderParams () override
 Get params for the vertex shader. More...
 
- Public Member Functions inherited from Material
virtual ~Material ()
 Deconstructor. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 Destructor. More...
 
virtual void Destroy ()=0
 Destroy any resources associated with this object. Invoking any other functions after destroying an object will result in undefined behavior. More...
 
virtual unsigned int Id () const =0
 Get the object ID. This ID will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual std::string Name () const =0
 Get the object name. This name will be unique across all objects inside a given scene, but necessarily true for objects across different scenes. More...
 
virtual void PostRender ()=0
 Post process this object and any of its children after rendering. More...
 
virtual ScenePtr Scene () const =0
 Get the Scene that created this object. More...
 

Protected Member Functions

 BaseMaterial ()
 
virtual void Reset ()
 

Protected Attributes

math::Color ambient
 Ambient color. More...
 
bool castShadows = true
 Set to true to enable object with this material to cast shadows. More...
 
bool depthCheckEnabled = true
 Flag to indicate if depth buffer checking is enabled. More...
 
bool depthWriteEnabled = true
 Flag to indicate if depth buffer writing is enabled. More...
 
math::Color diffuse
 Diffuse color. More...
 
math::Color emissive
 Emissive color. More...
 
bool lightingEnabled = false
 Flag to indicate if dynamic lighting is enabled. More...
 
bool receiveShadows = true
 True if material receives shadows. More...
 
bool reflectionEnabled = false
 Flag to indicate if reflection is enabled. More...
 
double reflectivity = 0.0
 Reflectivity. More...
 
double shininess = 0.0
 Shininess factor. More...
 
math::Color specular
 Specular color. More...
 
double transparency = 0.0
 Transparent. 1: fully transparent, 0: opaque. More...
 

Constructor & Destructor Documentation

◆ BaseMaterial()

BaseMaterial
protected

◆ ~BaseMaterial()

~BaseMaterial
virtual

Member Function Documentation

◆ Ambient()

math::Color Ambient ( ) const
overridevirtual

Get the ambient color.

Returns
The ambient color

Implements Material.

◆ CastShadows()

bool CastShadows ( ) const
overridevirtual

Determine if this material casts shadows.

Returns
True if this material casts shadows

Implements Material.

◆ ClearEmissiveMap()

void ClearEmissiveMap ( )
overridevirtual

Removes any emissive map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearEnvironmentMap()

void ClearEnvironmentMap ( )
overridevirtual

Removes any environment map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearMetalnessMap()

void ClearMetalnessMap ( )
overridevirtual

Removes any metalness map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearNormalMap()

void ClearNormalMap ( )
overridevirtual

Removes any normal map mapped to this material.

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ ClearRoughnessMap()

void ClearRoughnessMap ( )
overridevirtual

Removes any roughness map mapped to this material.

Implements Material.

Reimplemented in Ogre2Material.

◆ ClearTexture()

void ClearTexture ( )
overridevirtual

Removes any texture mapped to this material.

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ Clone()

MaterialPtr Clone ( const std::string _name = "") const
overridevirtual

Clone this material.

Returns
New cloned material

Implements Material.

◆ CopyFrom() [1/2]

void CopyFrom ( const common::Material _material)
overridevirtual

Copy properties from given Material.

Parameters
[in]_materialSource Material to be copied from

Implements Material.

◆ CopyFrom() [2/2]

void CopyFrom ( ConstMaterialPtr  _material)
overridevirtual

Copy properties from given Material.

Parameters
[in]_materialSource Material to be copied from

Implements Material.

◆ DepthCheckEnabled()

bool DepthCheckEnabled ( ) const
overridevirtual

Determine if depth buffer checking is enabled.

Returns
True if depth check is enabled

Implements Material.

◆ DepthWriteEnabled()

bool DepthWriteEnabled ( ) const
overridevirtual

Determine if depth buffer writing is enabled.

Returns
True if depth buffer writing is enabled

Implements Material.

◆ Diffuse()

math::Color Diffuse ( ) const
overridevirtual

Get the diffuse color.

Returns
The diffuse color

Implements Material.

◆ Emissive()

math::Color Emissive ( ) const
overridevirtual

Get the emissive color.

Returns
The emissive color

Implements Material.

◆ EmissiveMap()

std::string EmissiveMap ( ) const
overridevirtual

Get the URI of the emissive map file.

Returns
URI of the emissive map file

Implements Material.

◆ EnvironmentMap()

std::string EnvironmentMap ( ) const
overridevirtual

Get the URI of the environment map file.

Returns
URI of the environment map file

Implements Material.

◆ FragmentShader()

std::string FragmentShader ( ) const
overridevirtual

Get path to the fragment shader.

Returns
Path to fragment shader

Implements Material.

◆ FragmentShaderParams()

ShaderParamsPtr FragmentShaderParams ( )
overridevirtual

Get params for the fragment shader.

Returns
editable parameters

Implements Material.

Reimplemented in OgreMaterial.

◆ HasEmissiveMap()

bool HasEmissiveMap ( ) const
overridevirtual

Determine if this material has an emissive map.

Returns
True if this material has an emissive map

Implements Material.

◆ HasEnvironmentMap()

bool HasEnvironmentMap ( ) const
overridevirtual

Determine if this material has a environment map.

Returns
True if this material has a environment map

Implements Material.

◆ HasMetalnessMap()

bool HasMetalnessMap ( ) const
overridevirtual

Determine if this material has a metalness map.

Returns
True if this material has a metalness map

Implements Material.

◆ HasNormalMap()

bool HasNormalMap ( ) const
overridevirtual

Determine if this material has a normal map.

Returns
True if this material has a normal map

Implements Material.

◆ HasRoughnessMap()

bool HasRoughnessMap ( ) const
overridevirtual

Determine if this material has a roughness map.

Returns
True if this material has a roughness map

Implements Material.

◆ HasTexture()

bool HasTexture ( ) const
overridevirtual

Determine if this material has a texture.

Returns
True if this material has a texture

Implements Material.

◆ LightingEnabled()

bool LightingEnabled ( ) const
overridevirtual

Determine if lighting affects this material.

Returns
True if lighting affects this material

Implements Material.

◆ Metalness()

float Metalness ( ) const
overridevirtual

Get the metalness value of this material.

Returns
Material metalness

Implements Material.

◆ MetalnessMap()

std::string MetalnessMap ( ) const
overridevirtual

Get the URI of the metalness map file.

Returns
URI of the metalness map file

Implements Material.

◆ NormalMap()

std::string NormalMap ( ) const
overridevirtual

Get the URI of the normal map file.

Returns
URI of the normal map file

Implements Material.

◆ PreRender()

void PreRender ( )
overridevirtual

Prepare this object and any of its children for rendering. This should be called for each object in a scene just before rendering, which can be achieved by a single call to Scene::PreRender.

Implements Object.

Reimplemented in Ogre2Material, and OgreMaterial.

◆ ReceiveShadows()

bool ReceiveShadows ( ) const
overridevirtual

Determine if this material receives shadows.

Returns
True if this material receives shadows

Implements Material.

◆ ReflectionEnabled()

bool ReflectionEnabled ( ) const
overridevirtual

Determine if this material has a reflection.

Returns
True if this material has a reflection

Implements Material.

◆ Reflectivity()

double Reflectivity ( ) const
overridevirtual

Get the reflectivity value.

Returns
The reflectivity value

Implements Material.

◆ Reset()

void Reset
protectedvirtual

◆ Roughness()

float Roughness ( ) const
overridevirtual

Get the roughness value of this material.

Returns
Material roughness

Implements Material.

◆ RoughnessMap()

std::string RoughnessMap ( ) const
overridevirtual

Get the URI of the roughness map file.

Returns
URI of the roughness map file

Implements Material.

◆ SetAmbient() [1/2]

void SetAmbient ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the ambient color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetAmbient() [2/2]

void SetAmbient ( const math::Color _color)
overridevirtual

Set the ambient color.

Parameters
[in]_colorNew ambient color

Implements Material.

Reimplemented in OgreMaterial.

◆ SetCastShadows()

void SetCastShadows ( const bool  _castShadows)
overridevirtual

Specify if this material casts shadows.

Parameters
[in]_castShadowsTrue if this material casts shadows

Implements Material.

Reimplemented in OgreMaterial.

◆ SetDepthCheckEnabled()

void SetDepthCheckEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer checking is enabled.

Parameters
[in]_enabledTrue if depth check is enabled

Implements Material.

Reimplemented in Ogre2Material, and OgreMaterial.

◆ SetDepthMaterial()

void SetDepthMaterial ( const double  far,
const double  near 
)
overridevirtual

Configuration for Depth Material.

Parameters
[in]farFar distance for normalized output
[in]nearNear distance for normalized output

Implements Material.

Reimplemented in OgreMaterial.

◆ SetDepthWriteEnabled()

void SetDepthWriteEnabled ( bool  _enabled)
overridevirtual

Specify if depth buffer writing is enabled.

Parameters
[in]_enabledTrue if depth buffer writing is enabled

Implements Material.

Reimplemented in Ogre2Material, and OgreMaterial.

◆ SetDiffuse() [1/2]

void SetDiffuse ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the diffuse color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetDiffuse() [2/2]

void SetDiffuse ( const math::Color _color)
overridevirtual

Set the diffuse color.

Parameters
[in]_colorNew diffuse color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetEmissive() [1/2]

void SetEmissive ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the emissive color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetEmissive() [2/2]

void SetEmissive ( const math::Color _color)
overridevirtual

Set the emissive color.

Parameters
[in]_colorNew emissive color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetEmissiveMap()

void SetEmissiveMap ( const std::string _emissiveMap)
overridevirtual

Set the material emissive map.

Parameters
[in]_emissiveMapURI of the new emissive map file

Implements Material.

Reimplemented in Ogre2Material.

◆ SetEnvironmentMap()

void SetEnvironmentMap ( const std::string _metalnessMap)
overridevirtual

Set the material environment map.

Parameters
[in]_metalnessMapURI of the new environment map file

Implements Material.

Reimplemented in Ogre2Material.

◆ SetFragmentShader()

void SetFragmentShader ( const std::string _path)
overridevirtual

Set the fragment shader.

Parameters
[in]_pathpath to a file containing a glsl shader

Implements Material.

Reimplemented in OgreMaterial.

◆ SetLightingEnabled()

void SetLightingEnabled ( const bool  _enabled)
overridevirtual

Specify if lighting affects this material.

Parameters
[in]_enabledTrue if lighting affects this material

Implements Material.

Reimplemented in OgreMaterial.

◆ SetMetalness()

void SetMetalness ( const float  _metalness)
overridevirtual

Set the metalness value. Only affects material of type MT_PBS.

Parameters
[in]_metalnessMetalness to set to

Implements Material.

Reimplemented in Ogre2Material.

◆ SetMetalnessMap()

void SetMetalnessMap ( const std::string _metalnessMap)
overridevirtual

Set the material metalness map.

Parameters
[in]_metalnessMapURI of the new metalness map file

Implements Material.

Reimplemented in Ogre2Material.

◆ SetNormalMap()

void SetNormalMap ( const std::string _normalMap)
overridevirtual

Set the material normal map.

Parameters
[in]_normalMapURI of the new normal map file

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetReceiveShadows()

void SetReceiveShadows ( const bool  _receiveShadows)
overridevirtual

Specify if this material receives shadows.

Parameters
[in]_receiveShadowsTrue if this material receives shadows

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetReflectionEnabled()

void SetReflectionEnabled ( const bool  _enabled)
overridevirtual

Specify if this material has a reflection.

Parameters
[in]_enabledTrue if this material has a reflection

Implements Material.

Reimplemented in OgreMaterial.

◆ SetReflectivity()

void SetReflectivity ( const double  _reflectivity)
overridevirtual

Set the reflectivity value.

Parameters
[in]_reflectivityNew reflectivity value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetRoughness()

void SetRoughness ( const float  _roughness)
overridevirtual

Set the roughness value. Only affects material of type MT_PBS.

Parameters
[in]_roughnessRoughness to set to

Implements Material.

Reimplemented in Ogre2Material.

◆ SetRoughnessMap()

void SetRoughnessMap ( const std::string _roughnessMap)
overridevirtual

Set the material roughness map.

Parameters
[in]_roughnessMapURI of the new roughness map file

Implements Material.

Reimplemented in Ogre2Material.

◆ SetShaderType()

virtual void SetShaderType ( enum ShaderType  _type)
inlineoverridevirtual

Set the ShaderType value.

Parameters
[in]_typeNew ShaderType value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetShininess()

void SetShininess ( const double  _shininess)
overridevirtual

Set the shininess value.

Parameters
[in]_shininessNew shininess value

Implements Material.

Reimplemented in OgreMaterial.

◆ SetSpecular() [1/2]

void SetSpecular ( const double  _r,
const double  _g,
const double  _b,
const double  _a = 1.0 
)
overridevirtual

Set the specular color.

Parameters
[in]_rRed value
[in]_gGreen value
[in]_bBlue value
[in]_aAlpha value

Implements Material.

◆ SetSpecular() [2/2]

void SetSpecular ( const math::Color _color)
overridevirtual

Set the specular color.

Parameters
[in]_colorNew specular color

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetTexture()

void SetTexture ( const std::string _texture)
overridevirtual

Set the material texture.

Parameters
[in]_textureURI of the new texture file

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetTransparency()

void SetTransparency ( const double  _transparency)
overridevirtual

Set the transparency value.

Parameters
[in]_transparencyNew transparency value

Implements Material.

Reimplemented in OgreMaterial, and Ogre2Material.

◆ SetVertexShader()

void SetVertexShader ( const std::string _path)
overridevirtual

Set the vertex shader.

Parameters
[in]_pathpath to a file containing a glsl shader

Implements Material.

Reimplemented in OgreMaterial.

◆ ShaderType()

virtual enum ShaderType ShaderType ( ) const
inlineoverridevirtual

Get the ShaderType value.

Returns
The ShaderType value

Implements Material.

◆ Shininess()

double Shininess ( ) const
overridevirtual

Get the shininess value.

Returns
The shininess value

Implements Material.

◆ Specular()

math::Color Specular ( ) const
overridevirtual

Get the specular color.

Returns
The specular color

Implements Material.

◆ Texture()

std::string Texture ( ) const
overridevirtual

Get the URI of the texture file.

Returns
URI of the texture file

Implements Material.

◆ Transparency()

double Transparency ( ) const
overridevirtual

Get the transparency value.

Returns
The transparency value

Implements Material.

◆ Type()

MaterialType Type ( ) const
overridevirtual

Removes any metalness map mapped to this material.

Implements Material.

◆ VertexShader()

std::string VertexShader ( ) const
overridevirtual

Get path to the vertex shader.

Returns
Path to vertex shader

Implements Material.

◆ VertexShaderParams()

ShaderParamsPtr VertexShaderParams ( )
overridevirtual

Get params for the vertex shader.

Returns
editable parameters

Implements Material.

Reimplemented in OgreMaterial.

Member Data Documentation

◆ ambient

math::Color ambient
protected

Ambient color.

◆ castShadows

bool castShadows = true
protected

Set to true to enable object with this material to cast shadows.

◆ depthCheckEnabled

bool depthCheckEnabled = true
protected

Flag to indicate if depth buffer checking is enabled.

◆ depthWriteEnabled

bool depthWriteEnabled = true
protected

Flag to indicate if depth buffer writing is enabled.

◆ diffuse

math::Color diffuse
protected

Diffuse color.

◆ emissive

math::Color emissive
protected

Emissive color.

◆ lightingEnabled

bool lightingEnabled = false
protected

Flag to indicate if dynamic lighting is enabled.

◆ receiveShadows

bool receiveShadows = true
protected

True if material receives shadows.

◆ reflectionEnabled

bool reflectionEnabled = false
protected

Flag to indicate if reflection is enabled.

◆ reflectivity

double reflectivity = 0.0
protected

Reflectivity.

◆ shininess

double shininess = 0.0
protected

Shininess factor.

◆ specular

math::Color specular
protected

Specular color.

◆ transparency

double transparency = 0.0
protected

Transparent. 1: fully transparent, 0: opaque.


The documentation for this class was generated from the following file: