Added support for vertex ratios into LineSegmentIntersector.
This commit is contained in:
@@ -324,12 +324,24 @@ void LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Dr
|
||||
if (vertices)
|
||||
{
|
||||
osg::Vec3* first = &(vertices->front());
|
||||
if (triHit._v1) hit.indexList.push_back(triHit._v1-first);
|
||||
if (triHit._v2) hit.indexList.push_back(triHit._v2-first);
|
||||
if (triHit._v3) hit.indexList.push_back(triHit._v3-first);
|
||||
if (triHit._v1)
|
||||
{
|
||||
hit.indexList.push_back(triHit._v1-first);
|
||||
hit.ratioList.push_back(triHit._r1);
|
||||
}
|
||||
if (triHit._v2)
|
||||
{
|
||||
hit.indexList.push_back(triHit._v2-first);
|
||||
hit.ratioList.push_back(triHit._r2);
|
||||
}
|
||||
if (triHit._v3)
|
||||
{
|
||||
hit.indexList.push_back(triHit._v3-first);
|
||||
hit.ratioList.push_back(triHit._r3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
insertIntersection(hit);
|
||||
|
||||
}
|
||||
|
||||
@@ -413,8 +413,6 @@ bool View::computeIntersections(float x,float y, osg::NodePath& nodePath, osgUti
|
||||
{
|
||||
if (!_camera.valid()) return false;
|
||||
|
||||
osg::notify(osg::NOTICE)<<"View::computeIntersections(x,y,node,intersections) not implemented"<<std::endl;
|
||||
|
||||
osg::Matrix matrix = osg::computeWorldToLocal(nodePath) * _camera->getViewMatrix() * _camera->getProjectionMatrix();
|
||||
|
||||
double zNear = -1.0;
|
||||
|
||||
Reference in New Issue
Block a user