Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2017, 2:51:31 PM (7 years ago)
Author:
varxth
Message:

added setSubMaterial(…) to Model.cc and Mesh.cc

Location:
code/branches/SOBv2_HS17/src/libraries/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/src/libraries/tools/Mesh.cc

    r11080 r11534  
    7979    }
    8080
     81   
     82
    8183    void Mesh::setCastShadows(bool bCastShadows)
    8284    {
     
    98100        if (this->entity_)
    99101            this->entity_->setMaterialName(name);
     102    }
     103
     104    // PRE: a valid  Ogre::Entity* entity with a valid subentity at index
     105    // POST: changed material of subentity at index to name
     106    void Mesh::setSubMaterial(const std::string& name, const int index){
     107         if (this->entity_ && this->entity_->getSubEntity(index))
     108        {
     109                this->entity_->getSubEntity(index)->setMaterialName(name);
     110        }
     111        else
     112            orxout() << "ERROR at Index " << index << endl;
    100113    }
    101114
  • code/branches/SOBv2_HS17/src/libraries/tools/Mesh.h

    r11080 r11534  
    5050            void setMaterial(const std::string& name);
    5151            const std::string& getMaterial() const;
    52 
     52            void setSubMaterial(const std::string& name, const int index);
    5353            void setVisible(bool bVisible);
    5454            bool isVisible() const;
Note: See TracChangeset for help on using the changeset viewer.