VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Attributes | Friends
trpgMaterial Class Reference
Inheritance diagram for trpgMaterial:
Inheritance graph
[legend]

Classes

struct  _attrSet
 

Public Types

enum  { Smooth, Flat }
 
enum  { Front, Back, FrontAndBack }
 
enum  {
  None, Always, Equal, GreaterThanOrEqual,
  GreaterThan, LessThanOrEqual, LessThan, Never,
  NotEqual
}
 
enum  { TR_FID, TR_SMC, TR_STP, TR_SWC }
 

Public Member Functions

 trpgMaterial (void)
 
virtual ~trpgMaterial (void) override
 
void SetColor (const trpgColor &)
 
void SetAmbient (const trpgColor &)
 
void SetDiffuse (const trpgColor &)
 
void SetSpecular (const trpgColor &)
 
void SetEmission (const trpgColor &)
 
void SetShininess (float64)
 
void SetShadeModel (int)
 
void SetPointSize (float64)
 
void SetLineWidth (float64)
 
void SetCullMode (int)
 
void SetAlphaFunc (int)
 
void SetAlphaRef (float64)
 
void SetAlpha (float64)
 
void SetAutoNormal (bool)
 
void SetNumTexture (int)
 
void SetTexture (int no, int id, const trpgTextureEnv &)
 
int AddTexture (int, const trpgTextureEnv &)
 
void SetNumTiles (int)
 
int AddTile (void)
 
void SetIsBumpMap (bool)
 
void SetAttr (int attrCode, int val)
 
bool GetColor (trpgColor &) const
 
bool GetAmbient (trpgColor &) const
 
bool GetDiffuse (trpgColor &) const
 
bool GetSpecular (trpgColor &) const
 
bool GetEmission (trpgColor &) const
 
bool GetShininess (float64 &) const
 
bool GetShadeModel (int &) const
 
bool GetPointSize (float64 &) const
 
bool GetLineWidth (float64 &) const
 
bool GetCullMode (int &) const
 
bool GetAlphaFunc (int &) const
 
bool GetAlphaRef (float64 &) const
 
bool GetAutoNormal (bool &) const
 
bool GetAlpha (float64 &) const
 
bool GetNumTile (int &) const
 
bool GetNumTexture (int &) const
 
bool GetTexture (int no, int &id, trpgTextureEnv &) const
 
bool GetIsBumpMap (bool &) const
 
bool GetAttr (int attrCode, int &val) const
 
bool isValid (void) const
 
virtual void Reset (void) override
 
virtual bool Write (trpgWriteBuffer &) override
 
virtual bool Read (trpgReadBuffer &) override
 
virtual bool Print (trpgPrintBuffer &) const override
 
- Public Member Functions inherited from trpgReadWriteable
 trpgReadWriteable ()
 
const chargetErrMess () const
 
- Public Member Functions inherited from trpgCheckable
 trpgCheckable (void)
 
virtual ~trpgCheckable (void)
 
bool isValid (void) const
 
virtual TeAttrHdl GetHandle () const
 
virtual void SetHandle (TeAttrHdl hdl)
 

Protected Attributes

bool isBump
 
trpgColor color
 
trpgColor ambient
 
trpgColor diffuse
 
trpgColor specular
 
trpgColor emission
 
float64 shininess
 
int shadeModel
 
float64 pointSize
 
float64 lineWidth
 
int cullMode
 
int alphaFunc
 
float64 alpha
 
float64 alphaRef
 
bool autoNormal
 
int numTex
 
int32 numTile
 
struct trpgMaterial::_attrSet attrSet
 
std::vector< inttexids
 
std::vector< trpgTextureEnvtexEnvs
 
- Protected Attributes inherited from trpgReadWriteable
char errMess [512]
 
- Protected Attributes inherited from trpgCheckable
bool valid
 
TeAttrHdl handle
 
bool writeHandle
 

Friends

class trpgMatTable
 

Member Enumeration Documentation

anonymous enum
Enumerator
Smooth 
Flat 
anonymous enum
Enumerator
Front 
Back 
FrontAndBack 
anonymous enum
Enumerator
None 
Always 
Equal 
GreaterThanOrEqual 
GreaterThan 
LessThanOrEqual 
LessThan 
Never 
NotEqual 
anonymous enum

Set an attribute (e.g. fid/smc)

Enumerator
TR_FID 
TR_SMC 
TR_STP 
TR_SWC 

Constructor & Destructor Documentation

trpgMaterial::trpgMaterial ( void  )
virtual trpgMaterial::~trpgMaterial ( void  )
overridevirtual

Member Function Documentation

void trpgMaterial::SetColor ( const trpgColor )

Set base material color.

void trpgMaterial::SetAmbient ( const trpgColor )

Ambient color.

void trpgMaterial::SetDiffuse ( const trpgColor )

Diffuse color (the most commonly used)

void trpgMaterial::SetSpecular ( const trpgColor )

Specular color used in lighting.

void trpgMaterial::SetEmission ( const trpgColor )

