Permalink
Browse files

Merge pull request #7 from Cloudef/master

Fix floating point exception
  • Loading branch information...
2 parents 5d22574 + 8334f7d commit d8fb76ce313dae8bcc6edd63655d66cef5ef9330 @Kazade committed Jul 31, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 kazmath/plane.c
View
@@ -132,7 +132,15 @@ kmVec3* const kmPlaneIntersectLine(kmVec3* pOut, const kmPlane* pP, const kmVec3
kmPlane* const kmPlaneNormalize(kmPlane* pOut, const kmPlane* pP)
{
kmVec3 n;
- kmScalar l = 0;
+ kmScalar l = 0;
+
+ if (!pP->a && !pP->b && !pP->c) {
+ pOut->a = pP->a;
+ pOut->b = pP->b;
+ pOut->c = pP->c;
+ pOut->d = pP->d;
+ return pOut;
+ }
n.x = pP->a;
n.y = pP->b;

0 comments on commit d8fb76c

Please sign in to comment.