Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix floating point exception

  • Loading branch information...
commit 8334f7d24c49a9d372f0063856dec194eb768c57 1 parent 5d22574
@Cloudef Cloudef authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 kazmath/plane.c
View
10 kazmath/plane.c
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.