interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

A3DL::Material Class Reference
[libmetaobject_a3dl]

#include <vos/metaobjects/a3dl/material.hh>

Inheritance diagram for A3DL::Material:

VOS::MetaObject VOS::Vobject VOS::Dispatchable VUtil::RefCounted csMetaMaterial List of all members.

Detailed Description

Contains material (appearence) information for a 3D object.

Materials hold one or more texture layers, solid colors, transparency value and various lighting parameters.

Todo:
Need to add functions for setting shading (CS mixmode |= CS_FX_GORAUD), keycolor (CS mixmode |= CS_FX_KEYCOLOR), tiling (CS mixmode |= CS_FX_TILING)

Definition at line 50 of file material.hh.

Public Types

Public Member Functions

Static Public Member Functions


Member Enumeration Documentation

Special blend modes for setBlendMode() and getBlendMode().

Enumerator:
BLEND_ADD 
BLEND_MULTIPLY 
BLEND_DOUBLE_MULTIPLY 
BLEND_NORMAL 

Definition at line 55 of file material.hh.


Constructor & Destructor Documentation

A3DL::Material::Material ( VOS::VobjectBase superobject  ) 

virtual A3DL::Material::~Material (  )  [virtual]


Member Function Documentation

static void A3DL::Material::floatsToHexString ( float  r,
float  g,
float  b,
std::string &  str 
) [static]

Convert three normalized floats (0.0-1.0) to an HTML-style hex tripplet ("RRGGBB).

If any input parameter is less than 0.0, it is considered to be 0. If any parameter is greater than 1.0, it is considered to be 1.

Todo:
Move this out into just the A3DL namespace?

virtual double A3DL::Material::getAlpha (  )  [virtual]

Get alpha.

Will be between 0 (fully transparent) and 1 (no transparency)

Exceptions:
Vobject:NoSuchObjectError if there is no "a3dl:alpha" object.

virtual VUtil::vRef<VOS::Property> A3DL::Material::getAlphaObj (  )  [virtual]

Get transparency property.

virtual void A3DL::Material::getBlendColor ( float &  r,
float &  g,
float &  b 
) [virtual]

Get blend color

Exceptions:
Vobject::NoSuchObjectError if there is no "a3dl:blend-mode" property.

virtual VUtil::vRef<VOS::Property> A3DL::Material::getBlendColorObj (  )  [virtual]

Get a3dl:blende-color property object.

virtual BlendMode A3DL::Material::getBlendMode (  )  [virtual]

Get special blend mode.

These blend modes determine how the background affects the object's material.

Exceptions:
Vobject::NoSuchObjectError if there is no "a3dl:blend-mode" property.

virtual VUtil::vRef<VOS::Property> A3DL::Material::getBlendModeObj (  )  [virtual]

Get blend mode property object.

virtual void A3DL::Material::getColor ( float &  r,
float &  g,
float &  b 
) [virtual]

Get the "base" color of the material: a color to use if there are no texture layers.

virtual VUtil::vRef<Texture> A3DL::Material::getTextureLayer ( int  idx  )  [virtual]

Use a VUtil::vRef or call release on the returned object.

Returns:
0 if idx is greater than the number of texture layers.

virtual TextureIterator A3DL::Material::getTextureLayers (  )  [virtual]

Get pointers to texture layers.

virtual const std::string A3DL::Material::getVOSType (  )  [virtual]

Returns:
the specific VOS type name that represents the VOS interface this object is supplying. This should always be overridden by the subclass.

Reimplemented from VOS::MetaObject.

static void A3DL::Material::hexStringToFloats ( const std::string &  str,
float &  r,
float &  g,
float &  b 
) [static]

Convert an HTML-style hex triplet ("#RRGGBB") to three normalized (0.0-1.0) floating-point values.

Todo:
Move this out into just the A3DL namespace?

virtual VUtil::vRef<Texture> A3DL::Material::insertTextureLayer ( int  idx,
const std::string &  data,
const std::string &  datatype,
double  alpha = 1.0,
BlendMode  blendMode = BLEND_NORMAL 
) [virtual]

Create a new Texture object using given image data and datatype identifiel, and insert it into this material at the given index.

virtual void A3DL::Material::insertTextureLayer ( int  idx,
Texture t 
) [virtual]

Insert a texture layer at the given index.

Textures are applied to an object from lowest to highest index.

virtual VUtil::vRef<Texture> A3DL::Material::insertTextureLayerFromFile ( int  idx,
const std::string &  filename,
const std::string &  datatype 
) [virtual]

Insert a new texture layer into this material at the given index, using the given file as the image backend source (using FileProperty).

See also:
FileProperty
Exceptions:
FileAccessError if there is an error opening the file

static VOS::MetaObject* A3DL::Material::new_Material ( VOS::VobjectBase superobject,
const std::string &  type 
) [static]

virtual void A3DL::Material::removeTextureLayer ( int  idx  )  [virtual]

virtual void A3DL::Material::replaceTextureLayer ( int  idx,
Texture t 
) [inline, virtual]

Definition at line 93 of file material.hh.

virtual void A3DL::Material::replaceTextureLayer ( int  idx,
Texture t 
) [virtual]

virtual void A3DL::Material::setAlpha ( double  t  )  [virtual]

Set alpha transparency of the object.

Parameters:
t A value between 0 (fully transparent) and 1 (no transparency). Some renderers may round to certain values (e.g. 1.0, 0.75, 0.5, 0.25, 0.0) If t is > 1, 1 will be used. If t < 0, 0 will be used.

virtual void A3DL::Material::setAlphaObj ( VOS::Property obj  )  [virtual]

Set transparency property object.

virtual void A3DL::Material::setBlendColor ( float  r,
float  g,
float  b 
) [virtual]

Set blend color: this color modifies the blending of this object against its background.

virtual void A3DL::Material::setBlendColorObj ( VOS::Property obj  )  [virtual]

Set a3dl:blend-color property object.

virtual void A3DL::Material::setBlendMode ( BlendMode  mode  )  [virtual]

Set special blend mode.

These blend modes determine how the background affects the object's material.

virtual void A3DL::Material::setBlendModeObj ( VOS::Property obj  )  [virtual]

Set blend mode property object.

virtual void A3DL::Material::setColor ( float  r,
float  g,
float  b 
) [virtual]

Set the "base" color of the material: a color to use if there are no texture layers.


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