Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvsg::Material Class Reference

StateAttribute that determines the material properties to use for the following geometries. More...

#include <Material.h>

Inheritance diagram for nvsg::Material:

Inheritance graph
[legend]
Collaboration diagram for nvsg::Material:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const Material * clone (void) const
 Get a clone of this material. More...

virtual NVSG_API bool isDataShared (void) const
 Determine whether the data of this object is shared. More...

virtual NVSG_API DataID getDataID (void) const
 Get the DataID of the data of this object. More...

NVSG_API const nvmath::Vec3fgetAmbientColor (void) const
 Get the ambient color of this material. More...

NVSG_API const nvmath::Vec3fgetDiffuseColor (void) const
 Get the diffuse color of this material. More...

NVSG_API const nvmath::Vec3fgetEmissiveColor (void) const
 Get the emissive color of this material. More...

NVSG_API float getOpacity (void) const
 Get the opacity of this material. More...

NVSG_API const nvmath::Vec3fgetSpecularColor (void) const
 Get the specular color of this material. More...

NVSG_API float getSpecularExponent (void) const
 Get the specular exponent of this material. More...

NVSG_API void setAmbientColor (const nvmath::Vec3f &ac)
 Set the ambient color of this material. More...

NVSG_API void setDiffuseColor (const nvmath::Vec3f &dc)
 Set the diffuse color of this material. More...

NVSG_API void setEmissiveColor (const nvmath::Vec3f &ec)
 Set the emissive color of this material. More...

NVSG_API void setOpacity (const float o)
 Set the opacity of this material. More...

NVSG_API void setSpecularColor (const nvmath::Vec3f &sc)
 Set the specular color of this material. More...

NVSG_API void setSpecularExponent (const float se)
 Get the specular exponent of this material. More...

virtual NVSG_API bool containsTransparentMaterial (void) const
 Ask if this Material is transparent. More...


Static Public Methods

NVSG_API const Material * create (void)
 Create a Material. More...

NVSG_API const Material * createFromBase (const StateAttribute &rhs)
 Create a Material by copying from a StateAttribute. More...


Protected Methods

NVSG_API Material (void)
 Constructor. More...

NVSG_API Material (const StateAttribute &rhs)
 Partial Constructor. More...

NVSG_API Material (const Material &rhs)
 Copy Constructor. More...

virtual NVSG_API ~Material ()
 Protected destructor to prevent explicit creation on stack. More...


Detailed Description

StateAttribute that determines the material properties to use for the following geometries.

Default Values:
ambient color ( 0.3f, 0.3f, 0.3f )
diffuse color ( 0.9f, 0.9f, 0.9f )
emissive color ( 0.0f, 0.0f, 0.0f )
opacity ( 1.0f )
specular color ( 0.9f, 0.9f, 0.9f )
specular exponent ( 10.0f )


Constructor & Destructor Documentation

NVSG_API nvsg::Material::Material void    [protected]
 

Constructor.

NVSG_API nvsg::Material::Material const StateAttribute   rhs [protected]
 

Partial Constructor.

NVSG_API nvsg::Material::Material const Material &    rhs [protected]
 

Copy Constructor.

