fix floating point accuracy woes on certain hardware platforms
This commit is contained in:
parent
f4bd175616
commit
058219528d
@ -54,6 +54,12 @@ struct EdgeBasedNode {
|
|||||||
q = y;
|
q = y;
|
||||||
}
|
}
|
||||||
nY = (d*p - c*q)/(a*d - b*c);
|
nY = (d*p - c*q)/(a*d - b*c);
|
||||||
|
|
||||||
|
//discretize the result to coordinate precision. it's a hack!
|
||||||
|
if( std::abs(nY) < (1./COORDINATE_PRECISION) ) {
|
||||||
|
nY = 0.;
|
||||||
|
}
|
||||||
|
|
||||||
r = (p - nY*a)/c;// These values are actually n/m+n and m/m+n , we need
|
r = (p - nY*a)/c;// These values are actually n/m+n and m/m+n , we need
|
||||||
// not calculate the explicit values of m an n as we
|
// not calculate the explicit values of m an n as we
|
||||||
// are just interested in the ratio
|
// are just interested in the ratio
|
||||||
|
Loading…
Reference in New Issue
Block a user