Commit c3aea205 authored by Jan Möbius's avatar Jan Möbius
Browse files

Directional hits only for points with positive distance

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15175 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6d7df1c5
......@@ -224,7 +224,9 @@ _raycollision_directional(Node* _node, RayCollisionData& _data) const
this->traits_.points(*it, v0, v1, v2);
if (ACG::Geometry::triangleIntersection(_data.ref, _data.ray, v0, v1, v2, dist, u, v)) {
if ( dist < 0.0 )
// We shoot into direction of the ray
// The first intersection should not be on the starting point
if ( dist <= 0.0 )
continue;
_data.hit_vertices.push_back(*it);
......
......@@ -120,7 +120,9 @@ public: //---------------------------------------------------------------------
/** \brief intersect mesh with ray
*
* This function shots a ray through the mesh and collects all intersected triangles and
* the handle of the closest face ( directional, so the ray direction is taken into account!)
* the handle of the closest face ( directional, so the ray direction is taken into account!).
*
* Only hits with a distance > 0.0 to the point p will be collected (_p will be skipped!)
*
* @param _p Start point of the ray
* @param _r Ray direction
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment