Public Member Functions
OGLMaterial Class Reference

Detailed Description

This object represents the OpenGL properties of a material object.

OGLMaterial objects are read-only. OGLMaterial can be created with Material.OGLMaterial.

See also:
Material
Example:
        using namespace XSI;
        Application app;
        Model root = app.GetActiveSceneRoot();

        X3DObject myGrid;
        root.AddGeometry( L"Grid", L"MeshSurface", L"", myGrid );

        Material myMaterial(myGrid.GetMaterial());

        OGLMaterial myOGLMaterial(myMaterial.GetOGLMaterial());

#include <xsi_oglmaterial.h>

Inheritance diagram for OGLMaterial:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 OGLMaterial ()
 ~OGLMaterial ()
 OGLMaterial (const CRef &in_ref)
 OGLMaterial (const OGLMaterial &in_obj)
bool IsA (siClassID in_ClassID) const
siClassID GetClassID () const
OGLMaterialoperator= (const OGLMaterial &in_obj)
OGLMaterialoperator= (const CRef &in_ref)
CColor GetDiffuse () const
CColor GetSpecular () const
CColor GetAmbient () const
double GetDecay () const
siShadingModel GetShadingModel () const

Constructor & Destructor Documentation

Default constructor.

Default destructor.

OGLMaterial ( const CRef in_ref)

Constructor.

Parameters:
in_refconstant reference object.
OGLMaterial ( const OGLMaterial in_obj)

Copy constructor.

Parameters:
in_objconstant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID) const [virtual]

Returns true if a given class type is compatible with this API class.

Parameters:
in_ClassIDclass type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from CBase.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Implements CBase.

OGLMaterial& operator= ( const OGLMaterial in_obj)

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:
in_objconstant class object.
Returns:
The new OGLMaterial object.
OGLMaterial& operator= ( const CRef in_ref)

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:
in_refconstant class object.
Returns:
The new OGLMaterial object.
CColor GetDiffuse ( ) const

Returns the diffuse color of this material.

Returns:
The diffuse color.
CColor GetSpecular ( ) const

Returns the specular color of this material.

Returns:
The specular color.
CColor GetAmbient ( ) const

Returns the ambient color of this material.

Returns:
The ambient color.
double GetDecay ( ) const

The decay value of this material.

Returns:
The decay value.
siShadingModel GetShadingModel ( ) const

Returns the shading model of this material. It is usually not possible to exactly represent the mental ray shaders attached to a material in OpenGL; however, Softimage tries to guess the best OpenGL shading model to approximate these shaders.

Softimage chooses a shading model based on specific markings on shader parameters provided by the shader developer (using the ui "mapping" = "guid" syntax in the SPDL). These markings tell Softimage if a parameter can be interpreted as a diffuse color, a specular color, etc. and based on the presence or absence of these markings, Softimage guesses a shading model. For example, if there is a diffuse, specular, and ambient-like parameter, Softimage chooses the Phong shading model (which in OpenGL, is actually Gouraud). If only diffuse and ambient-like parameters are present, Lambert would be used instead (since the Lambert shading model does not have a specular color). If only ambient is present, Constant is used.

Returns:
The shading model.

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