virtual NVSG_API nvsg::Material::~Material   [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

NVSG_API const Material* nvsg::Material::create void    [static]
 

Create a Material.

Returns:
a constant pointer to a Material.

NVSG_API const Material* nvsg::Material::createFromBase const StateAttribute   rhs [static]
 

Create a Material by copying from a StateAttribute.

Returns:
a constant pointer to a Material.
Parameters:
rhs  StateAttribute to copy from

virtual NVSG_API const Material* nvsg::Material::clone void    const [virtual]
 

Get a clone of this material.

Returns:
A pointer to the new created clone.

Implements nvsg::StateAttribute.

virtual NVSG_API bool nvsg::Material::isDataShared void    const [virtual]
 

Determine whether the data of this object is shared.

Returns:
true if the object's data is shared, otherwise false.

Reimplemented from nvsg::StateAttribute.

virtual NVSG_API DataID nvsg::Material::getDataID void    const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::StateAttribute.

const nvmath::Vec3f & nvsg::Material::getAmbientColor void    const [inline]
 

Get the ambient color of this material.

Ambient reflection, like ambient light, is nondirectional. Ambient reflection has a lesser impact on the apparent color of a rendered object, but it does affect the overall color and is most noticeable when little or no diffuse light reflects off the material. A material's ambient reflection is affected by the ambient light set for a scene. The default is (0.3,0.3,0.3).

Returns:
The ambient color of this material

const nvmath::Vec3f & nvsg::Material::getDiffuseColor void    const [inline]
 

Get the diffuse color of this material.

The diffuse and ambient colors of a material describe how a material reflects the ambient and diffuse light in a scene. Because most scenes contain much more diffuse light than ambient light, diffuse reflection plays the largest role in determining color. Additionally, because diffuse light is directional, the angle of incidence for diffuse light affects the overall intensity of the reflection. Diffuse reflection is greatest when the light strikes a vertex parallel to the vertex normal. As the angle increases, the effect of diffuse reflection diminishes. The amount of light reflected is the cosine of the angle between the incoming light and the vertex normal. The default is (0.9,0.9,0.9).

Returns:
The diffuse color of this material

const nvmath::Vec3f & nvsg::Material::getEmissiveColor void    const [inline]
 

Get the emissive color of this material.

Materials can be used to make a rendered object appear to be self-luminous. The emissive color of a material is used to describe the color of the emitted light. Emission affects an object's color and can, for example, make a dark material brighter and take on part of the emitted color. You can use a material's emissive color to add the illusion that an object is emitting light, without incurring the computational overhead of adding a light to the scene. Remember, materials with emissive color don't emit light that can be reflected by other objects in a scene. To achieve this reflected light, you need to place an additional light within the scene. The default is (0.0,0.0,0.0).

Returns:
The emissive color of this material

float nvsg::Material::getOpacity void    const [inline]
 

Get the opacity of this material.

The opacity of a material controls how much light is reflected and how much light goes through. An opacity of 1.0 means the material is completely opaque - all light is reflected and no objects behind shine through. An opacity of 0.0 means the material is completely transparent - no light is reflected and objects behind are seen undisturbed. The default is 1.0.

Returns:
The opacity of this material

const nvmath::Vec3f & nvsg::Material::getSpecularColor void    const [inline]
 

Get the specular color of this material.

Specular reflection creates highlights on objects, making them appear shiny. The material contains two members that describe the specular highlight color as well as the material's overall shininess. You establish the color of the specular highlights by setting the specular color to the desired RGBA color — the most common colors are white or light gray. The values you set in the specular exponent control how sharp the specular effects are. The default of the specular color is (0.9,0.9,0.9).

Returns:
The specular color of this material

float nvsg::Material::getSpecularExponent void    const [inline]
 

Get the specular exponent of this material.

Specular reflection creates highlights on objects, making them appear shiny. The material contains two members that describe the specular highlight color as well as the material's overall shininess. You establish the color of the specular highlights by setting the specular color to the desired RGBA color — the most common colors are white or light gray. The values you set in the specular exponent control how sharp the specular effects are. The default of the specular exponent is 10.0.

Returns:
The specular exponent of this material

void nvsg::Material::setAmbientColor const nvmath::Vec3f   ac [inline]
 

Set the ambient color of this material.

Ambient reflection, like ambient light, is nondirectional. Ambient reflection has a lesser impact on the apparent color of a rendered object, but it does affect the overall color and is most noticeable when little or no diffuse light reflects off the material. A material's ambient reflection is affected by the ambient light set for a scene. The default is (0.3,0.3,0.3).

void nvsg::Material::setDiffuseColor const nvmath::Vec3f   dc [inline]
 

Set the diffuse color of this material.

The diffuse and ambient colors of a material describe how a material reflects the ambient and diffuse light in a scene. Because most scenes contain much more diffuse light than ambient light, diffuse reflection plays the largest part in determining color. Additionally, because diffuse light is directional, the angle of incidence for diffuse light affects the overall intensity of the reflection. Diffuse reflection is greatest when the light strikes a vertex parallel to the vertex normal. As the angle increases, the effect of diffuse reflection diminishes. The amount of light reflected is the cosine of the angle between the incoming light and the vertex normal. The default is (0.9,0.9,0.9).

void nvsg::Material::setEmissiveColor const nvmath::Vec3f   ec [inline]
 

Set the emissive color of this material.

Materials can be used to make a rendered object appear to be self-luminous. The emissive color of a material is used to describe the color of the emitted light. Emission affects an object's color and can, for example, make a dark material brighter and take on part of the emitted color. You can use a material's emissive color to add the illusion that an object is emitting light, without incurring the computational overhead of adding a light to the scene. Remember, materials with emissive color don't emit light that can be reflected by other objects in a scene. To achieve this reflected light, you need to place an additional light within the scene. The default is (0.0,0.0,0.0).

void nvsg::Material::setOpacity const float    o [inline]
 

Set the opacity of this material.

The opacity of a material controls how much light is reflected and how much light goes through. An opacity of 1.0 means the material is completely opaque - all light is reflected and no objects behind shine through. An opacity of 0.0 means the material is completely transparent - no light is reflected and objects behind are seen undisturbed. The default is 1.0.

Returns:
The opacity of this material

void nvsg::Material::setSpecularColor const nvmath::Vec3f   sc [inline]
 

Set the specular color of this material.

Specular reflection creates highlights on objects, making them appear shiny. The material contains two members that describe the specular highlight color as well as the material's overall shininess. You establish the color of the specular highlights by setting the specular color to the desired RGBA color — the most common colors are white or light gray. The values you set in the specular exponent control how sharp the specular effects are. The default of the specular color is (0.9,0.9,0.9).

Returns:
The specular color of this material

void nvsg::Material::setSpecularExponent const float    se [inline]
 

Get the specular exponent of this material.

Specular reflection creates highlights on objects, making them appear shiny. The material contains two members that describe the specular highlight color as well as the material's overall shininess. You establish the color of the specular highlights by setting the specular color to the desired RGBA color — the most common colors are white or light gray. The values you set in the specular exponent control how sharp the specular effects are. The default of the specular exponent is 10.0.

Returns:
The specular exponent of this material

virtual NVSG_API bool nvsg::Material::containsTransparentMaterial void    const [virtual]
 

Ask if this Material is transparent.

Returns:
true, if it is transparent, otherwise false

Reimplemented from nvsg::StateAttribute.


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:29 2005 for NVSGSDK by NVIDIA