Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2006, 11:34:22 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Ok the Element2D-renderer works, and hides Elements, that are behind the Camera

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/effects/lense_flare.cc

    r7843 r7844  
    6161  PRINTF(0)("light is: %p\n", this->lightSource);
    6262
    63   this->isVisible = true;
    64 
    6563  if (root != NULL)
    6664  {
     
    6967  }
    7068
     69  this->bVisible = true;
    7170  this->setSourceVisibility(false);
    72   this->isVisible = true;
    7371
    7472}
     
    161159  bb->setSize(50, 50);
    162160  this->flares.push_back(bb);
     161  bb->setVisibility(true);
     162
    163163  PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str());
    164164
     
    167167  {
    168168    bb->setBindNode(static_cast<PNode*>(this->lightSource));
    169     bb->setVisibility(true);
    170169  }
    171170
     
    176175void LenseFlare::setSourceVisibility(bool visibility)
    177176{
    178 //   if (this->isVisible == visibility)
    179 //     return;
    180 
    181   float dist = this->frustumPlane.distancePoint(this->lightSource->getAbsCoor());
    182   PRINTF(0)("dist: %f\n", dist);
     177   if (this->bVisible == visibility)
     178     return;
     179
    183180  std::vector<ImagePlane*>::const_iterator it;
    184     for(it = flares.begin(); it != flares.end(); it++)
     181    for(it = ++flares.begin(); it != flares.end(); it++)
    185182      (*it)->setVisibility(visibility);
    186   this->isVisible = visibility;
     183  this->bVisible = visibility;
    187184}
    188185
     
    205202
    206203    //set the frustum plane
    207 
    208 //   this->frustumPlane = State::getCamera()->getViewFrustum();
    209 //
    210 //   if (State::getCamera()->distance(lightSource) < 0)
    211 //     this->setSourceVisibility(false);
    212 //   else
    213 //     this->setSourceVisibility(true);
     204  if (!flares.empty())
     205    this->setSourceVisibility(this->flares[0]->isVisible());
    214206
    215207
Note: See TracChangeset for help on using the changeset viewer.