Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgShadow/MinimalCullBoundsShadowMap.cpp

    r12577 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212 * 
     
    3434} 
    3535 
    36 MinimalCullBoundsShadowMap::~MinimalCullBoundsShadowMap()  
     36MinimalCullBoundsShadowMap::~MinimalCullBoundsShadowMap() 
    3737{ 
    3838} 
     
    4848                                             ( const osg::Light *light, 
    4949                                               const osg::Vec4 &lightPos, 
    50                                                const osg::Vec3 &lightDir,                                                  
     50                                               const osg::Vec3 &lightDir, 
    5151                                               const osg::Vec3 &lightUp ) 
    5252{ 
     
    6161{ 
    6262    RenderLeafList rllOld, rllNew; 
    63      
     63 
    6464    GetRenderLeaves( _cv->getRenderStage(), rllOld ); 
    6565 
     
    7171    RemoveIgnoredRenderLeaves( rllNew ); 
    7272 
    73     osg::Matrix projectionToModelSpace =  
    74         osg::Matrix::inverse( *_modellingSpaceToWorldPtr *  
     73    osg::Matrix projectionToModelSpace = 
     74        osg::Matrix::inverse( *_modellingSpaceToWorldPtr * 
    7575            *_cv->getModelViewMatrix() * *_cv->getProjectionMatrix() ); 
    7676 
     
    7979 
    8080        osg::Polytope polytope; 
    81 #if 1         
     81#if 1 
    8282        polytope.setToUnitFrustum(); 
    8383#else 
     
    8686        polytope.transformProvidingInverse( *_modellingSpaceToWorldPtr * 
    8787                                  *_cv->getModelViewMatrix() * _clampedProjection ); 
    88                  
     88 
    8989        bb = ComputeRenderLeavesBounds( rllNew, projectionToModelSpace, polytope ); 
    9090    } else { 
    9191        bb = ComputeRenderLeavesBounds( rllNew, projectionToModelSpace ); 
    9292    } 
    93      
    94     cutScenePolytope( *_modellingSpaceToWorldPtr,  
     93 
     94    cutScenePolytope( *_modellingSpaceToWorldPtr, 
    9595                      osg::Matrix::inverse( *_modellingSpaceToWorldPtr ), bb ); 
    9696} 
     
    102102    osgUtil::RenderBin::RenderBinList::const_iterator rbitr; 
    103103 
    104     // scan pre render bins  
     104    // scan pre render bins 
    105105    for(rbitr = bins.begin(); rbitr!=bins.end() && rbitr->first<0; ++rbitr ) 
    106106       GetRenderLeaves( rbitr->second.get(), rll ); 
     
    111111    for( rlitr= renderLeafList.begin(); rlitr!= renderLeafList.end(); ++rlitr ) 
    112112    { 
    113         rll.push_back( *rlitr );         
     113        rll.push_back( *rlitr ); 
    114114    } 
    115115 
    116116    // scan coarse grained ordering. 
    117117    osgUtil::RenderBin::StateGraphList& stateGraphList = rb->getStateGraphList(); 
    118     osgUtil::RenderBin::StateGraphList::const_iterator oitr;     
     118    osgUtil::RenderBin::StateGraphList::const_iterator oitr; 
    119119    for( oitr= stateGraphList.begin(); oitr!= stateGraphList.end(); ++oitr ) 
    120120    { 
    121         for( osgUtil::StateGraph::LeafList::const_iterator dw_itr =  
     121        for( osgUtil::StateGraph::LeafList::const_iterator dw_itr = 
    122122            (*oitr)->_leaves.begin(); dw_itr != (*oitr)->_leaves.end(); ++dw_itr) 
    123123        { 
     
    127127 
    128128    // scan post render bins 
    129     for(; rbitr!=bins.end(); ++rbitr )  
     129    for(; rbitr!=bins.end(); ++rbitr ) 
    130130       GetRenderLeaves( rbitr->second.get(), rll ); 
    131131} 
     
    137137      if ( !a ) return false; // NULL render leaf goes last 
    138138      return !b || 
    139              a->_projection < b->_projection ||  
     139             a->_projection < b->_projection || 
    140140             (a->_projection == b->_projection && a->_modelview < b->_modelview); 
    141141  } 
     
    171171    for( int i = 0; i < 3; i ++ ) 
    172172        for( int j = 0; j < 3; j ++ ) 
    173             if( s[i][j] < 0 ) bb._min[j] += s[i][j]; else bb._max[j] += s[i][j];     
     173            if( s[i][j] < 0 ) bb._min[j] += s[i][j]; else bb._max[j] += s[i][j]; 
    174174#else 
    175175    b.expandBy( o + s[0] ); 
     
    216216    unsigned count = 0; 
    217217 
    218     for( RenderLeafList::iterator it = rll.begin(); it != rll.end(); ++it )  
     218    for( RenderLeafList::iterator it = rll.begin(); it != rll.end(); ++it ) 
    219219    { 
    220220        if( !*it ) continue; 
     
    226226 
    227227        if( !strcmp( name, "LightPointDrawable" ) || 
    228             !strcmp( name, "LightPointSpriteDrawable" ) )  
     228            !strcmp( name, "LightPointSpriteDrawable" ) ) 
    229229        { 
    230230            *it = NULL; //ignored = invalidate this in new render leaves list 
    231             count++;         
     231            count++; 
    232232        } 
    233233    } 
     
    238238osg::BoundingBox MinimalCullBoundsShadowMap::ViewData::ComputeRenderLeavesBounds 
    239239    ( RenderLeafList &rll, osg::Matrix & projectionToWorld ) 
    240 {        
     240{ 
    241241    osg::BoundingBox bbResult; 
    242242 
     
    259259        // Don't trust already computed bounds for cull generated drawables 
    260260        // LightPointDrawable & LightPointSpriteDrawable are such examples 
    261         // they store wrong recorded bounds from very first pass   
    262         if( rl && rl->_modelview == NULL )  
     261        // they store wrong recorded bounds from very first pass 
     262        if( rl && rl->_modelview == NULL ) 
    263263            rl->_drawable->dirtyBound(); 
    264264 
     
    268268        } else { 
    269269            if( bb.valid() ) { 
    270                 // Conditions to avoid matrix multiplications   
    271                 if( projection.valid() )  
     270                // Conditions to avoid matrix multiplications 
     271                if( projection.valid() ) 
    272272                { 
    273                     if( projection.get() != ptrProjection )  
     273                    if( projection.get() != ptrProjection ) 
    274274                    { 
    275275                        ptrProjection = projection.get(); 
     
    281281                } 
    282282 
    283                 if( modelview.valid() )  
     283                if( modelview.valid() ) 
    284284                { 
    285285                    modelToWorld = *modelview.get() * *ptrViewToWorld; 
     
    292292                    bbResult.expandBy( bb.corner( i ) * *ptrModelToWorld ); 
    293293            } 
    294             if( !rl ) break;             
     294            if( !rl ) break; 
    295295            bb = rl->_drawable->getBound(); 
    296296            modelview = rl->_modelview; 
     
    306306osg::BoundingBox MinimalCullBoundsShadowMap::ViewData::ComputeRenderLeavesBounds 
    307307    ( RenderLeafList &rll, osg::Matrix & projectionToWorld, osg::Polytope & p ) 
    308 {        
     308{ 
    309309    osg::BoundingBox bbResult, bb; 
    310310 
     
    317317    osg::Matrix viewToWorld, modelToWorld, 
    318318                *ptrProjection = NULL, 
    319                 *ptrViewToWorld = &projectionToWorld,  
     319                *ptrViewToWorld = &projectionToWorld, 
    320320                *ptrModelToWorld = NULL; 
    321321 
     
    328328        // Don't trust already computed bounds for cull generated drawables 
    329329        // LightPointDrawable & LightPointSpriteDrawable are such examples 
    330         // they store wrong recorded bounds from very first pass   
     330        // they store wrong recorded bounds from very first pass 
    331331        if(rl->_modelview == NULL ) 
    332332            rl->_drawable->dirtyBound(); 
     
    334334        bb = rl->_drawable->getBound(); 
    335335        if( !bb.valid() ) continue; 
    336          
     336 
    337337        // Stay as long as possible in model space to minimize matrix ops 
    338338        if( rl->_modelview != modelview || rl->_projection != projection ) { 
    339339 
    340340            projection = rl->_projection; 
    341             if( projection.valid() )  
     341            if( projection.valid() ) 
    342342            { 
    343                if( projection.get() != ptrProjection )  
     343               if( projection.get() != ptrProjection ) 
    344344               { 
    345345                   ptrProjection = projection.get(); 
     
    352352 
    353353            modelview = rl->_modelview; 
    354             if( modelview.valid() )  
     354            if( modelview.valid() ) 
    355355            { 
    356356                modelToWorld = *modelview.get() * *ptrViewToWorld;