Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6622 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Jan 20, 2006, 12:08:41 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Material can now be copied
ParticleSprite used for all Projectiles

Location:
trunk/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/material.cc

    r6467 r6622  
    6868    ResourceManager::getInstance()->unload(this->specularTexture);
    6969}
     70
     71Material& Material::operator=(const Material& m)
     72{
     73  this->setIllum(m.illumModel);
     74  this->setDiffuse(m.diffuse[0],m.diffuse[1],m.diffuse[2]);
     75  this->setAmbient(m.ambient[0],m.ambient[1],m.ambient[2]);
     76  this->setSpecular(m.specular[0],m.specular[1],m.specular[2]);
     77  this->setShininess(m.shininess);
     78  this->setTransparency(m.transparency);
     79
     80  if (this->diffuseTexture != NULL)
     81    ResourceManager::getInstance()->unload(this->diffuseTexture);
     82  if (m.diffuseTexture != NULL)
     83    this->diffuseTexture = m.diffuseTexture; /// HACK shoudl be:(Texture*)ResourceManager::getInstance()->load();
     84  this->ambientTexture = NULL; /// FIXME
     85  this->specularTexture = NULL; /// FIXME
     86
     87  this->setName(m.getName());
     88}
     89
    7090
    7191/**
     
    282302  //! @todo check if RESOURCE MANAGER is availiable
    283303  //! @todo Textures from .mtl-file need special care.
    284   if (dMap!= NULL)
     304  if (dMap != NULL)
    285305    this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (void*)&target);
    286306  else
  • trunk/src/lib/graphics/importer/material.h

    r6467 r6622  
    2828  virtual ~Material ();
    2929
     30  Material& operator=(const Material& material);
     31
    3032  bool select () const;
    3133
    3234  void setIllum (int illum);
    3335  void setIllum (char* illum);
     36  int getIllumModel() const { return this->illumModel; };
    3437  void setDiffuse (float r, float g, float b);
    3538  void setDiffuse (char* rgb);
     
    5861    float       shininess;        //!< The shininess of the Material.
    5962    float       transparency;     //!< The transperency of the Material.
    60   public:
     63
    6164    Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
    6265    Texture*    ambientTexture;   //!< The ambient texture of the Material.
Note: See TracChangeset for help on using the changeset viewer.