Gizmo3D

gzMaterial Class Reference

#include <gzMaterial.h>

Inheritance diagram for gzMaterial:

gzObject gzNameInterface gzUserData gzReference gzSerializeData gzSharedMemory gzTypeInterface List of all members.

Public Member Functions

 GZ_DECLARE_TYPE_INTERFACE_EXPORT (1)
 gzMaterial (const gzString &name=GZ_EMPTY_STRING)
 Constructor.
virtual ~gzMaterial ()
 Destructor.
virtual gzVoid activate (gzContext *context, gzEnum face)
gzVoid useColorAsMaterial (gzBool on, gzEnum mode=GZ_AMBIENT_AND_DIFFUSE)
gzVoid setAmbient (const gzRGBA &matcol)
 Sets the ambient property for the material.
gzVoid setDiffuse (const gzRGBA &matcol)
 Sets the diffuse property for the material.
gzVoid setSpecular (const gzRGBA &matcol)
 Sets the specular property for the material.
gzVoid setEmission (const gzRGBA &matcol)
 Sets the emissive light for the material.
gzVoid setAmbient (gzFloat red=1, gzFloat green=1, gzFloat blue=1, gzFloat alpha=1)
 Sets the ambient property for the material.
gzVoid setDiffuse (gzFloat red=1, gzFloat green=1, gzFloat blue=1, gzFloat alpha=1)
 Sets the diffuse property for the material.
gzVoid setSpecular (gzFloat red=1, gzFloat green=1, gzFloat blue=1, gzFloat alpha=1)
 Sets the specular property for the material.
gzVoid setEmission (gzFloat red=1, gzFloat green=1, gzFloat blue=1, gzFloat alpha=1)
 Sets the emissive light for the material.
gzVoid setShininess (gzFloat shininess)
 Sets the size of the highlight.
gzVoid setMaterialAlpha (gzFloat value)
 Specifies the alpha value for the material.
gzRGBAgetAmbient ()
 Returns the ambient color.
gzRGBAgetDiffuse ()
 Returns the diffuse color.
gzRGBAgetSpecular ()
 Returns the specular color.
gzRGBAgetEmission ()
 Returns the emmision color.
gzFloat getShininess ()
 Returns the shininess factor.
virtual gzReferenceclone () const
 Clone interface.
virtual gzBool useDeepCopy ()
 Overrides the gzReference useDeepCopyMode() to use gzNodeCopyMode.
gzBool operator== (const gzMaterial &right) const
 Equal operator.

Static Public Member Functions

static gzVoid deactivate (gzContext *context)

Detailed Description

Examples:

cube.cpp, materialDemo.cpp, and tree.cpp.

Definition at line 51 of file gzMaterial.h.


Constructor & Destructor Documentation

gzMaterial::gzMaterial const gzString name = GZ_EMPTY_STRING  ) 
 

Constructor.

It is possible to set a name for the material.

virtual gzMaterial::~gzMaterial  )  [inline, virtual]
 

Destructor.

Definition at line 63 of file gzMaterial.h.


Member Function Documentation

virtual gzVoid gzMaterial::activate gzContext context,
gzEnum  face
[virtual]
 

virtual gzReference* gzMaterial::clone  )  const [virtual]
 

Clone interface.

Reimplemented from gzObject.

static gzVoid gzMaterial::deactivate gzContext context  )  [static]
 

gzRGBA& gzMaterial::getAmbient  ) 
 

Returns the ambient color.

gzRGBA& gzMaterial::getDiffuse  ) 
 

Returns the diffuse color.

gzRGBA& gzMaterial::getEmission  ) 
 

Returns the emmision color.

gzFloat gzMaterial::getShininess  ) 
 

Returns the shininess factor.

gzRGBA& gzMaterial::getSpecular  ) 
 

Returns the specular color.

gzMaterial::GZ_DECLARE_TYPE_INTERFACE_EXPORT  ) 
 