Emissive color used in lighting.

void trpgMaterial::SetShininess ( float64  )

Shininess used in lighting.

void trpgMaterial::SetShadeModel ( int  )

Shading model.

void trpgMaterial::SetPointSize ( float64  )

Point size.

void trpgMaterial::SetLineWidth ( float64  )

Line width.

void trpgMaterial::SetCullMode ( int  )

Cull mode. See GetCullMode.

void trpgMaterial::SetAlphaFunc ( int  )

Alpha Function. See GetAlphaFunc.

void trpgMaterial::SetAlphaRef ( float64  )

Alpha Ref value. See GetAlphaRef.

void trpgMaterial::SetAlpha ( float64  )

Alpha value for any polygon using this material.

void trpgMaterial::SetAutoNormal ( bool  )

Generate normals automatically from geometry.

void trpgMaterial::SetNumTexture ( int  )
void trpgMaterial::SetTexture ( int  no,
int  id,
const trpgTextureEnv  
)
int trpgMaterial::AddTexture ( int  ,
const trpgTextureEnv  
)
void trpgMaterial::SetNumTiles ( int  )

Number of tiles this material is used in.

int trpgMaterial::AddTile ( void  )

Adds a count to the number of tiles this material is used in and returns that number.

void trpgMaterial::SetIsBumpMap ( bool  )

Sets bump map status (color etc... isn't important)

void trpgMaterial::SetAttr ( int  attrCode,
int  val 
)
bool trpgMaterial::GetColor ( trpgColor ) const

Return the current color.

bool trpgMaterial::GetAmbient ( trpgColor ) const

Returns the ambient color.

bool trpgMaterial::GetDiffuse ( trpgColor ) const

Returns the diffuse color (the most commonly used color)

bool trpgMaterial::GetSpecular ( trpgColor ) const

Specular color used for lighting.

bool trpgMaterial::GetEmission ( trpgColor ) const

Emissive color used for lighting.

bool trpgMaterial::GetShininess ( float64 ) const

Shininess used for lighting.

bool trpgMaterial::GetShadeModel ( int ) const

The shading model can be either Smooth or Flat.

bool trpgMaterial::GetPointSize ( float64 ) const

Point size.

bool trpgMaterial::GetLineWidth ( float64 ) const

Line width.

bool trpgMaterial::GetCullMode ( int ) const
bool trpgMaterial::GetAlphaFunc ( int ) const
bool trpgMaterial::GetAlphaRef ( float64 ) const
bool trpgMaterial::GetAutoNormal ( bool ) const

Whether or not to generate normals from geometry.

bool trpgMaterial::GetAlpha ( float64 ) const

A single Alpha value that applies to any polygons using this material.

bool trpgMaterial::GetNumTile ( int ) const
bool trpgMaterial::GetNumTexture ( int ) const
bool trpgMaterial::GetTexture ( int  no,
int id,
trpgTextureEnv  
) const
bool trpgMaterial::GetIsBumpMap ( bool ) const

Return whether or not this material is a bump map.

bool trpgMaterial::GetAttr ( int  attrCode,
int val 
) const

Get an attribute (e.g. fid/smc)

Referenced by txp::TXPArchive::SetUserDataToMaterialAttributes().

bool trpgMaterial::isValid ( void  ) const

Validity check.

virtual void trpgMaterial::Reset ( void  )
overridevirtual

Resets the contents back to empty.

Implements trpgReadWriteable.

virtual bool trpgMaterial::Write ( trpgWriteBuffer )
overridevirtual

Writes this class to a write buffer.

Implements trpgReadWriteable.

virtual bool trpgMaterial::Read ( trpgReadBuffer )
overridevirtual

Reads this class from a read buffer.

Reimplemented from trpgReadWriteable.

virtual bool trpgMaterial::Print ( trpgPrintBuffer ) const
overridevirtual

Prints this class to a print buffer.

Reimplemented from trpgReadWriteable.

Friends And Related Function Documentation

friend class trpgMatTable
friend

Member Data Documentation

bool trpgMaterial::isBump
protected

Note: Need to do equality operator.

trpgColor trpgMaterial::color
protected
trpgColor trpgMaterial::ambient
protected
trpgColor trpgMaterial::diffuse
protected
trpgColor trpgMaterial::specular
protected
trpgColor trpgMaterial::emission
protected
float64 trpgMaterial::shininess
protected
int trpgMaterial::shadeModel
protected
float64 trpgMaterial::pointSize
protected
float64 trpgMaterial::lineWidth
protected
int trpgMaterial::cullMode
protected
int trpgMaterial::alphaFunc
protected
float64 trpgMaterial::alpha
protected
float64 trpgMaterial::alphaRef
protected
bool trpgMaterial::autoNormal
protected
int trpgMaterial::numTex
protected
int32 trpgMaterial::numTile
protected
struct trpgMaterial::_attrSet trpgMaterial::attrSet
protected
std::vector<int> trpgMaterial::texids
protected
std::vector<trpgTextureEnv> trpgMaterial::texEnvs
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)