OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
LineIntersector Class Reference

OSG-based line intersector class. More...

#include "LineIntersector.h"

Inheritance diagram for LineIntersector:

Public Member Functions

 LineIntersector ()
 
 LineIntersector (const osg::Vec3 &start, const osg::Vec3 &end)
 
 LineIntersector (CoordinateFrame cf, double x, double y)
 
 LineIntersector (CoordinateFrame cf, const osg::Vec3d &start, const osg::Vec3d &end)
 
void setOffset (float offset)
 
float getOffset () const
 
void getHitIndices (int &first, int &last) const
 
virtual Intersector * clone (osgUtil::IntersectionVisitor &iv)
 
virtual void intersect (osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)
 
bool isVirtualIntersector () const
 

Protected Member Functions

double getSkewLinesDistance (const osg::Vec3d &r1, const osg::Vec3d &r2, const osg::Vec3d &v1, const osg::Vec3d &v2)
 
virtual bool isRightPrimitive (const osg::Geometry *geometry)
 

Protected Attributes

float m_offset
 
std::vector< unsigned int > m_hitIndices
 

Detailed Description

OSG-based line intersector class.

This file is a part of osgIntersectors example program. See more details: https://github.com/vicrucann/osg-intersectors-example \autor Victoria Rudakova

Date
2016-2017

A class that allows to catch intersections with line loops and lines OpenGL types. It uses shortest distance between the cast ray and the geometry line which is calculated as a distance between skew lines. In addition, it filters out the geometries whose primitive sets are different than line-types.

Constructor & Destructor Documentation

◆ LineIntersector() [1/4]

LineIntersector::LineIntersector ( )

◆ LineIntersector() [2/4]

LineIntersector::LineIntersector ( const osg::Vec3 & start,
const osg::Vec3 & end )

◆ LineIntersector() [3/4]

LineIntersector::LineIntersector ( CoordinateFrame cf,
double x,
double y )

◆ LineIntersector() [4/4]

LineIntersector::LineIntersector ( CoordinateFrame cf,
const osg::Vec3d & start,
const osg::Vec3d & end )

Member Function Documentation

◆ clone()

osgUtil::Intersector * LineIntersector::clone ( osgUtil::IntersectionVisitor & iv)
virtual

◆ getHitIndices()

void LineIntersector::getHitIndices ( int & first,
int & last ) const

◆ getOffset()

float LineIntersector::getOffset ( ) const

◆ getSkewLinesDistance()

double LineIntersector::getSkewLinesDistance ( const osg::Vec3d & r1,
const osg::Vec3d & r2,
const osg::Vec3d & v1,
const osg::Vec3d & v2 )
protected

◆ intersect()

void LineIntersector::intersect ( osgUtil::IntersectionVisitor & iv,
osg::Drawable * drawable )
virtual

◆ isRightPrimitive()

bool LineIntersector::isRightPrimitive ( const osg::Geometry * geometry)
protectedvirtual

◆ isVirtualIntersector()

bool LineIntersector::isVirtualIntersector ( ) const

◆ setOffset()

void LineIntersector::setOffset ( float offset)

Member Data Documentation

◆ m_hitIndices

std::vector<unsigned int> LineIntersector::m_hitIndices
protected

◆ m_offset

float LineIntersector::m_offset
protected

The documentation for this class was generated from the following files: