More consolidation of the view map creation.

Made an attempt to fix "2D intersection out of range" warnings.
These warnings may cause "3D intersection out of range" warnings,
which often lead to a crash.
This commit is contained in:
2010-02-11 23:26:22 +00:00
parent ed266e868c
commit a6a5ce4f7b
4 changed files with 14 additions and 10 deletions

View File

@@ -152,7 +152,8 @@ namespace GeomUtils {
const Vec2r& p3,
const Vec2r& p4,
real& t,
real& u) {
real& u,
real epsilon) {
real a1, a2, b1, b2, c1, c2; // Coefficients of line eqns
real r1, r2, r3, r4; // 'Sign' values
real denom, num; // Intermediate values
@@ -189,7 +190,7 @@ namespace GeomUtils {
// Line segments intersect: compute intersection point.
denom = a1 * b2 - a2 * b1;
if (fabs(denom) < M_EPSILON)
if (fabs(denom) < epsilon)
return (COLINEAR);
real d1, d2, e1;