vtdata library
Public Member Functions | Public Attributes | List of all members
vtMaterialDescriptor Class Reference

Public Member Functions

 vtMaterialDescriptor (const char *name, const vtString &TextureFilename, const vtMaterialColorEnum Colorable=VT_MATERIAL_SELFCOLOURED_TEXTURE, const float fUVScaleX=-1, const float fUVScaleY=-1, const bool bTwoSided=false, const bool bAmbient=false, const bool bBlended=false, const RGBi &Color=RGBi(0, 0, 0))
 
void SetName (const vtString &Name)
 
const vtStringGetName () const
 
void SetMatType (int type)
 
int GetMatType () const
 
void SetUVScale (const float fScaleX, const float fScaleY)
 
FPoint2 GetUVScale () const
 
void SetColorable (const vtMaterialColorEnum Type)
 
const vtMaterialColorEnum GetColorable () const
 
void SetTextureFilename (const vtString &TextureFilename)
 
const vtStringGetTextureFilename () const
 
void SetRGB (const RGBi Color)
 
const RGBi GetRGB () const
 
void SetTwoSided (bool bTwoSided)
 
const bool GetTwoSided ()
 
void SetAmbient (bool bAmbient)
 
const bool GetAmbient ()
 
void SetBlending (bool bBlending)
 
const bool GetBlending ()
 
bool operator== (const vtMaterialDescriptor &rhs) const
 
void WriteToFile (FILE *fp)
 

Public Attributes

ColorIndexMap m_ColorIndexMap
 

Detailed Description

This class encapsulates the description of a shared material

Constructor & Destructor Documentation

vtMaterialDescriptor::vtMaterialDescriptor ( const char *  Name,
const vtString TextureFilename,
const vtMaterialColorEnum  Colorable = VT_MATERIAL_SELFCOLOURED_TEXTURE,
const float  fUVScaleX = -1,
const float  fUVScaleY = -1,
const bool  bTwoSided = false,
const bool  bAmbient = false,
const bool  bBlending = false,
const RGBi Color = RGBi(0,0,0) 
)

Create a high-level description of a material.

Parameters
NameName of the new material.
TextureFilenameFilename of the source imagery, for a textured material, or "" otherwise.
ColorableEnumeration, one of:
  • VT_MATERIAL_COLOURABLE A plain surface that can be any color.
  • VT_MATERIAL_SELFCOLOURED_TEXTURE A textured surface.
  • VT_MATERIAL_COLOURABLE_TEXTURE A textured surface which can be made any color.
fUVScaleX,fUVScaleYFor textured materials, this is the size of the provided texture, in meters. For example, if the texture is of a row of bricks that is 50x50 cm, then the scale factors are (.5, .5). If a texture should not be tiled (for example, a door or window which always exactly fits its surface) then scale factor is -1.
bTwoSidedTrue for surfaces which should be visible from both sides.
bAmbientTrue for surfaces which are only affected by ambient light.
bBlendingTrue for textures with transparency.
ColorFor VT_MATERIAL_SELFCOLOURED_TEXTURE, the color intrinsic to the texture, e.g. for a texture of orange bricks, the color is orange.

Member Function Documentation

void vtMaterialDescriptor::SetMatType ( int  type)
inline
Parameters
typeOne of:
  • 0: A surface material, such as brick, siding, or stucco.
  • 1: An element of a structure edge, such as a door or window.
  • 2: Reserved for "Window Wall", an efficiency optimization material which contains both a window and a wall.
  • 3: A post material, for linear structures, such as a fencepost.