- Timestamp:
- 02/20/06 19:06:03 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OGRE/trunk/ogre_changes/Plugins/OctreeSceneManager/src/OgreTerrainRenderable.cpp
r193 r657 77 77 78 78 mInit = false; 79 mLightListDirty = true; 79 80 MovableObject::mCastShadows = false; 80 81 … … 251 252 ( startz * msOptions->scale.z + (endz - 1) * msOptions->scale.z ) / 2 ); 252 253 254 mBoundingRadius = 255 std::max(max - min, 256 std::max((endx - 1 - startx) * msOptions->scale.x, 257 (endz - 1 - startz) * msOptions->scale.z)) / 2; 258 253 259 // Create delta buffer list if required to morph 254 260 if (msOptions->lodMorph) … … 344 350 345 351 Vector3 cpos = cam -> getDerivedPosition(); 346 Vector3 diff = mCenter - cpos; 352 const AxisAlignedBox& aabb = getWorldBoundingBox(true); 353 Vector3 diff(0, 0, 0); 354 diff.makeFloor(cpos - aabb.getMinimum()); 355 diff.makeCeil(cpos - aabb.getMaximum()); 347 356 348 357 Real L = diff.squaredLength(); … … 443 452 void TerrainRenderable::_updateRenderQueue( RenderQueue* queue ) 444 453 { 454 // Notify need to calculate light list when our sending to render queue 455 mLightListDirty = true; 456 445 457 queue->addRenderable( this ); 446 458 } … … 994 1006 const LightList& TerrainRenderable::getLights(void) const 995 1007 { 996 return getParentSceneNode()->findLights(this->getBoundingRadius()); 1008 if (mLightListDirty) 1009 { 1010 getParentSceneNode()->getCreator()->_populateLightList( 1011 mCenter, this->getBoundingRadius(), mLightList); 1012 mLightListDirty = false; 1013 } 1014 return mLightList; 997 1015 } 998 1016 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.