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/ShadowTexture.cpp

    r11137 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*/ 
     
    4242    unsigned int tex_width = 512; 
    4343    unsigned int tex_height = 512; 
    44      
     44 
    4545    _texture = new osg::Texture2D; 
    4646    _texture->setTextureSize(tex_width, tex_height); 
     
    5858 
    5959        _camera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); 
    60          
     60 
    6161        _camera->setCullCallback(new CameraCullCallback(this)); 
    6262 
     
    8282        osg::StateSet* stateset = _camera->getOrCreateStateSet(); 
    8383        stateset->setAttribute(_material.get(),osg::StateAttribute::OVERRIDE); 
    84          
    85     } 
    86      
    87     { 
    88         _stateset = new osg::StateSet;         
     84 
     85    } 
     86 
     87    { 
     88        _stateset = new osg::StateSet; 
    8989        _stateset->setTextureAttributeAndModes(_textureUnit,_texture.get(),osg::StateAttribute::ON); 
    9090        _stateset->setTextureMode(_textureUnit,GL_TEXTURE_GEN_S,osg::StateAttribute::ON); 
     
    9292        _stateset->setTextureMode(_textureUnit,GL_TEXTURE_GEN_R,osg::StateAttribute::ON); 
    9393        _stateset->setTextureMode(_textureUnit,GL_TEXTURE_GEN_Q,osg::StateAttribute::ON); 
    94          
     94 
    9595        _texgen = new osg::TexGen; 
    9696    } 
    97      
     97 
    9898    _dirty = false; 
    9999} 
     
    114114    // do traversal of shadow casting scene which does not need to be decorated by the shadow texture 
    115115    { 
    116         cv.setTraversalMask( traversalMask &  
     116        cv.setTraversalMask( traversalMask & 
    117117                             getShadowedScene()->getCastsShadowTraversalMask() ); 
    118118 
     
    123123    { 
    124124        cv.pushStateSet(_stateset.get()); 
    125      
    126         cv.setTraversalMask( traversalMask &  
     125 
     126        cv.setTraversalMask( traversalMask & 
    127127                             getShadowedScene()->getReceivesShadowTraversalMask() ); 
    128128 
    129129        _shadowedScene->osg::Group::traverse(cv); 
    130          
     130 
    131131        cv.popStateSet(); 
    132132 
    133133    } 
    134      
     134 
    135135    // need to compute view frustum for RTT camera. 
    136136    // 1) get the light position 
     
    155155        } 
    156156    } 
    157      
     157 
    158158    osg::Matrix eyeToWorld; 
    159159    eyeToWorld.invert(*cv.getModelViewMatrix()); 
    160      
     160 
    161161    lightpos = lightpos * eyeToWorld; 
    162162 
     
    164164    { 
    165165 
    166         // get the bounds of the model.     
     166        // get the bounds of the model. 
    167167        osg::ComputeBoundsVisitor cbbv(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN); 
    168168        cbbv.setTraversalMask(getShadowedScene()->getCastsShadowTraversalMask()); 
    169          
     169 
    170170        _shadowedScene->osg::Group::traverse(cbbv); 
    171          
     171 
    172172        osg::BoundingBox bb = cbbv.getBoundingBox(); 
    173          
     173 
    174174        if (lightpos[3]!=0.0) 
    175175        { 
     
    189189            _camera->setProjectionMatrixAsFrustum(-right,right,-top,top,znear,zfar); 
    190190            _camera->setViewMatrixAsLookAt(position,bb.center(),computeOrthogonalVector(bb.center()-position)); 
    191              
     191 
    192192 
    193193            // compute the matrix which takes a vertex from local coords into tex coords 
    194194            // will use this later to specify osg::TexGen.. 
    195             osg::Matrix MVPT = _camera->getViewMatrix() *  
     195            osg::Matrix MVPT = _camera->getViewMatrix() * 
    196196                               _camera->getProjectionMatrix() * 
    197197                               osg::Matrix::translate(1.0,1.0,1.0) * 
    198198                               osg::Matrix::scale(0.5f,0.5f,0.5f); 
    199                                 
     199 
    200200            _texgen->setMode(osg::TexGen::EYE_LINEAR); 
    201201            _texgen->setPlanesFromMatrix(MVPT); 
     
    223223            _camera->setProjectionMatrixAsOrtho(-right, right, -top, top, znear, zfar); 
    224224            _camera->setViewMatrixAsLookAt(position,bb.center(),computeOrthogonalVector(lightDir)); 
    225              
     225 
    226226 
    227227            // compute the matrix which takes a vertex from local coords into tex coords 
    228228            // will use this later to specify osg::TexGen.. 
    229             osg::Matrix MVPT = _camera->getViewMatrix() *  
     229            osg::Matrix MVPT = _camera->getViewMatrix() * 
    230230                               _camera->getProjectionMatrix() * 
    231231                               osg::Matrix::translate(1.0,1.0,1.0) * 
    232232                               osg::Matrix::scale(0.5f,0.5f,0.5f); 
    233                                 
     233 
    234234            _texgen->setMode(osg::TexGen::EYE_LINEAR); 
    235235            _texgen->setPlanesFromMatrix(MVPT); 
     
    237237 
    238238 
    239         cv.setTraversalMask( traversalMask &  
     239        cv.setTraversalMask( traversalMask & 
    240240                             getShadowedScene()->getCastsShadowTraversalMask() ); 
    241241 
     
    245245        orig_rs->getPositionalStateContainer()->addPositionedTextureAttribute(_textureUnit, cv.getModelViewMatrix(), _texgen.get()); 
    246246    } 
    247      
    248      
    249      
     247 
     248 
     249 
    250250 
    251251