Reimplemented from gzObject.

gzBool gzMaterial::operator== const gzMaterial right  )  const
 

Equal operator.

Returns true if the two materials are equal.

gzVoid gzMaterial::setAmbient gzFloat  red = 1,
gzFloat  green = 1,
gzFloat  blue = 1,
gzFloat  alpha = 1
 

Sets the ambient property for the material.

The ambient material defines how the ambient light is reflected.
The red ambient material color tells how the red ambient light for the color is reflected. The green ambient material color tells how the green ambient light for the color is reflected, etc. This combination gives the resulting color for the reflected ambient light.

gzVoid gzMaterial::setAmbient const gzRGBA matcol  ) 
 

Sets the ambient property for the material.

The ambient material defines how the ambient light is reflected.
The red ambient material color tells how the red ambient light for the color is reflected. The green ambient material color tells how the green ambient light for the color is reflected, etc. This combination gives the resulting color for the reflected ambient light.

Examples:
cube.cpp.

gzVoid gzMaterial::setDiffuse gzFloat  red = 1,
gzFloat  green = 1,
gzFloat  blue = 1,
gzFloat  alpha = 1
 

Sets the diffuse property for the material.

The diffuse material defines how the diffuse light is reflected.
The red diffuse material color tells how the red diffuse light for the color is reflected. The green diffuse material color tells how the green diffuse light for the color is reflected, etc. This combination gives the resulting color for the reflected diffuse light.

gzVoid gzMaterial::setDiffuse const gzRGBA matcol  ) 
 

Sets the diffuse property for the material.

The diffuse material defines how the diffuse light is reflected.
The red diffuse material color tells how the red diffuse light for the color is reflected. The green diffuse material color tells how the green diffuse light for the color is reflected, etc. This combination gives the resulting color for the reflected diffuse light.

Examples:
cube.cpp.

gzVoid gzMaterial::setEmission gzFloat  red = 1,
gzFloat  green = 1,
gzFloat  blue = 1,
gzFloat  alpha = 1
 

Sets the emissive light for the material.

gzVoid gzMaterial::setEmission const gzRGBA matcol  ) 
 

Sets the emissive light for the material.

Examples:
cube.cpp.

gzVoid gzMaterial::setMaterialAlpha gzFloat  value  ) 
 

Specifies the alpha value for the material.

The ambient, diffuse, specular and emission gets this alpha value.

gzVoid gzMaterial::setShininess gzFloat  shininess  ) 
 

Sets the size of the highlight.

Examples:
cube.cpp.

gzVoid gzMaterial::setSpecular gzFloat  red = 1,
gzFloat  green = 1,
gzFloat  blue = 1,
gzFloat  alpha = 1
 

Sets the specular property for the material.

The specular material defines how the specular light is reflected.
The red specular material color tells how the red specular light for the color is reflected. The green specular material color tells how the green specular light for the color is reflected, etc. This combination gives the resulting color for the reflected specular light.

gzVoid gzMaterial::setSpecular const gzRGBA matcol  ) 
 

Sets the specular property for the material.

The specular material defines how the specular light is reflected.
The red specular material color tells how the red specular light for the color is reflected. The green specular material color tells how the green specular light for the color is reflected, etc. This combination gives the resulting color for the reflected specular light.

Examples:
cube.cpp.

gzVoid gzMaterial::useColorAsMaterial gzBool  on,
gzEnum  mode = GZ_AMBIENT_AND_DIFFUSE
 

virtual gzBool gzMaterial::useDeepCopy  )  [virtual]
 

Overrides the gzReference useDeepCopyMode() to use gzNodeCopyMode.

Depending on what copy mode you have set a clone of a gzNode will either return a new instance of a gzMaterial or a shared instance.

Reimplemented from gzReference.


The documentation for this class was generated from the following file:
Documentation for Gizmo3D generated at Wed Feb 20 11:54:20 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond