Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11079


Ignore:
Timestamp:
Jan 19, 2016, 11:05:02 PM (8 years ago)
Author:
landauf
Message:

bugfix: the attached objects are stored in a set, so there's no guarantee about the order of the elements. store the billboards of the lens flare in an ordered vector to ensure that the billboards are updated with the correct parameters.

Location:
code/branches/shaders_merge/src/orxonox/graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/shaders_merge/src/orxonox/graphics/LensFlare.cc

    r11078 r11079  
    106106            lensPart->setVisible(true);
    107107            this->attach(lensPart);
     108            this->billboards_.push_back(lensPart);
    108109        }
    109110    }
     
    125126
    126127        int i = 0;
    127         for (WorldEntity* attachedObject : this->getAttachedObjects())
    128         {
    129             Billboard* billboard = orxonox_cast<Billboard*>(attachedObject);
    130             if (billboard == this->occlusionBillboard_)
    131                 continue;
     128        for (Billboard* billboard : this->billboards_)
     129        {
    132130            const LensFlare::Lens& lens = lensConfiguration_.at(i);
    133131            billboard->setPosition(-viewDirection * (1.0f - lens.position_));
     
    149147
    150148        int i = 0;
    151         for (WorldEntity* attachedObject : this->getAttachedObjects())
    152         {
    153             Billboard* billboard = orxonox_cast<Billboard*>(attachedObject);
    154             if (billboard == this->occlusionBillboard_)
    155                 continue;
     149        for (Billboard* billboard : this->billboards_)
     150        {
    156151            cur.a = alpha * lensConfiguration_.at(i).alpha_;
    157152            billboard->setColour(cur);
  • code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h

    r11078 r11079  
    178178            std::vector<Lens> lensConfiguration_;//!< this stores the lensConfiguration
    179179            Billboard* occlusionBillboard_;//!< this is a transparent billboard used solely for the Hardware Occlusion Query
     180            std::vector<Billboard*> billboards_; //!< The visible billboards
     181
    180182            float scale_;//!< this factor is used to scale the billboard to the desired size
    181183            bool fadeOnViewBorder_;//!< should the effect fade out on the border of the view?
Note: See TracChangeset for help on using the changeset viewer.