Changeset 13041 for OpenSceneGraph/trunk/src/osgSim/Sector.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgSim/Sector.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgSim/Sector.cpp
r10321 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 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 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * 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 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 19 19 20 20 // 21 // Elevation Range 21 // Elevation Range 22 22 // 23 23 … … 59 59 60 60 // 61 // Elevation Range 61 // Elevation Range 62 62 // 63 63 void ElevationRange::setElevationRange(float minElevation,float maxElevation,float fadeAngle) … … 287 287 if ( ang > osg::PI ) _cosHorizFadeAngle = -1.0 ; 288 288 else _cosHorizFadeAngle = cos(ang); 289 289 290 290 ang = acos(_cosVertAngle)+angle ; 291 291 if ( ang > osg::PI ) _cosVertFadeAngle = -1.0 ; … … 299 299 300 300 float DirectionalSector::operator() (const osg::Vec3& eyeLocal) const 301 { 301 { 302 302 float elev_intensity, azim_intensity ; 303 303 304 304 // Tranform eyeLocal into the LightPoint frame 305 305 osg::Vec3 EPlp = _local_to_LP * eyeLocal ; 306 306 307 307 /*fprintf(stderr, " eyeLocal = %f, %f, %f\n", eyeLocal[0], eyeLocal[1], eyeLocal[2]) ; 308 308 fprintf(stderr, " EPlp = %f, %f, %f\n", EPlp[0], EPlp[1], EPlp[2]) ;*/ 309 309 310 310 // Elevation check 311 311 // Project EPlp into LP YZ plane and dot with LPy … … 331 331 } 332 332 // Elevation check passed 333 333 334 334 // Azimuth check 335 335 // Project EPlp into LP XY plane and dot with LPy … … 357 357 } 358 358 // Azimuth check passed 359 359 360 360 // We're good! Return full intensity 361 361 //fprintf(stderr, " %%%% Returing intensity = %f\n", elev_intensity * azim_intensity) ;
