Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2009, 10:58:26 PM (15 years ago)
Author:
wirthmi
Message:

Added damage overlays

Location:
code/branches/presentation2/src/orxonox/overlays
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.cc

    r6218 r6310  
    3939#include <OgrePanelOverlayElement.h>
    4040#include <OgreRenderWindow.h>
     41#include <OgreMaterialManager.h>
     42#include <OgreTechnique.h>
     43#include <OgrePass.h>
    4144
    4245#include "util/Convert.h"
     
    370373        }
    371374    }
     375
     376    void OrxonoxOverlay::setBackgroundAlpha(float alpha) {
     377        Ogre::MaterialPtr ptr = this->background_->getMaterial();
     378        Ogre::TextureUnitState* tempTx = ptr->getTechnique(0)->getPass(0)->getTextureUnitState(0);
     379        tempTx->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, alpha);
     380    }
    372381}
  • code/branches/presentation2/src/orxonox/overlays/OrxonoxOverlay.h

    r6108 r6310  
    158158        const std::string& getBackgroundMaterial() const;
    159159
     160        void setBackgroundAlpha(float alpha);
     161
    160162        virtual void changedVisibility();
    161163
     
    205207        BaseObject* owner_;
    206208        OverlayGroup* group_;
     209        Ogre::Pass* backgroundAlphaPass_;
    207210  };
    208211
Note: See TracChangeset for help on using the changeset viewer.