OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
LineIntersector.h
Go to the documentation of this file.
1
10#ifndef LINEINTERSECTOR_H
11#define LINEINTERSECTOR_H
12
13#include <vector>
14#include <osgUtil/LineSegmentIntersector>
15
23class LineIntersector : public osgUtil::LineSegmentIntersector
24{
25public:
27
28 LineIntersector(const osg::Vec3& start, const osg::Vec3& end);
29 LineIntersector(CoordinateFrame cf, double x, double y);
30 LineIntersector(CoordinateFrame cf, const osg::Vec3d& start, const osg::Vec3d& end);
31
32 void setOffset(float offset);
33 float getOffset() const;
34 void getHitIndices(int& first, int& last) const;
35
36 virtual Intersector* clone( osgUtil::IntersectionVisitor& iv );
37 virtual void intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable);
38
39 bool isVirtualIntersector() const;
40
41protected:
42 double getSkewLinesDistance(const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2);
43 virtual bool isRightPrimitive(const osg::Geometry* geometry);
44
45 float m_offset;
46 std::vector<unsigned int> m_hitIndices;
47};
48
49#endif // L
OSG-based line intersector class.
Definition LineIntersector.h:24
LineIntersector(CoordinateFrame cf, const osg::Vec3d &start, const osg::Vec3d &end)
LineIntersector()
Definition LineIntersector.cpp:8
std::vector< unsigned int > m_hitIndices
Definition LineIntersector.h:46
bool isVirtualIntersector() const
Definition LineIntersector.cpp:135
float m_offset
Definition LineIntersector.h:45
LineIntersector(CoordinateFrame cf, double x, double y)
virtual void intersect(osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)
Definition LineIntersector.cpp:97
virtual bool isRightPrimitive(const osg::Geometry *geometry)
Definition LineIntersector.cpp:169
virtual Intersector * clone(osgUtil::IntersectionVisitor &iv)
Definition LineIntersector.cpp:57
void getHitIndices(int &first, int &last) const
Definition LineIntersector.cpp:45
double getSkewLinesDistance(const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2)
Definition LineIntersector.cpp:140
void setOffset(float offset)
Definition LineIntersector.cpp:35
float getOffset() const
Definition LineIntersector.cpp:40