Open Inventor Reference
SoMaterial Class Reference

Surface material definition node. More...

#include <Inventor/nodes/SoMaterial.h>

Inheritance diagram for SoMaterial:
SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoMaterial ()
 Creates a material node with default settings.
virtual void doAction (SoAction *action)
 This method performs the "typical" operation of a node for any action.
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void callback (SoCallbackAction *action)

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoMFColor ambientColor
 Ambient color of the surface.
SoMFColor diffuseColor
 Diffuse color(s) of the surface.
SoMFColor specularColor
 Specular color of the surface.
SoMFColor emissiveColor
 Emissive color of the surface.
SoMFFloat shininess
 Shininess coefficient of the surface.
SoMFFloat transparency
 Transparency value(s) of the surface.

Protected Member Functions

virtual ~SoMaterial ()

Protected Attributes

SoColorPackercolorPacker
SoVBO_vbo

Detailed Description

This node defines the current surface material properties for all subsequent shapes. SoMaterial sets several components of the current material during traversal.

Multiple values can be specified for the diffuseColor and transparency . Different shapes interpret materials with multiple values differently. To bind materials to shapes, use an SoMaterialBinding node.

File Format/Default
Material {
  ambientColor 0.2 0.2 0.2
  diffuseColor 0.8 0.8 0.8
  specularColor 0 0 0
  emissiveColor 0 0 0
  shininess 0.2
  transparency 0
}
Action Behavior
SoGLRenderAction, SoCallbackAction
Sets the ambient color, the diffuse color, the specular color, the emissive color, the shininess, and the transparency of the current material.
See Also
SoBaseColor, SoLightModel, SoMaterialBinding, SoPackedColor

Definition at line 106 of file SoMaterial.h.


Constructor & Destructor Documentation

SoMaterial::SoMaterial ( )
virtual SoMaterial::~SoMaterial ( ) [protected, virtual]

Member Function Documentation

virtual void SoMaterial::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

virtual void SoMaterial::doAction ( SoAction action) [virtual]

The default implementation does nothing.

Reimplemented from SoNode.

virtual void SoMaterial::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

static void SoMaterial::initClass ( ) [static]

Reimplemented from SoNode.


Member Data Documentation

SoVBO* SoMaterial::_vbo [protected]

Definition at line 158 of file SoMaterial.h.

Definition at line 115 of file SoMaterial.h.

Definition at line 156 of file SoMaterial.h.

Definition at line 118 of file SoMaterial.h.

Definition at line 124 of file SoMaterial.h.

Values can range from 0.0 for no shininess (a diffuse surface) to 1.0 for maximum shininess (a highly polished surface).

Definition at line 129 of file SoMaterial.h.

Definition at line 121 of file SoMaterial.h.

Values can range from 0.0 for opaque surfaces to 1.0 for completely transparent surfaces. If the transparency type is SoGLRenderAction::SCREEN_DOOR then only the first transparency value will be used. With other transparency types, multiple transparencies will be used, if the SoMaterial node contains as many transparencies as diffuse colors. If there are not as many transparencies as diffuse colors, only the first transparency will be used.

Definition at line 139 of file SoMaterial.h.


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