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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgShadow/OccluderGeometry

    r7038 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*/ 
     
    3030  * OccluderGeometry supports the computation of silhouette edges and shadow volume geometries, as well as use as geometry that one can rendering 
    3131  * into a shadow map or end caps for the ZP+ algorithm.  OccluderGeometry may be of the same resolution as an underlying geometry that it 
    32   * represents, or can be of lower resolution and combine manager seperate geometries together into a single shadow casting object.  
     32  * represents, or can be of lower resolution and combine manager seperate geometries together into a single shadow casting object. 
    3333  * OccluderGeometry may be attached as UserData to Nodes or to Drawables.  */ 
    3434class OSGSHADOW_EXPORT OccluderGeometry : public osg::Drawable 
     
    3838 
    3939        OccluderGeometry(const OccluderGeometry& oc, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); 
    40              
     40 
    4141        virtual Object* cloneType() const { return new OccluderGeometry(); } 
    4242        virtual Object* clone(const osg::CopyOp& copyop) const { return new OccluderGeometry(*this,copyop); } 
     
    4444        virtual const char* libraryName() const { return "osgShadow"; } 
    4545        virtual const char* className() const { return "OccluderGeometry"; } 
    46          
     46 
    4747        /** Compute an occluder geometry containing all the geometry in specified subgraph.*/ 
    4848        void computeOccluderGeometry(osg::Node* subgraph, osg::Matrix* matrix=0, float sampleRatio=1.0f); 
    49          
     49 
    5050        /** Compute an occluder geometry containing the geometry in specified drawable.*/ 
    5151        void computeOccluderGeometry(osg::Drawable* drawable, osg::Matrix* matrix=0, float sampleRatio=1.0f); 
    52          
     52 
    5353 
    5454        /** Compute ShadowVolumeGeometry. */ 
    5555        void computeShadowVolumeGeometry(const osg::Vec4& lightpos, ShadowVolumeGeometry& svg) const; 
    5656 
    57          
     57 
    5858        /** Set the bounding polytope of the OccluderGeometry.*/ 
    5959        void setBoundingPolytope(const osg::Polytope& polytope) { _boundingPolytope = polytope; } 
     
    6868        /** Render the occluder geometry. */ 
    6969        virtual void drawImplementation(osg::RenderInfo& renderInfo) const; 
    70          
     70 
    7171        /** Compute the bounding box around occluder geometry.*/ 
    7272        virtual osg::BoundingBox computeBound() const; 
     
    8282 
    8383        virtual ~OccluderGeometry() {} 
    84          
     84 
    8585        struct Edge 
    8686        { 
     
    104104                } 
    105105            } 
    106              
     106 
    107107            inline bool operator < (const Edge& rhs) const 
    108108            { 
     
    111111                return (_p2 < rhs._p2); 
    112112            } 
    113              
     113 
    114114            bool addTriangle(unsigned int tri) const 
    115115            { 
     
    127127                return false; 
    128128            } 
    129              
     129 
    130130            bool boundaryEdge() const { return _t2<0; } 
    131          
     131 
    132132            unsigned int    _p1; 
    133133            unsigned int    _p2; 
    134              
     134 
    135135            mutable int     _t1; 
    136136            mutable int     _t2; 
    137              
     137 
    138138            mutable osg::Vec3   _normal; 
    139139        }; 
     
    144144        { 
    145145            if (edge.boundaryEdge()) return true; 
    146              
     146 
    147147            float offset = 0.0f; 
    148148 
    149149            osg::Vec3 delta(lightpos-_vertices[edge._p1]); 
    150150            delta.normalize(); 
    151              
     151 
    152152            float n1 = delta * _triangleNormals[edge._t1] + offset; 
    153153            float n2 = delta * _triangleNormals[edge._t2] + offset; 
     
    159159 
    160160            if (n1==0.0f && n2==0.0f) return false; 
    161              
    162             return n1*n2 <= 0.0f;  
     161 
     162            return n1*n2 <= 0.0f; 
    163163        } 
    164164 
     
    166166        { 
    167167            if (edge.boundaryEdge()) return true; 
    168              
     168 
    169169            float offset = 0.0f; 
    170              
     170 
    171171            float n1 = lightdirection * _triangleNormals[edge._t1] + offset; 
    172172            float n2 = lightdirection * _triangleNormals[edge._t2] + offset; 
     
    178178 
    179179            if (n1==0.0f && n2==0.0f) return false; 
    180              
    181             return n1*n2 <= 0.0f;  
     180 
     181            return n1*n2 <= 0.0f; 
    182182        } 
    183          
     183 
    184184        void setUpInternalStructures(); 
    185          
     185 
    186186        void removeDuplicateVertices(); 
    187187        void removeNullTriangles(); 
    188188        void computeNormals(); 
    189189        void buildEdgeMaps(); 
    190          
     190 
    191191        void computeLightDirectionSilhouetteEdges(const osg::Vec3& lightdirection, UIntList& silhouetteIndices) const; 
    192192        void computeLightPositionSilhouetteEdges(const osg::Vec3& lightpos, UIntList& silhouetteIndices) const; 
     
    198198        Vec3List _triangleNormals; 
    199199        UIntList _triangleIndices; 
    200          
     200 
    201201        EdgeList _edges; 
    202202}; 
     
    208208 
    209209        ShadowVolumeGeometry(const ShadowVolumeGeometry& oc, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); 
    210              
     210 
    211211        virtual Object* cloneType() const { return new ShadowVolumeGeometry(); } 
    212212        virtual Object* clone(const osg::CopyOp& copyop) const { return new ShadowVolumeGeometry(*this,copyop); } 
     
    221221            STENCIL_TWO_SIDED 
    222222        }; 
    223          
     223 
    224224        void setDrawMode(DrawMode mode) { _drawMode = mode; } 
    225225        DrawMode getDrawMode() const { return _drawMode; } 
     
    227227        typedef std::vector<osg::Vec3> Vec3List; 
    228228        typedef std::vector<GLuint> UIntList; 
    229          
     229 
    230230        void setVertices(const Vec3List& vertices) { _vertices = vertices; } 
    231231        Vec3List& getVertices() { return _vertices; } 
    232232        const Vec3List& getVertices() const { return _vertices; } 
    233          
     233 
    234234        void setNormals(const Vec3List& normals) { _normals = normals; } 
    235235        Vec3List& getNormals() { return _normals; } 
    236236        const Vec3List& getNormals() const { return _normals; } 
    237          
     237 
    238238 
    239239        /** Render the occluder geometry. */ 
    240240        virtual void drawImplementation(osg::RenderInfo& renderInfo) const; 
    241          
     241 
    242242        /** Compute the bounding box around occluder geometry.*/ 
    243243        virtual osg::BoundingBox computeBound() const;