interface (what every users sees):
Code: Select all
enum EMaterialGroup
{
EMaterialDefault,
EMaterialWood
// etc
};
// in the collisionmanager
public:
irr::s32 ICollisionManager::getMaterialGroup( EMaterialGroup _group = EMaterialDefault);
Code: Select all
// some header file
class SMaterialDefault // singleton
{
public:
SMaterial* getInstance()
{
createGroup();
};
void initMaterial()
{
// dependencies to other groups
setup();
}
}
// in the scenemanager
protected:
void initMaterials()
{
// first create all material
DefaultMaterial::getInstance()
...
// second step setup materials
DefaultMaterial::setupMaterial();
}
2. There will be some docu how to add new materials, ill try to make many of them so there wont be much to add.
3. If the user (programmer) adds a Material every Material needs to be touched (else default behaviour) ,a enum-value added, initMaterials() and getMaterialGroup() changed (lots of work).