Changeset 13041 for OpenSceneGraph/trunk/src/osgSim/LineOfSight.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgSim/LineOfSight.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgSim/LineOfSight.cpp
r11487 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 */ … … 40 40 { 41 41 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 42 42 43 43 FileNameSceneMap::iterator itr = _filenameSceneMap.find(filename); 44 44 if (itr != _filenameSceneMap.end()) 45 45 { 46 46 OSG_INFO<<"Getting from cache "<<filename<<std::endl; 47 47 48 48 return itr->second.get(); 49 49 } 50 50 } 51 51 52 52 // now load the file. 53 53 osg::ref_ptr<osg::Node> node = osgDB::readNodeFile(filename); 54 54 55 55 // insert into the cache. 56 56 if (node.valid()) 57 57 { 58 58 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 59 59 60 60 if (_filenameSceneMap.size() < _maxNumFilesToCache) 61 61 { … … 84 84 } 85 85 } 86 86 87 87 return node.release(); 88 88 } … … 116 116 intersectorGroup->addIntersector( intersector.get() ); 117 117 } 118 118 119 119 _intersectionVisitor.reset(); 120 120 _intersectionVisitor.setTraversalMask(traversalMask); 121 121 _intersectionVisitor.setIntersector( intersectorGroup.get() ); 122 122 123 123 scene->accept(_intersectionVisitor); 124 124 125 125 unsigned int index = 0; 126 126 osgUtil::IntersectorGroup::Intersectors& intersectors = intersectorGroup->getIntersectors(); … … 134 134 Intersections& intersectionsLOS = _LOSList[index]._intersections; 135 135 _LOSList[index]._intersections.clear(); 136 136 137 137 osgUtil::LineSegmentIntersector::Intersections& intersections = lsi->getIntersections(); 138 138 139 139 for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin(); 140 140 itr != intersections.end(); … … 147 147 } 148 148 } 149 149 150 150 } 151 151
