Difference between revisions of "GameTools MatList"
SteveBaker (Talk | contribs) (New page: The '''loadMat''' library revolves around two classes: ''class MatEntry'' describes the properties of a '''Material''' and ''class MatList'' maintains a list of them all. == MatEntry == T...) |
(No difference)
|
Latest revision as of 20:45, 23 October 2007
The loadMat library revolves around two classes: class MatEntry describes the properties of a Material and class MatList maintains a list of them all.
MatEntry
This contains all of the properties of a Material and its public interface is basically just a bunch of 'set' and 'get' functions that need no further explanation:
class MatEntry
{
void setCollidable ( bool c ) ;
bool isCollidable () ;
void setWaterSurface ( bool c ) ;
bool isWaterSurface () ;
void setGLmaterial ( bool s ) ;
bool hasGLmaterial () ;
void setMovtexVel ( const sgVec3 vel ) ;
void setMovtexPos ( const sgVec3 pos ) ;
const float *getMovtexVel () ;
const float *getMovtexPos () ;
void setAmbient ( const float *rgba ) ;
void setDiffuse ( const float *rgba ) ;
void setSpecular ( const float *rgba ) ;
void setEmission ( const float *rgba ) ;
void setShininess ( float sh ) ;
void setColMatMode( const char *s ) ;
const float *getAmbient () ;
const float *getDiffuse () ;
const float *getSpecular () ;
const float *getEmission () ;
float getShininess () ;
GLenum getColMatMode () ;
bool isMovTex () ;
} ;
MatList
The main function of this class is to maintain a database of MatEntry objects such that they can be loaded and tracked more easily:
class MatList
{
MatList ( const char *fname ) ;
MatEntry *getEntry ( const char *name ) ;
void update () ;
} ;
The constructor function takes the name of a gameTools material.xml file (traditionally: data/material.xml) which it loads. The MatList::update function performs per-frame housekeeping and MatList::getEntry lets you find a particutlar material from it's name (which is actually the root part of the texture filename).
| Wikiid Pages relating to gameTools (edit) |
| gameTools - Main page |
| gameTools - Support Tools : |
| gameTools - File Formats : |
gameTools - Source Code :
|
| Wikiid Pages relating to Lemur of Lima (edit) |
| Lemur of Lima - Main page |
| Lemur of Lima - Controls |
| Lemur of Lima - Levels : |
| Lemur of Lima - Java Plugins : |
| Lemur of Lima - Source Code Documentation : |