diff options
author | Ken Hughes <khughes@pacific.edu> | 2005-11-01 22:42:55 +0300 |
---|---|---|
committer | Ken Hughes <khughes@pacific.edu> | 2005-11-01 22:42:55 +0300 |
commit | 881f3419c65050eefc1b2440f2b3d60f2928174b (patch) | |
tree | 214233392888b7f9e07a86f3f4e516a1d6a7253f /intern/boolop | |
parent | 68ae6aa7760492777aef77d54cbf2c4fa00b2830 (diff) |
-- avoid some divide-by-zero errors/assertions in boolean modifiers which
caused "Trace/BPT trap" errors (don't normalize zero-length vectors)
Diffstat (limited to 'intern/boolop')
-rw-r--r-- | intern/boolop/intern/BOP_MathUtils.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/boolop/intern/BOP_MathUtils.cpp b/intern/boolop/intern/BOP_MathUtils.cpp index 0d84bb1778c..00c9515a486 100644 --- a/intern/boolop/intern/BOP_MathUtils.cpp +++ b/intern/boolop/intern/BOP_MathUtils.cpp @@ -226,6 +226,8 @@ bool BOP_getCircleCenter(const MT_Point3& p1, const MT_Point3& p2, const MT_Poin // Compute first line vector, perpendicular to plane vector and edge (p1,p2) MT_Vector3 vL1 = p1p2.cross(plane); + if( MT_fuzzyZero(vL1.length() ) ) + return false; vL1.normalize(); // Compute first line point, middle point of edge (p1,p2) @@ -233,6 +235,8 @@ bool BOP_getCircleCenter(const MT_Point3& p1, const MT_Point3& p2, const MT_Poin // Compute second line vector, perpendicular to plane vector and edge (p1,p3) MT_Vector3 vL2 = p1p3.cross(plane); + if( MT_fuzzyZero(vL2.length() ) ) + return false; vL2.normalize(); // Compute second line point, middle point of edge (p1,p3) |