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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgShadow/ShadowMap.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*/ 
     
    3535// fragment shader 
    3636// 
    37 static const char fragmentShaderSource_noBaseTexture[] =  
     37static const char fragmentShaderSource_noBaseTexture[] = 
    3838    "uniform sampler2DShadow osgShadow_shadowTexture; \n" 
    3939    "uniform vec2 osgShadow_ambientBias; \n" 
     
    4747// fragment shader 
    4848// 
    49 static const char fragmentShaderSource_withBaseTexture[] =  
     49static const char fragmentShaderSource_withBaseTexture[] = 
    5050    "uniform sampler2D osgShadow_baseTexture; \n" 
    5151    "uniform sampler2DShadow osgShadow_shadowTexture; \n" 
     
    217217#if 1 
    218218        // cull front faces so that only backfaces contribute to depth map 
    219          
     219 
    220220 
    221221        osg::ref_ptr<osg::CullFace> cull_face = new osg::CullFace; 
     
    252252 
    253253    { 
    254         _stateset = new osg::StateSet;         
     254        _stateset = new osg::StateSet; 
    255255        _stateset->setTextureAttributeAndModes(_shadowTextureUnit,_texture.get(),osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE); 
    256256        _stateset->setTextureMode(_shadowTextureUnit,GL_TEXTURE_GEN_S,osg::StateAttribute::ON); 
     
    375375 
    376376            osg::RefMatrix* matrix = itr->second.get(); 
    377             if (matrix)  
     377            if (matrix) 
    378378            { 
    379379                lightpos = light->getPosition() * (*matrix); 
    380380                lightDir = osg::Matrix::transform3x3( light->getDirection(), *matrix ); 
    381381            } 
    382             else  
     382            else 
    383383            { 
    384384                lightpos = light->getPosition(); 
     
    392392    eyeToWorld.invert(*cv.getModelViewMatrix()); 
    393393 
    394     lightpos = lightpos * eyeToWorld;      
     394    lightpos = lightpos * eyeToWorld; 
    395395    lightDir = osg::Matrix::transform3x3( lightDir, eyeToWorld ); 
    396396    lightDir.normalize(); 
     
    413413        else 
    414414        { 
    415             // get the bounds of the model.     
     415            // get the bounds of the model. 
    416416            osg::ComputeBoundsVisitor cbbv(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN); 
    417417            cbbv.setTraversalMask(getShadowedScene()->getCastsShadowTraversalMask()); 
     
    464464        } 
    465465 
    466         cv.setTraversalMask( traversalMask &  
     466        cv.setTraversalMask( traversalMask & 
    467467            getShadowedScene()->getCastsShadowTraversalMask() ); 
    468468 
     
    486486        cv.getRenderStage()->getPositionalStateContainer()-> 
    487487             addPositionedTextureAttribute( _shadowTextureUnit, refMatrix, _texgen.get() ); 
    488 #else  
     488#else 
    489489        // compute the matrix which takes a vertex from local coords into tex coords 
    490490        // will use this later to specify osg::TexGen.. 
    491         osg::Matrix MVPT = _camera->getViewMatrix() *  
     491        osg::Matrix MVPT = _camera->getViewMatrix() * 
    492492               _camera->getProjectionMatrix() * 
    493493               osg::Matrix::translate(1.0,1.0,1.0) * 
     
    513513//////////////////////////////////////////////////////////////////////////////// 
    514514// Callback used by debugging hud to display Shadow Map in color buffer 
    515 // OSG does not allow to use the same GL Texture Id with different glTexParams.  
    516 // Callback simply turns shadow compare mode off via GL while rendering hud and  
    517 // restores it afterwards.  
     515// OSG does not allow to use the same GL Texture Id with different glTexParams. 
     516// Callback simply turns shadow compare mode off via GL while rendering hud and 
     517// restores it afterwards. 
    518518//////////////////////////////////////////////////////////////////////////////// 
    519 class ShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback:  
     519class ShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback: 
    520520    public osg::Drawable::DrawCallback 
    521521{ 
    522522public: 
    523     //  
     523    // 
    524524    DrawableDrawWithDepthShadowComparisonOffCallback 
    525525        ( osg::Texture2D * texture, unsigned stage = 0 ) 
     
    536536 
    537537            // Turn off depth comparison mode 
    538             glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,  
     538            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
    539539                             GL_NONE ); 
    540540        } 
     
    544544        if( _texture.valid() ) { 
    545545            // Turn it back on 
    546             glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,  
     546            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
    547547                             GL_COMPARE_R_TO_TEXTURE_ARB ); 
    548548        } 
     
    565565    camera->setProjectionMatrix(osg::Matrix::ortho2D(0,size.x(),0,size.y())); 
    566566 
    567     // set the view matrix     
     567    // set the view matrix 
    568568    camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); 
    569569    camera->setViewMatrix(osg::Matrix::identity()); 
     
    583583 
    584584    osg::Vec3 position(10.0f,size.y()-100.0f,0.0f); 
    585     osg::Vec3 delta(0.0f,-120.0f,0.0f);  
     585    osg::Vec3 delta(0.0f,-120.0f,0.0f); 
    586586    float length = 300.0f; 
    587587