Ignore:
Timestamp:
02/20/06 19:06:03 (19 years ago)
Author:
mattausch
Message:

added ogre dependencies and patched ogre sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OGRE/trunk/ogre_changes/Plugins/OctreeSceneManager/src/OgreTerrainRenderable.cpp

    r193 r657  
    7777 
    7878        mInit = false; 
     79        mLightListDirty = true; 
    7980                MovableObject::mCastShadows = false; 
    8081 
     
    251252            ( startz * msOptions->scale.z + (endz - 1) * msOptions->scale.z ) / 2 ); 
    252253 
     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 
    253259        // Create delta buffer list if required to morph 
    254260        if (msOptions->lodMorph) 
     
    344350 
    345351                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()); 
    347356 
    348357        Real L = diff.squaredLength(); 
     
    443452    void TerrainRenderable::_updateRenderQueue( RenderQueue* queue ) 
    444453    { 
     454        // Notify need to calculate light list when our sending to render queue 
     455        mLightListDirty = true; 
     456 
    445457        queue->addRenderable( this ); 
    446458    } 
     
    9941006    const LightList& TerrainRenderable::getLights(void) const 
    9951007    { 
    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; 
    9971015    } 
    9981016    //----------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.