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/osgManipulator/Projector.cpp

    r13027 r13041  
    3131    // An explanation of the algorithm can be found at 
    3232    // http://www.geometryalgorithms.com/Archive/algorithm_0106/algorithm_0106.htm 
    33      
     33 
    3434    osg::LineSegment::vec_type u = l1.end() - l1.start(); u.normalize(); 
    3535    osg::LineSegment::vec_type v = l2.end() - l2.start(); v.normalize(); 
     
    7575} 
    7676 
    77 bool getPlaneLineIntersection(const osg::Vec4d& plane,  
    78                               const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd,  
     77bool getPlaneLineIntersection(const osg::Vec4d& plane, 
     78                              const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd, 
    7979                              osg::Vec3d& isect) 
    8080{ 
     
    9595} 
    9696 
    97 bool getSphereLineIntersection(const osg::Sphere& sphere,  
    98                                const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd,  
     97bool getSphereLineIntersection(const osg::Sphere& sphere, 
     98                               const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd, 
    9999                               osg::Vec3d& frontISect, osg::Vec3d& backISect) 
    100100{ 
     
    105105    double B = 2.0f * (lineDirection * v); 
    106106    double C = v * v - sphere.getRadius() * sphere.getRadius(); 
    107      
     107 
    108108    double discriminant = B * B - 4.0f * C; 
    109109 
     
    121121} 
    122122 
    123 bool getUnitCylinderLineIntersection(const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd,  
     123bool getUnitCylinderLineIntersection(const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd, 
    124124                                     osg::Vec3d& isectFront, osg::Vec3d& isectBack) 
    125125{ 
     
    153153 
    154154bool getCylinderLineIntersection(const osg::Cylinder& cylinder, 
    155                                  const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd,  
     155                                 const osg::Vec3d& lineStart, const osg::Vec3d& lineEnd, 
    156156                                 osg::Vec3d& isectFront, osg::Vec3d& isectBack) 
    157157{ 
     
    162162                               * osg::Matrix::scale(oneOverRadius, oneOverRadius, oneOverRadius) 
    163163                               * osg::Matrix(cylinder.getRotation().inverse()); 
    164                                 
     164 
    165165    // Transform the lineStart and lineEnd into the unit cylinder space. 
    166166    osg::Vec3d unitCylLineStart = lineStart * toUnitCylInZ; 
     
    170170    osg::Vec3d unitCylIsectFront, unitCylIsectBack; 
    171171    if (! getUnitCylinderLineIntersection(unitCylLineStart, unitCylLineEnd, unitCylIsectFront, unitCylIsectBack)) 
    172         return false;     
     172        return false; 
    173173 
    174174    // Transform back from unit cylinder space. 
    175175    osg::Matrix invToUnitCylInZ(osg::Matrix::inverse(toUnitCylInZ)); 
    176176    isectFront = unitCylIsectFront * invToUnitCylInZ; 
    177     isectBack = unitCylIsectBack * invToUnitCylInZ;     
     177    isectBack = unitCylIsectBack * invToUnitCylInZ; 
    178178 
    179179    return true; 
     
    182182osg::Vec3d getLocalEyeDirection(const osg::Vec3d& eyeDir, const osg::Matrix& localToWorld) 
    183183{ 
    184     // To take a normal from world to local you need to transform it by the transpose of the inverse of the  
     184    // To take a normal from world to local you need to transform it by the transpose of the inverse of the 
    185185    // world to local matrix. Pre-multiplying is equivalent to doing a post-multiplication of the transpose. 
    186186    osg::Vec3d localEyeDir = localToWorld * eyeDir;