Commit 331456cd authored by Sylvain Thery's avatar Sylvain Thery

topo selection bug

parent 6bc4d3b7
......@@ -622,22 +622,23 @@ Dart TopoRender::raySelection(MAP& map, const Geom::Vec3f& rayA, const Geom::Vec
double dist2 = std::numeric_limits<double>::max();
for(Dart d = map.begin(); d!=map.end(); map.next(d))
{
// get back position of segment PQ
const Geom::Vec3f& P = m_bufferDartPosition[attIndex[d]];
const Geom::Vec3f& Q =m_bufferDartPosition[attIndex[d]+1];
float ld2 = Geom::squaredDistanceLine2Seg(rayA, rayAB, AB2, P, Q);
if (ld2<dm2)
if (!map.isBoundaryMarkedCurrent(d))
{
Geom::Vec3f V = (P+Q)/2.0f - rayA;
double d2 = double(V*V);
if (d2<dist2)
// get back position of segment PQ
const Geom::Vec3f& P = m_bufferDartPosition[attIndex[d]];
const Geom::Vec3f& Q =m_bufferDartPosition[attIndex[d]+1];
float ld2 = Geom::squaredDistanceLine2Seg(rayA, rayAB, AB2, P, Q);
if (ld2<dm2)
{
dist2 = d2;
dFinal = d;
Geom::Vec3f V = (P+Q)/2.0f - rayA;
double d2 = double(V*V);
if (d2<dist2)
{
dist2 = d2;
dFinal = d;
}
}
}
}
return dFinal;
}
......
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