Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 21, 2016, 10:21:46 PM (9 years ago)
Author:
landauf
Message:

small refactoring: make variables in Model private

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ogre1.9/src/orxonox/graphics/AnimatedModel.cc

    r9667 r11126  
    4949    AnimatedModel::~AnimatedModel()
    5050    {
    51         if (this->isInitialized() && this->mesh_.getEntity())
    52             this->detachOgreObject(this->mesh_.getEntity());
     51        if (this->isInitialized() && this->getMesh().getEntity())
     52            this->detachOgreObject(this->getMesh().getEntity());
    5353    }
    5454
     
    6666        if (GameMode::showsGraphics())
    6767        {
    68             if (this->mesh_.getEntity())
    69                 this->detachOgreObject(this->mesh_.getEntity());
     68            if (this->getMesh().getEntity())
     69                this->detachOgreObject(this->getMesh().getEntity());
    7070
    71             this->mesh_.setMeshSource(this->getScene()->getSceneManager(), this->meshSrc_);
     71            this->getMesh().setMeshSource(this->getScene()->getSceneManager(), this->getMeshSource());
    7272
    73             if (this->mesh_.getEntity())
     73            if (this->getMesh().getEntity())
    7474            {
    75                 this->attachOgreObject(this->mesh_.getEntity());
    76                 this->mesh_.getEntity()->setCastShadows(this->bCastShadows_);
     75                this->attachOgreObject(this->getMesh().getEntity());
     76                this->getMesh().getEntity()->setCastShadows(this->getCastShadows());
    7777                this->setAnimationState(this->bAnimLoop_, this->bAnimEnabled_, this->anims_);
    78                 this->mesh_.setVisible(this->isVisible());
     78                this->getMesh().setVisible(this->isVisible());
    7979            }
    8080        }
     
    8989        if(state!="")
    9090        {
    91         if(this->mesh_.getEntity()->getAnimationState(state))
     91        if(this->getMesh().getEntity()->getAnimationState(state))
    9292        {
    93         Ogre::AnimationState* as = this->mesh_.getEntity()->getAnimationState(state);
     93        Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(state);
    9494        as->setLoop(loop);
    9595        as->setEnabled(enabled);
     
    109109    void AnimatedModel::tick(float dt)
    110110    {
    111         if(this->mesh_.getEntity()->getAnimationState(anims_))
     111        if(this->getMesh().getEntity()->getAnimationState(anims_))
    112112        {
    113113// Test to change Material at runtime!
    114114
    115 //            Ogre::MaterialPtr mat = this->mesh_.getEntity()->getSubEntity(0)->getMaterial();
     115//            Ogre::MaterialPtr mat = this->getMesh().getEntity()->getSubEntity(0)->getMaterial();
    116116//            mat->setDiffuse(0.4, 0.3, 0.1, 0.1);
    117117//            mat->setAmbient(0.3, 0.7, 0.8);
     
    121121//            mat->setSceneBlending(sbt);
    122122
    123             Ogre::AnimationState* as = this->mesh_.getEntity()->getAnimationState(anims_);
     123            Ogre::AnimationState* as = this->getMesh().getEntity()->getAnimationState(anims_);
    124124            as->addTime(dt);
    125125    }
Note: See TracChangeset for help on using the changeset viewer.