- Timestamp:
- May 24, 2006, 11:34:22 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/lense_flare.cc
r7843 r7844 61 61 PRINTF(0)("light is: %p\n", this->lightSource); 62 62 63 this->isVisible = true;64 65 63 if (root != NULL) 66 64 { … … 69 67 } 70 68 69 this->bVisible = true; 71 70 this->setSourceVisibility(false); 72 this->isVisible = true;73 71 74 72 } … … 161 159 bb->setSize(50, 50); 162 160 this->flares.push_back(bb); 161 bb->setVisibility(true); 162 163 163 PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str()); 164 164 … … 167 167 { 168 168 bb->setBindNode(static_cast<PNode*>(this->lightSource)); 169 bb->setVisibility(true);170 169 } 171 170 … … 176 175 void LenseFlare::setSourceVisibility(bool visibility) 177 176 { 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 183 180 std::vector<ImagePlane*>::const_iterator it; 184 for(it = flares.begin(); it != flares.end(); it++)181 for(it = ++flares.begin(); it != flares.end(); it++) 185 182 (*it)->setVisibility(visibility); 186 this-> isVisible = visibility;183 this->bVisible = visibility; 187 184 } 188 185 … … 205 202 206 203 //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()); 214 206 215 207 -
trunk/src/lib/graphics/effects/lense_flare.h
r7810 r7844 48 48 49 49 private: 50 float isVisible; //!< Checks visibility50 bool bVisible; //!< Checks visibility 51 51 Light* lightSource; //!< reference to the sun (or primary light source) 52 52 std::vector<ImagePlane*> flares; //!< the flares array -
trunk/src/lib/graphics/render2D/element_2d.cc
r7843 r7844 883 883 { 884 884 this->bCurrentlyVisible = true; 885 printf("OK \n");886 885 } 887 886 … … 1034 1033 void Element2D::draw2D(E2D_LAYER from, E2D_LAYER to) const 1035 1034 { 1036 if (this-> bVisible && this->bCurrentlyVisible)1035 if (this->isVisible()) 1037 1036 this->draw(); 1038 1037 if (this->children.size() > 0)
Note: See TracChangeset
for help on using the changeset viewer.