GameTools MatList

From Wikiid
Revision as of 20:45, 23 October 2007 by 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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The loadMat library revolves around two classes: class MatEntry describes the properties of a Material and class MatList maintains a list of them all.


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 () ;
 } ;


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 :
plb_to_ac3d, mklevel, mktile, mktree, tiled, autogen_java, mk3dgallery
gameTools - File Formats :
title_screen.rgb, ultimate.xml, material.xml, decoration.xml, physics.xml
tiled.xml, tiled_autotiles.xml, Level files, Tile naming scheme, PLB files
gameTools - Source Code :
Game functions: gameCamera, gameClock, gameChecksum/gameHashTable, gameHTTP,
gameIsect, gameJoystick, gameParticleManager, gameScreen/gameMouse,
gameSky, gameStarter, gameStrokeFont, gameUtils
Material database: MatList/MatEntry
Tile map handling: TileObject/MapFlag/MapEntry/Map
Java Interfacing: JavaLink
Image file loading: liImage/liImageFactory
3D Model file loading: loadPLB, PLB exporter
Physics: Sabot, Bullet, gameTools - Use with Blender, PLB exporter
Object management: Object

Wikiid Pages relating to Lemur of Lima (edit)
Lemur of Lima - Main page
Lemur of Lima - Controls
Lemur of Lima - Levels :
List of Levels, Level design, Screen shots, Models
Lemur of Lima - Java Plugins :
Java plugin API, Event handling, Flags, GameInterface API , Alphabetical Index
Lemur of Lima - Source Code Documentation :
Initialisation, Main Loop, gameTools