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/src/osg/ClusterCullingCallback.cpp

    r12901 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*/ 
     
    6464        { 
    6565            _normal += normal; 
    66         }         
     66        } 
    6767        _center += v1; 
    6868        _center += v2; 
    6969        _center += v3; 
    70                  
     70 
    7171        ++_num; 
    7272 
    7373    } 
    74      
     74 
    7575    osg::Vec3 center() { return _center /  (double)(3*_num); } 
    7676    osg::Vec3 normal() { _normal.normalize(); return _normal; } 
    77      
     77 
    7878    unsigned int _num; 
    7979    Vec3d _center; 
     
    8787        _deviation(1.0), 
    8888        _radius2(0.0) {} 
    89          
     89 
    9090    void set(const osg::Vec3& center,const osg::Vec3& normal) 
    9191    { 
     
    118118    TriangleFunctor<ComputeAveragesFunctor> caf; 
    119119    drawable->accept(caf); 
    120      
     120 
    121121    _controlPoint = caf.center(); 
    122122    _normal = caf.normal(); 
    123      
     123 
    124124    TriangleFunctor<ComputeDeviationFunctor> cdf; 
    125125    cdf.set(_controlPoint,_normal); 
    126126    drawable->accept(cdf); 
    127      
     127 
    128128//    OSG_NOTICE<<"ClusterCullingCallback::computeFrom() _controlPoint="<<_controlPoint<<std::endl; 
    129129//    OSG_NOTICE<<"                                      _normal="<<_normal<<std::endl; 
    130130//    OSG_NOTICE<<"                                      cdf._deviation="<<cdf._deviation<<std::endl; 
    131      
     131 
    132132 
    133133    if (_normal.length2()==0.0) _deviation = -1.0f; 
    134     else  
     134    else 
    135135    { 
    136136        float angle = acosf(cdf._deviation)+osg::PI*0.5f; 
     
    138138        else _deviation = -1.0f; 
    139139    } 
    140      
     140 
    141141    _radius = sqrtf(cdf._radius2); 
    142142} 
     
    172172        return false; 
    173173    } 
    174      
     174 
    175175    osg::Vec3 eye_cp = nv->getViewPoint() - _controlPoint; 
    176176    float radius = eye_cp.length(); 
    177      
     177 
    178178    if (radius<_radius) 
    179179    { 
    180180        return false; 
    181181    } 
    182      
    183      
     182 
     183 
    184184    float deviation = (eye_cp * _normal)/radius; 
    185185 
     
    196196    { 
    197197        if (cull(nv,0,static_cast<State *>(0))) return; 
    198          
    199         traverse(node,nv);  
    200     } 
    201 } 
     198 
     199        traverse(node,nv); 
     200    } 
     201}