Changeset 13041 for OpenSceneGraph/trunk/include/osgUtil/IntersectVisitor
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgUtil/IntersectVisitor
r10100 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 */ … … 31 31 32 32 class OSGUTIL_EXPORT Hit 33 { 33 { 34 34 /** Deprecated */ 35 35 public: … … 38 38 Hit(const Hit& hit); 39 39 ~Hit(); 40 40 41 41 Hit& operator = (const Hit& hit); 42 42 43 43 typedef std::vector<int> VecIndexList; 44 44 … … 49 49 return _ratio<hit._ratio; 50 50 } 51 52 51 52 53 53 const osg::Vec3& getLocalIntersectPoint() const { return _intersectPoint; } 54 54 const osg::Vec3& getLocalIntersectNormal() const { return _intersectNormal; } 55 55 56 56 const osg::Vec3 getWorldIntersectPoint() const { if (_matrix.valid()) return _intersectPoint*(*_matrix); else return _intersectPoint; } 57 57 const osg::Vec3 getWorldIntersectNormal() const ; … … 70 70 const VecIndexList& getVecIndexList() const { return _vecIndexList; } 71 71 int getPrimitiveIndex() const { return _primitiveIndex; } 72 73 72 73 74 74 float _ratio; 75 75 osg::ref_ptr<osg::LineSegment> _originalLineSegment; … … 80 80 osg::ref_ptr<osg::RefMatrix> _matrix; 81 81 osg::ref_ptr<osg::RefMatrix> _inverse; 82 82 83 83 VecIndexList _vecIndexList; 84 84 int _primitiveIndex; … … 101 101 102 102 void reset(); 103 103 104 104 /** Add a line segment to use for intersection testing during scene traversal. 105 105 * Note, a maximum of 32 line segments can be added to a IntersectVistor, … … 114 114 115 115 int getNumHits(const osg::LineSegment* seg) { return _segHitList[seg].size(); } 116 116 117 117 LineSegmentHitListMap& getSegHitList() { return _segHitList; } 118 118 … … 124 124 USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION 125 125 }; 126 126 127 127 void setLODSelectionMode(LODSelectionMode mode) { _lodSelectionMode = mode; } 128 128 LODSelectionMode getLODSelectionMode() const { return _lodSelectionMode; } … … 191 191 192 192 typedef std::vector<osg::ref_ptr<IntersectState> > IntersectStateStack; 193 193 194 194 IntersectStateStack _intersectStateStack; 195 195 196 196 LineSegmentHitListMap _segHitList; 197 197 198 198 LODSelectionMode _lodSelectionMode; 199 199 osg::Vec3 _pseudoEyePoint; … … 214 214 215 215 protected: 216 216 217 217 float _mx; 218 218 float _my;
