Changeset 8560
- Timestamp:
- 07/11/08 18:51:11
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph/trunk/src/osgUtil/LineSegmentIntersector.cpp
r8552 r8560 302 302 { 303 303 osg::KdTree::LineSegmentIntersections intersections; 304 intersections.reserve(4); 304 305 if (kdTree->intersect(s,e,intersections)) 305 306 { … … 309 310 ++itr) 310 311 { 311 osg::KdTree::LineSegmentIntersection& lsi = const_cast<osg::KdTree::LineSegmentIntersection&>(*itr);312 osg::KdTree::LineSegmentIntersection& lsi = *(itr); 312 313 313 314 // get ratio in s,e range … … 331 332 hit.localIntersectionNormal = lsi.intersectionNormal; 332 333 333 hit.indexList.swap(lsi.indexList); 334 hit.ratioList.swap(lsi.ratioList); 334 hit.indexList.reserve(3); 335 hit.ratioList.reserve(3); 336 if (lsi.r0!=0.0f) 337 { 338 hit.indexList.push_back(lsi.p0); 339 hit.ratioList.push_back(lsi.r0); 340 } 341 342 if (lsi.r1!=0.0f) 343 { 344 hit.indexList.push_back(lsi.p1); 345 hit.ratioList.push_back(lsi.r1); 346 } 347 348 if (lsi.r2!=0.0f) 349 { 350 hit.indexList.push_back(lsi.p2); 351 hit.ratioList.push_back(lsi.r2); 352 } 335 353 336 354 insertIntersection(hit); 337 338 355 } 339 356 }
